question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSH connect failures on Mitogen 0.2.9 on WSL Ubuntu 18.04

See original GitHub issue

I’m seeing consistent failures when trying to connect via SSH when multiple hosts are specified in the inventory:

TASK [Gathering Facts] **********************************************************************************************************************************************ERROR! [mux  15260] 10:54:20.330539 E mitogen: <Stream ssh.stage-web1 #6e10> crashed 
Traceback (most recent call last):
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 3481, in _call
    func(self)
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 1719, in on_transmit
    self.protocol.on_transmit(broker)
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 2167, in on_transmit
    self._writer.on_transmit(broker)
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 1907, in on_transmit
    written = self._protocol.stream.transmit_side.write(buf)
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 2033, in write 
    written, disconnected = io_op(os.write, self.fd, s)
  File "/home/gchaix/repos/xxx/ansible/plugins/mitogen-0.2.9/mitogen/core.py", line 553, in io_op
    return func(*args), None
OSError: [Errno 11] Resource temporarily unavailable
fatal: [stage-web1]: UNREACHABLE! => {"changed": false, "msg": "Mitogen was disconnected from the remote environment while a call was in-progress. If you feel this is in error, please file a bug. Original error was: the respondent Context has disconnected", "unreachable": true}
ok: [stage-web2] 

One host connects, all of the host connections other fail. If there are more than two hosts in the inventory, all but one fail with the same errors. Repeated runs show that the host that fails appears to be random.

PLAY RECAP **********************************************************************************************************************************************************
prod-solr1         : ok=0    changed=0    unreachable=1    failed=0
prod-solr2        : ok=0    changed=0    unreachable=1    failed=0
prod-solr3         : ok=0    changed=0    unreachable=1    failed=0    
prod-util1 : ok=8    changed=0    unreachable=0    failed=0
prod-web1          : ok=0    changed=0    unreachable=1    failed=0
prod-web2          : ok=0    changed=0    unreachable=1    failed=0
prod-web3          : ok=0    changed=0    unreachable=1    failed=0

Environment: Mitogen 0.2.9 Windows 10 Pro, V. 1809, OS build 17763.914 WSL Ubuntu 18.04.3 LTS ansible 2.7.11 config file = /home/gchaix/repos/xxx/ansible/ansible.cfg configured module search path = [u'/home/gchaix/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /home/gchaix/.local/lib/python2.7/site-packages/ansible executable location = /home/gchaix/.local/bin/ansible python version = 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0] Host target OS is generally CentOS 7.x but this also appears to be happening with other distros (Ubuntu, etc.)

No patches on Ansible or Mitogen. I tried running it with Mitogen current master, same behavior. This feels like it might be related to #319 but I’m not familiar enough with the internals of WSL to really say for certain. Interestingly, running Ansible with -vvv seems to bypass the issue, as all host connections succeed, whereas running with just --verbose produces failure and the output above.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:18

github_iconTop GitHub Comments

1reaction
gchaixcommented, Jul 1, 2020

I’m still on WSL1 and definitely seeing the problem. Sadly, I don’t know of any test envs that provide WSL instances to test.

1reaction
gchaixcommented, Apr 27, 2020

I’m still seeing failures on master @ a5fe4a9f

ansible-playbook 2.9.6
  config file = /home/gchaix/repos/project/ansible/ansible.cfg
  configured module search path = [u'/home/gchaix/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/gchaix/.local/lib/python2.7/site-packages/ansible
  executable location = /home/gchaix/.local/bin/ansible-playbook
  python version = 2.7.17 (default, Apr 15 2020, 17:20:14) [GCC 7.5.0]
Using /home/gchaix/repos/project/ansible/ansible.cfg as config file
TASK [Gathering Facts] *******************************************************************************************************************************************************************ERROR! [mux  734] 12:05:11.015470 E mitogen: <Stream ssh.stage-web2.bak #1050> crashed
Traceback (most recent call last):
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 3481, in _call
    func(self)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 1719, in on_transmit
    self.protocol.on_transmit(broker)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 2167, in on_transmit
    self._writer.on_transmit(broker)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 1907, in on_transmit
    written = self._protocol.stream.transmit_side.write(buf)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 2033, in write
    written, disconnected = io_op(os.write, self.fd, s)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 553, in io_op
    return func(*args), None
OSError: [Errno 11] Resource temporarily unavailable
fatal: [stage-web2.bak]: UNREACHABLE! => {"changed": false, "msg": "Mitogen was disconnected from the remote environment while a call was in-progress. If you feel this is in error, please file a bug. Original error was: the respondent Context has disconnected", "unreachable": true}
ERROR! [mux  734] 12:05:11.303791 E mitogen: <Stream ssh.stage-web1.bak #b8d0> crashed
Traceback (most recent call last):
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 3481, in _call
    func(self)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 1719, in on_transmit
    self.protocol.on_transmit(broker)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 2167, in on_transmit
    self._writer.on_transmit(broker)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 1907, in on_transmit
    written = self._protocol.stream.transmit_side.write(buf)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 2033, in write
    written, disconnected = io_op(os.write, self.fd, s)
  File "/home/gchaix/repos/project/ansible/plugins/mitogen-head/mitogen/core.py", line 553, in io_op
    return func(*args), None
OSError: [Errno 11] Resource temporarily unavailable
fatal: [stage-web1.bak]: UNREACHABLE! => {"changed": false, "msg": "Mitogen was disconnected from the remote environment while a call was in-progress. If you feel this is in error, please file a bug. Original error was: the respondent Context has disconnected", "unreachable": true}
ok: [prod-util1.bak]
Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH connect failures on Mitogen 0.2.9 on WSL Ubuntu 18.04
I'm seeing consistent failures when trying to connect via SSH when multiple hosts are specified in the inventory: TASK [Gathering Facts] ...
Read more >
Mitogen for Ansible
Mitogen for Ansible is a completely redesigned UNIX connection layer and module runtime for Ansible. Requiring minimal configuration changes, it updates ...
Read more >
Got an error while Ansible ping from host to remote server via ...
I have used Mitogen for speed up. Please see the below logs getting while running the ansible ping command with -vvv. Following is...
Read more >
Debian -- Source Packages in "sid", Subsection misc
... gnome-shell-extension-bluetooth-quick-connect (30-1); gnome-shell-extension-caffeine ... golang-github-leanovate-gopter (0.2.9+git20210201.bbbf00e-1) ...
Read more >
visual studio 2019 fails to ssh into wsl ubuntu...anycodings
visual studio 2019 fails to ssh into wsl ubuntu 18.04 I'm having some problems connecting to wsl anycodings_windows-s ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found