Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinRM connection error 101 #23863

Closed
yop190 opened this issue Apr 21, 2017 · 9 comments
Closed

WinRM connection error 101 #23863

yop190 opened this issue Apr 21, 2017 · 9 comments
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. c:plugins/connection/winrm needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community

Comments

@yop190
Copy link

yop190 commented Apr 21, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Any win module

ANSIBLE VERSION
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

CONFIGURATION

Default configuration

OS / ENVIRONMENT

Run in Docker based on williamyeh/ansible:ubuntu16.04

SUMMARY

Since upgrade to 2.3.0, sometimes a communication failure appear with the windows VM

UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='xxx.xxx.xxx.xxx', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe4220bcd50>: Failed to establish a new connection: [Errno 101] Network is unreachable',))", "unreachable": true}

If I relaunch the playbook, maybe that can run or not;)

STEPS TO REPRODUCE
main.yml
---
- hosts: all
  roles: selenium

roles/selenium/tasks/main.yml
---
  - name: install selenium drivers all
    win_chocolatey: "name=selenium-all-drivers"

  - name: install nssm
    win_chocolatey: "name=nssm"
EXPECTED RESULTS

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [xxx.xxx.xxx.139]
ok: [xxx.xxx.xxx.141]

TASK [common : install selenium drivers all] ***********************************
ok: [xxx.xxx.xxx.139]
ok: [xxx.xxx.xxx.141]

ACTUAL RESULTS
PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [xxx.xxx.xxx.139]
ok: [xxx.xxx.xxx.141]

TASK [common : install selenium drivers all] ***********************************
fatal: [xxx.xxx.xxx.139]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='xxx.xxx.xxx.139', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe4220bcd50>: Failed to establish a new connection: [Errno 101] Network is unreachable',))", "unreachable": true}
ok: [xxx.xxx.xxx.141]

=========OR======

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
fatal: [xxx.xxx.xxx.139]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='xxx.xxx.xxx.139', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe4220bcd50>: Failed to establish a new connection: [Errno 101] Network is unreachable',))", "unreachable": true}
ok: [xxx.xxx.xxx.141]

TASK [common : install selenium drivers all] ***********************************
ok: [xxx.xxx.xxx.141]


@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report needs_triage Needs a first human triage before being processed. labels Apr 21, 2017
@s-hertel s-hertel added the windows Windows community label Apr 21, 2017
@s-hertel s-hertel changed the title WinRM connection error 401 WinRM connection error 101 Apr 21, 2017
@s-hertel s-hertel added c:plugins/connection/winrm and removed needs_triage Needs a first human triage before being processed. labels Apr 21, 2017
@daBONDi
Copy link
Contributor

daBONDi commented May 22, 2017

Are your Target hosts VirtualBox VM's?
Got the same Problem with some Virtual Box VMs, after long Runtime the Network getting Akward on Windows, the only solutino i found was restarting vm, then it works for like 2-5 hours

@ansibot ansibot added the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Jun 29, 2017
@jhawkesworth
Copy link
Contributor

At 19:00 UTC on Tuesday 19 September 2017 this ticket will be processed during the second Windows Sprint,
https://github.com/ansible/community/wiki/Windows:-sprints
we would appreciate if you could join the Sprint to help out with understanding/fixing/closing this issue.

@dagwieers
Copy link
Contributor

dagwieers commented Sep 19, 2017

So it seems to be a network-related problem rather than a WinRM or Windows related problem (a routing problem or a firewall issue). Maybe even a Docker-related problem (interface issue), or a problem with the Windows host (no longer connected to the network or routing issue to Docker ?).

Can you verify that you can connect to the WinRM port (usually 5986 for HTTPS).

needs_info

@basictheprogram
Copy link

Does the information list at provision_docker help?

Specifically adding routes (towards the bottom) ?

@hdansou
Copy link

hdansou commented Sep 19, 2017

When the driver was installed, the network probably dropped and killed the winrm connection.

@jhawkesworth
Copy link
Contributor

@yop190 Discussed at the sprint call - @hdansou's suggestion above seems plausible as anything that interrupts network connection is likely to break the winrm communications.

Could you try running using async, or via a scheduled task?

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Sep 19, 2017
@dagwieers
Copy link
Contributor

I wonder if this is a recoverable problem, i.e. would a retry with a specific delay overcome this issue ? If so, we could add this, next to "Connection refused" as part of making WinRM a but more resilient. diyan/pywinrm#174 cc: @nitzmahone

@ansibot
Copy link
Contributor

ansibot commented Jan 31, 2018

@yop190 This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
@jborean93
Copy link
Contributor

Closing as this is a generic user question and a thread already exists to talk about retries after connection refused #25532

@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. c:plugins/connection/winrm needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community
Projects
None yet
Development

No branches or pull requests

9 participants