Giter VIP home page Giter VIP logo

mitogen's Introduction

mitogen's People

Contributors

a-detiste avatar adone avatar annttu avatar badeadan avatar candlerb avatar danielcompton avatar danquack avatar davidmehren avatar deztructor avatar dw avatar insaneprawn avatar jesteria avatar luizribeiro avatar lumatijev avatar marc1006 avatar markusteufelberger avatar metricmike avatar moreati avatar nerijus avatar nmattia avatar opoplawski avatar philfry avatar s1113950 avatar saady avatar scottsb avatar stefanor avatar willmerae avatar yannig avatar zerwes avatar zocker1999net avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mitogen's Issues

FindRelatedImportsTest expect values appear to be wrong

The tests in module_finder_test.FindRelatedImportsTest check the return value of mitogen.master.ModuleFinder.find_related_imports(). However they are currently failing, to take one example

https://github.com/dw/mitogen/blob/f70ffa72d2d73378be39fab193bd8807aa5b7a84/tests/module_finder_test.py#L147-L155

The actual return value is

>>> mf.find_related_imports('django)
['django.utils.version']

By visual inspection the method appears to return the direct imports of django/__init__.py @ 1.11.5 that are outside the stdlib

Relatedly,

>>> mf.find_related("django")'
['django.utils', 'django.utils.lru_cache', 'django.utils.version']

By visual inspection this appears to return direct and indirect imports of django/__init__.py @ 1.11.5 that are outside the stdlib. This is the same as the expected value, minus 'django'.

I'm guessing that these tests were written when the design of ModuleFinder was still in flux. Originally ModuleFinderfind_related_imports() returned the module and it's direct+indirect imports.Then by the time these tests were imported (Feb 10 2018), the API of ModuleFinder had evolved.

I have a patch for FindRelatedImportsTest in the works, based on that guess.

SSH connections time out when you need to accept a fingerprint

I had weird problems getting mitogen to work when testing it out, one issue was incorrect documentation (PR sent!) but the other was that I tried to connect to MACHINE2 via MACHINE1 but I didn't have MACHINE2 in authorized_hosts. After doing this myself:

[username@MACHINE1 ~]$ ssh MACHINE2
The authenticity of host 'MACHINE2 (XX.XX.XX.XX)' can't be established.
RSA key fingerprint is [redacted]
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[redacted]' (RSA) to the list of known hosts.

mitogen connected fine.

Compress the bootstrap/first stage code

It struck me that a few bytes could be shaved off the bootstrap code constructed by Stream.get_preamble. As well as base66_codec, there is zlib_codec. So I think the following could be made to work

diff --git a/mitogen/master.py b/mitogen/master.py
index ccefbda..d7e5f7a 100644
--- a/mitogen/master.py
+++ b/mitogen/master.py
@@ -704,7 +704,7 @@ class Stream(mitogen.core.Stream):
     # replaced with the context name. Optimized for size.
     @staticmethod
     def _first_stage():
-        import os,sys,zlib
+        import os,sys
         R,W=os.pipe()
         R2,W2=os.pipe()
         if os.fork():
@@ -716,7 +716,7 @@ class Stream(mitogen.core.Stream):
             os.execv(sys.executable,['mitogen:CONTEXT_NAME'])
         else:
             os.write(1, 'EC0\n')
-            C = zlib.decompress(sys.stdin.read(input()))
+            C = sys.stdin.read(input()).decode('zlib')
             os.fdopen(W,'w',0).write(C)
             os.fdopen(W2,'w',0).write('%s\n%s' % (len(C),C))
             os.write(1, 'EC1\n')
@@ -727,9 +727,9 @@ class Stream(mitogen.core.Stream):
         source = textwrap.dedent('\n'.join(source.strip().split('\n')[2:]))
         source = source.replace('    ', '\t')
         source = source.replace('CONTEXT_NAME', self.remote_name)
-        encoded = source.encode('base64').replace('\n', '')
+        encoded = source.encode('zlib').encode('base64').replace('\n', '')
         return [self.python_path, '-c',
-                'exec("%s".decode("base64"))' % (encoded,)]
+                'exec("%s".decode("base64").decode("zlib"))' % (encoded,)]
 
     def get_preamble(self):
         parent_ids = mitogen.parent_ids[:]

docs: stats tracking fails on https://

1ea97ea add stats tracking of page views to the project documentation, hosted at https://mitogen.readthedocs.io. This URL is served over https, http visitors are redirected to https.

However:

  • the `<script> is served from https://37.187.23.96
  • the <img> fallback is unconditionally served over plain http

Neither can work. All modern browsers will

  • refuse to load the javascript; an IP address cannot match the name (k1.botanicus.net) in the SSL certificate
  • refuse to load any resource served over plain http, in a document with an https origin

The resulting errors can be seen in the javascript console.

ansible: CookieJar / LWPCookieJar class incompatibily while using the uri module.

Environment:

$ ansible --version
ansible 2.4.3.0
  config file = /builds/project-0/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12+ (default, Sep 17 2016, 12:08:02) [GCC 6.2.0 20160914]
$ uname -a
Linux runner--project-0-concurrent-0 4.15.1-041501-generic #201802031831 SMP Sat Feb 3 18:32:13 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

OS: Ubuntu 16:10 (Docker image)

Task:

- name: Get auth token
  uri:
    url: "https://keycloak.example.com/auth/realms/master/protocol/openid-connect/token"
    method: POST
    body: "client_id=admin-cli&username=admin&\
           password={{ keycloak_admin_password }}&grant_type=password"
    return_content: true
    validate_certs: false
  register: r_token
  no_log: false
  run_once: true
  delegate_to: localhost

Example failure

TASK [Get auth token] **********************************************************
task path: /builds/project-0/setup/client.yml:4
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/tmp/mitogen-master/ansible_mitogen/mixins.py", line 121, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/tmp/mitogen-master/ansible_mitogen/mixins.py", line 279, in _execute_module
    env=cast(env),
  File "/tmp/mitogen-master/ansible_mitogen/mixins.py", line 130, in call
    return self._connection.call(func, *args, **kwargs)
  File "/tmp/mitogen-master/ansible_mitogen/connection.py", line 231, in call
    return self.call_async(func, *args, **kwargs).get().unpickle()
  File "/tmp/mitogen-master/mitogen/core.py", line 314, in unpickle
    raise obj
CallError: exceptions.TypeError: unbound method __init__() must be called with CookieJar instance as first argument (got LWPCookieJar instance instead)
  File "<stdin>", line 1368, in _dispatch_calls
  File "<stdin>", line 1363, in _dispatch_one
  File "master:/tmp/mitogen-master/ansible_mitogen/helpers.py", line 128, in run_module
    mod.main()
  File "/usr/local/lib/python2.7/dist-packages/ansible/modules/net_tools/basics/uri.py", line 439, in main
    dict_headers, socket_timeout)
  File "/usr/local/lib/python2.7/dist-packages/ansible/modules/net_tools/basics/uri.py", line 352, in uri
    method=method, timeout=socket_timeout)
  File "/usr/local/lib/python2.7/dist-packages/ansible/module_utils/urls.py", line 1040, in fetch_url
    cookies = cookiejar.LWPCookieJar()
  File "/usr/lib/python2.7/cookielib.py", line 1758, in __init__
    CookieJar.__init__(self, policy)

Mitogen fails on Ubuntu 16.04

ansible --version (on Ubuntu 16.04.3 LTS):

ansible 2.4.3.0
  config file = /root/test-epaflex/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]

Error when running the following command:
ansible-playbook -i "host.local," --extra-vars "@config.yml" playbooks/deploy_sites.yml

Output using -vvv:

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/root/ansible/mitogen-master/ansible_mitogen/mixins.py", line 121, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/root/ansible/mitogen-master/ansible_mitogen/mixins.py", line 282, in _execute_module
    env=cast(env),
  File "/root/ansible/mitogen-master/ansible_mitogen/mixins.py", line 130, in call
    return self._connection.call(func, *args, **kwargs)
  File "/root/ansible/mitogen-master/ansible_mitogen/connection.py", line 231, in call
    return self.call_async(func, *args, **kwargs).get().unpickle()
  File "/root/ansible/mitogen-master/mitogen/core.py", line 314, in unpickle
    raise obj
CallError: exceptions.ImportError: No module named system.setup
  File "<stdin>", line 1368, in _dispatch_calls
  File "<stdin>", line 1363, in _dispatch_one
  File "master:/root/ansible/mitogen-master/ansible_mitogen/helpers.py", line 122, in run_module
    mod = __import__(module, {}, {}, [''])


fatal: [host.local]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}

The same playbook runs fine from Mac OS X:

ansible 2.4.3.0
  config file = /Users/mike/sites/epaflex-hosting/ansible.cfg
  configured module search path = [u'/Users/mike/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]

remote execution

Hi, I saw your recent mitogen article, and then found this repo... You wrote:

interested or have related ideas, please drop me an e-mail

I hope you don't mind that I decided to reach out over GH issue instead of email. Feel free to close this once you've read, or even if you've decide to ignore this completely :)

I started a project called mgmt: https://github.com/purpleidea/mgmt/

It has some different goals, but one of it's features is the ability to run in a manner similar to your tool:

https://ttboj.wordpress.com/2016/10/07/remote-execution-in-mgmt/

Here's a video, which includes a demonstration of the remote execution:

https://www.youtube.com/watch?v=LkEtBVLfygE&html5=1

If you're interested, feel free to get involved, and I'm certainly happy to help. I'm easily reachable as purpleidea on Freenode IRC in the #mgmtconfig channel.

One heads up: it's written in golang, not python. I used to be a major python user, but I decided golang was a better fit for this infrastructure tool.

One other small note: while we designed in the ability to "recursively" (your term) execute remotely, this particular feature isn't implemented yet, but is on the TODO list. The regular execution works well.

Good luck with your project!

ModuleFinder().is_stdlib_name('email') == False inside a VirtualEnv

If mitogen is run with an activated VirtualEnv then ModuleFinder mischaracterizes stdlib modules as third party, e.g.

[~/src/mitogen $] . v/bin/activate
[~/src/mitogen (v) $] python
Python 2.7.14 (default, Sep 23 2017, 22:06:14) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mitogen.master
>>> import email
>>> mf = mitogen.master.ModuleFinder()
>>> mf.is_stdlib_name('email')
False

It looks like the cause is a mismatch between the module's __file__ attribute and ModuleFinder().STD_LIBS

>>> sys.modules.get('email').__file__
'/usr/lib/python2.7/email/__init__.pyc'
>>> mf.STDLIB_DIRS
['/home/alex/src/mitogen/v/lib/python2.7', '/home/alex/src/mitogen/v/lib']

fakessh: Queries/potential problems

David,

I'm running out of ideas regarding the unit test failures in fakessh_test. A few queries/shots in the dark for you

  1. What sets mitogen.fakessh._mitogen, such that mitogen.fakessh.exit() can call _mitogen.broker.shutdown() without raising an AttributeError?

  2. In mitogen.fakessh._fakessh_main() there is the line
    https://github.com/dw/mitogen/blob/43fae4414a2103b7ac6d0e09f9d67b777a2aac39/mitogen/fakessh.py#L299
    which is passing stdin_fd=1, stdout_fd=0. That's the opposite of what is usual, are those arguments the correct way around?

  3. Running one of the failing tests with

    python tests/fakessh_test.py  RsyncTest.test_rsync_from_master
    

    having added a call to mitogen.core.enable_debug_logging() I see one warning, and one error in the resulting log, namely

    22:35:36 W mitogen.ctx.ssh.localhost:32821: mitogen: CALL_FUNCTION from non-parent 2
    

    are you aware of this warning?

ansible: environment difference while running debops playbooks

Found while working on #110. My bashrc environment sets en_GB.UTF-8. When running with Mitogen, the run completes, but with non-Mitogen, then run fails with:

TASK [debops.sshd : Check if OpenSSH is installed (or half-installed)] *************************************************************************************************************
fatal: [35.200.184.46]: FAILED! => {"changed": false, "failed": true, "failed_when_result": true, "rc": 0, "stderr": "Shared connection to 35.200.184.46 closed.\r\n", "stdout": "bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)\r\ninstalled\r\n", "stdout_lines": ["bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)", "installed"]}

Because the Ansible master's environment is getting copied across somehow, and the locale data was missing on the target box. Figure out what's happening

Place to Congregate

I don't really know if this is the right place, but I think that mitogen could benefit from some kind of community where we can chat a bit about what's going on.

For example: gitter, discord, reddit, slack, etc.

mitogen crashed with "error: unpack requires a string argument of length 12"

Hi,

trying the lastest mitogen is crashing with "error: unpack requires a string argument of length 12" while running an apt task - the traceback is:

TASK [jmetex : install jmetex] *******************************************************************************************************************************************************************************************************************************************************************************************************************************************
task path: /Users/tom/repo/infrastructure/ansible/roles/jmetex/tasks/main.yml:6
[pid 9967] 17:29:19 D mitogen: unix.connect(path='/var/folders/jd/tvrdj3v55_z5ql3mgb4jky1c0000gn/T/mitogen_unix_Dc8KhF')
[pid 9953] 17:29:19 D mitogen: register(Context(9, None), mitogen.core.Stream('unix_client.9967'))
[pid 9967] 17:29:19 D mitogen: unix.connect(): local ID is 9, remote is 0
[pid 9967] 17:29:19 D mitogen: register(Context(0, None), mitogen.core.Stream('unix_listener.9953'))
[pid 9967] 17:29:19 D mitogen: Context(0, None).send_async(Message(None, 9, 9, 500, 1000, '\x80\x02}q\x01(U\x08usernameq\x02X\t\x00\x00\x00teichhornq\x03U\x0fcheck_host_key'..298))
[pid 9953] 17:29:19 D mitogen: put() done. woken? True
[pid 9967] 17:29:19 D mitogen: put() done. woken? True
[pid 9967] 17:29:19 D mitogen: Context(0, None).send_async(Message(None, 9, 9, 500, 1001, '\x80\x02}q\x01(U\x08usernameq\x02X\x04\x00\x00\x00rootq\x03U\x03viaq\x04cmitogen.core\n'..224))
[pid 9953] 17:29:19 D mitogen: put() done. woken? True
[pid 9967] 17:29:19 D mitogen: put() done. woken? True
[pid 9967] 17:29:19 D mitogen: Context(5, u'ssh.10.90.4.46.sudo.root').call_async(<function run_module at 0x10a470140>, *('ansible.modules.packaging.os.apt',), **{'args': {'_ansible_version': '2.4.3.0', '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], u'name': u'jmetex', '_ansible_module_name': u'apt', '_ansible_syslog_facility': u'LOG_USER', '_ansible_verbosity': 3, '_ansible_socket': None, '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False, '_ansible_no_log': False}, 'env': {}})
[pid 9967] 17:29:19 D mitogen: Context(5, u'ssh.10.90.4.46.sudo.root').send_async(Message(None, 9, 9, 101, 1002, '\x80\x02(U\x17ansible_mitogen.helpersq\x01NU\nrun_moduleq\x02U ans'..486))
[pid 9968] 17:29:19 D mitogen: unix.connect(path='/var/folders/jd/tvrdj3v55_z5ql3mgb4jky1c0000gn/T/mitogen_unix_Dc8KhF')
[pid 9953] 17:29:19 E mitogen: <mitogen.unix.Listener object at 0x10a47e3d0> crashed
Traceback (most recent call last):
  File "/Users/tom/repo/mitogen/mitogen/core.py", line 1185, in _call
    func(self)
  File "/Users/tom/repo/mitogen/mitogen/unix.py", line 81, in on_receive
    pid, = struct.unpack('>L', sock.recv(4))
error: [Errno 35] Resource temporarily unavailable
[pid 9953] 17:29:19 D mitogen: <mitogen.unix.Listener object at 0x10a47e3d0>.on_disconnect()
[pid 9968] 17:29:19 D ansible_mitogen.connection: Call run_module('ansible.modules.packaging.os.apt',) took 7 ms
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/Cellar/ansible/2.4.3.0/libexec/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/usr/local/Cellar/ansible/2.4.3.0/libexec/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/Users/tom/repo/mitogen/ansible_mitogen/mixins.py", line 128, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/usr/local/Cellar/ansible/2.4.3.0/libexec/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/Users/tom/repo/mitogen/ansible_mitogen/mixins.py", line 308, in _execute_module
    env=cast(env),
  File "/Users/tom/repo/mitogen/ansible_mitogen/mixins.py", line 137, in call
    return self._connection.call(func, *args, **kwargs)
  File "/Users/tom/repo/mitogen/ansible_mitogen/connection.py", line 238, in call
    return self.call_async(func, *args, **kwargs).get().unpickle()
  File "/Users/tom/repo/mitogen/ansible_mitogen/connection.py", line 224, in call_async
    self._connect()
  File "/Users/tom/repo/mitogen/ansible_mitogen/connection.py", line 192, in _connect
    self.router, self.parent = mitogen.unix.connect(path)
  File "/Users/tom/repo/mitogen/mitogen/unix.py", line 100, in connect
    mitogen.context_id, remote_id, pid = struct.unpack('>LLL', sock.recv(12))
error: unpack requires a string argument of length 12

fatal: [DE-IX-001-02-02-05-4]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

Ansible and python versions:

ansible 2.4.3.0
  config file = /Users/tom/.ansible.cfg
  configured module search path = [u'/Users/tom/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.4.3.0/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]

The relevant playbook part is this:

- name: install jmetex
  apt:
    name: jmetex

If you need further outputs please ask!
You're work is awesome!

Thanks,
Tom

TimeoutError on OSX Vagrant

I'm running OSX 10.13.3 with Python 2.7 and Ansible 2.4.2.0.

I followed the directions here: http://mitogen.readthedocs.io/en/latest/ansible.html and setup mitogen in it's own directory.

I created a blank ansible.cfg with:

strategy_plugins = ./mitogen-master/ansible_mitogen/plugins/strategy
strategy = mitogen```

site.yml:

```---
# Testing out Mitogen

- hosts: mitogen
  remote_user: root
  become: yes
  become_method: sudo
  gather_facts: no
  vars:
    nodejs_version: "4.x"
  roles:
    - ansible-role-epel
    - ansible-role-nodejs```

Vagrantfile:

```# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vbguest.auto_update = false
  #config.vm.network "public_network", ip: "192.168.1.134", bridge: "en0: Wi-Fi (AirPort)"
  config.vm.define "mitogen" do |m|
    m.vm.box = "geerlingguy/centos7"
  end

  config.vm.provision "ansible" do |ansible|
      ansible.playbook = "site.yml"
      ansible.limit = 'all'
      ansible.groups = {
        "mitogen" => ["mitogen"],
      }
  end
end```

Result:

```PLAY [mitogen] *****************************************************************

TASK [ansible-role-epel : Check if EPEL repo is already configured.] ***********
An exception occurred during task execution. To see the full traceback, use -vvv. The error was:     raise mitogen.core.TimeoutError('read timed out')
fatal: [mitogen]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
	to retry, use: --limit @/Users/ken/mitogen/site.retry

PLAY RECAP *********************************************************************
mitogen                    : ok=0    changed=0    unreachable=0    failed=1```

import mitogen raises SyntaxError on Python 2.4.x

~/src/mitogen % python -V     
Python 2.4.4
~/src/mitogen % python -c "import mitogen; mitogen.main()"
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "mitogen/__init__.py", line 113
    from . import utils
         ^
SyntaxError: invalid syntax

Patch in progress

core.Stream.modules_sent vs parent.Stream.sent_modules

There is to a mismatch between core.Stream and parent.Stream. They use differently named properties for the same concept. I presume this is an oversight, rather than intentional.

On the basis that 'modules_sent' appears nowhere outside core.Stream.__init__ it might make sense to remove this attribute entirely from the base class.

ansible: deadlock due to forking with logging.Handler lock held

Using mitogen with Ansible and 19 hosts consistently hangs, though not on the same host, or the same task when I rerun. I can reproduce with my own playbooks (as early as the first task) as well as https://github.com/dw/mitogen/blob/44fc8452b686fb742447cf2716f243e9d036aa72/examples/playbook/issue_131.yml. I've reproduced the hang with as few as 10 hosts. Logs at the very bottom.

When it hangs, the output is something like below, where 18/19 hosts complete the task (output from one of my playbooks, but similar on issue_131.yml):

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

TASK [Gathering Facts] ********************************************************
ok: [env8-prod-bastion]
ok: [env2-prod-bastion]
ok: [env3-prod-bastion]
ok: [env1-prod-bastion]
ok: [env5-prod-bastion]
ok: [env6-prod-bastion]
ok: [env4-prod-bastion]
ok: [env7-prod-bastion]
ok: [env5-stage-bastion]
ok: [env6-stage-bastion]
ok: [env7-demo-bastion]
ok: [env7-stage-bastion]
ok: [env9-demo-bastion]
ok: [env3-stage-bastion]
ok: [env1-stage-bastion]
ok: [env1-demo-bastion]
ok: [env4-demo-bastion]
ok: [env4-stage-bastion]
ok: [env2-demo-bastion]
ok: [env2-stage-bastion]

TASK [common : Configure passwordless sudo for the Ansible user] **************
ok: [env8-prod-bastion]
ok: [env2-prod-bastion]
ok: [env3-prod-bastion]
ok: [env1-prod-bastion]
ok: [env5-prod-bastion]
ok: [env6-prod-bastion]
ok: [env4-prod-bastion]
ok: [env7-prod-bastion]
ok: [env6-stage-bastion]
ok: [env7-stage-bastion]
ok: [env5-stage-bastion]
ok: [env9-demo-bastion]
ok: [env3-stage-bastion]
ok: [env1-stage-bastion]
ok: [env1-demo-bastion]
ok: [env4-stage-bastion]
ok: [env4-demo-bastion]
ok: [env2-demo-bastion]
ok: [env2-stage-bastion]

Versions

Controller: OS X 10.11.6, Python from Homebrew.
Targets: Amazon Linux (RHEL-ish + backports + random Amazon things)
Mitogen: 44fc845

ansible 2.4.3.0
  config file = /Users/andy/gr/myproject/ansible.cfg
  configured module search path = [u'/Users/andy/gr/myproject/ansible/library', u'/Users/andy/gr/myproject/ansible/library/vendor']
  ansible python module location = /Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible
  executable location = .tox/deploy/bin/ansible
  python version = 2.7.14 (default, Mar  1 2018, 19:23:40) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

Ansible config

ANSIBLE_FORCE_COLOR(/Users/andy/gr/myproject/ansible.cfg) = True
ANSIBLE_PIPELINING(/Users/andy/gr/myproject/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/Users/andy/gr/myproject/ansible.cfg) = -F ansible/ssh_config -o ControlMaster=auto -o ControlPersist=60s
DEFAULT_CALLBACK_WHITELIST(/Users/andy/gr/myproject/ansible.cfg) = ['timer']
DEFAULT_FORKS(/Users/andy/gr/myproject/ansible.cfg) = 50
DEFAULT_GATHERING(/Users/andy/gr/myproject/ansible.cfg) = smart
DEFAULT_GATHER_SUBSET(/Users/andy/gr/myproject/ansible.cfg) = all,!ohai,!facter
DEFAULT_HOST_LIST(/Users/andy/gr/myproject/ansible.cfg) = [u'/Users/andy/gr/myproject/ansible/inventory_from_ssh_config.py']
DEFAULT_MODULE_PATH(/Users/andy/gr/myproject/ansible.cfg) = [u'/Users/andy/gr/myproject/ansible/library', u'/Users/andy/gr/myproject/ansible/library/vendor']
DEFAULT_ROLES_PATH(/Users/andy/gr/myproject/ansible.cfg) = [u'/Users/andy/gr/myproject/ansible/roles', u'/Users/andy/gr/myproject/ansible/shared_roles']
DEFAULT_STRATEGY(/Users/andy/gr/myproject/ansible.cfg) = mitogen
DEFAULT_STRATEGY_PLUGIN_PATH(/Users/andy/gr/myproject/ansible.cfg) = [u'/Users/andy/forks/mitogen/ansible_mitogen/plugins/strategy']

Logs

10 hosts, issue_131.yml

ansible-playbook 2.4.3.0
  config file = /Users/andy/gr/myproject/ansible.cfg
  configured module search path = [u'/Users/andy/gr/myproject/ansible/library', u'/Users/andy/gr/myproject/ansible/library/vendor']
  ansible python module location = /Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible
  executable location = .tox/deploy/bin/ansible-playbook
  python version = 2.7.14 (default, Mar  1 2018, 19:23:40) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
Using /Users/andy/gr/myproject/ansible.cfg as config file
Parsed /Users/andy/gr/myproject/ansible/inventory_from_ssh_config.py inventory source with script plugin

PLAYBOOK: issue_131.yml *************************************************************************************************************************************************************************
1 plays in /Users/andy/forks/mitogen/examples/playbook/issue_131.yml

PLAY [all] **************************************************************************************************************************************************************************************
META: ran handlers

TASK [command] **********************************************************************************************************************************************************************************
task path: /Users/andy/forks/mitogen/examples/playbook/issue_131.yml:11
[pid 23261] 16:58:55 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23261] 16:58:55 D mitogen: unix.connect(): local ID is 1, remote is 0
[pid 23253] 16:58:55 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23262] 16:58:55 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23262] 16:58:55 D mitogen: unix.connect(): local ID is 3, remote is 0
[pid 23253] 16:58:55 D mitogen: tty_create_child() child 23264 fd 101, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env9-demo-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;=codecs.decode;exec((_("eNpdj0FrwzAMhc/Lr9hNNnOD7TDIAoGOMHYPYzlsYySxW0wT2zjp3O7XzyGFub0IfXqSHq8mTWmm1CorEU4c8RGp3X2AnXEHhIvkLvTiaDmihFGK/7kmMbmgspX7wUwS1TG4GJoY/ApS/yhn9Ac816/vFL7K6RyGJ9kf57Yb5LoTcEDXAoFRzWYvddFqcd4uZbM3RrhT+rYZTacGmfZmLHjGHzPASXjjnZolYgReKvqpw6wqv9ESWBgrdYgJrgOcOtkK9MRzhgn8KrveXnYaAh5C/MuvKtb8tQZZluc8+DxUt+5scf8Db9F3zg==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:55 D mitogen: mitogen.ssh.Stream('local.23264').connect(): child process stdin/stdout=101
[pid 23263] 16:58:55 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23263] 16:58:56 D mitogen: unix.connect(): local ID is 4, remote is 0
[pid 23265] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23265] 16:58:56 D mitogen: unix.connect(): local ID is 5, remote is 0
[pid 23266] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23266] 16:58:56 D mitogen: unix.connect(): local ID is 6, remote is 0
[pid 23267] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23267] 16:58:56 D mitogen: unix.connect(): local ID is 7, remote is 0
[pid 23268] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23268] 16:58:56 D mitogen: unix.connect(): local ID is 8, remote is 0
[pid 23269] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23269] 16:58:56 D mitogen: unix.connect(): local ID is 9, remote is 0
[pid 23270] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23270] 16:58:56 D mitogen: unix.connect(): local ID is 10, remote is 0
[pid 23271] 16:58:56 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23271] 16:58:56 D mitogen: unix.connect(): local ID is 11, remote is 0
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('local.23264'): received "Warning: Permanently added '34.210.11.231' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('local.23264'): received 'EC0\n'
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('local.23264')._ec0_received()
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23261] 16:58:56 D mitogen: Context(2, u'ssh.env9-demo-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:58:56 D mitogen: tty_create_child() child 23272 fd 121, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env7-demo-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FrwzAMhc/Lr9hNNnODHTPIAoGOMHYPYzlsYySxW0wT2zjp3O7XzyGFub0IfXqSHq8mTWmm1CorEU4c8RGp3X2AnXEHhIvkLvTiaDNECaMU/3NNYnJBZSv3g5kkqmNwMTQx+BWk/lHO6A94rl/fKXyV0zkMT7I/zm03yHUn4ICuBQKjms1e6qLV4rxdymZvjHCn9G0zmk4NMu3NWGQ8e+SAk/DGOzVLxAi8VPRTh1lVfqMlsDBW6hATXAc4dbIV6CnLGSbwq+x6e9lpCHgI8S+/qljz1xpwnuc8+DxUt+5scf8Db+x3zw==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('local.23272').connect(): child process stdin/stdout=121
[pid 23253] 16:58:56 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible_mitogen') -> <pkgutil.ImpLoader instance at 0x1024a3488>
[pid 23253] 16:58:56 D mitogen: _build_tuple('/Users/andy/forks/mitogen/ansible_mitogen/init.py', 'ansible_mitogen') -> ['connection', 'helpers', 'logging', 'mixins', 'process', 'services', 'strategy']
[pid 23253] 16:58:56 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible_mitogen')
[pid 23253] 16:58:56 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible_mitogen.helpers') -> <pkgutil.ImpLoader instance at 0x1024a3488>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.basic') -> <pkgutil.ImpLoader instance at 0x1024a3b48>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.parsing.convert_bool') -> <pkgutil.ImpLoader instance at 0x1024c2e18>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils._text') -> <pkgutil.ImpLoader instance at 0x1024c2fc8>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils') -> <pkgutil.ImpLoader instance at 0x1024c2dd0>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.pycompat24') -> <pkgutil.ImpLoader instance at 0x1024c53f8>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible') -> <pkgutil.ImpLoader instance at 0x1024c5d88>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.six') -> <pkgutil.ImpLoader instance at 0x1024c5b48>
[pid 23253] 16:58:56 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.parsing') -> <pkgutil.ImpLoader instance at 0x1024cbb00>
[pid 23253] 16:58:56 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:58:56 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:58:56 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/init.py', 'ansible') -> ['cli', 'compat', 'config', 'constants', 'errors', 'executor', 'galaxy', 'inventory', 'module_utils', 'modules', 'parsing', 'playbook', 'plugins', 'release', 'template', 'utils', 'vars']
[pid 23253] 16:58:56 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible')
[pid 23253] 16:58:56 D mitogen: mitogen.ssh.Stream('local.23272'): received "Warning: Permanently added '35.166.51.42' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:58:57 D mitogen: pkgutil._get_module_via_pkgutil('ansible.release') -> <pkgutil.ImpLoader instance at 0x1024cbbd8>
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.release')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:58:57 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/module_utils/init.py', 'ansible.module_utils') -> ['_text', 'a10', 'aci', 'aireos', 'ansible_tower', 'aos', 'api', 'aruba', 'asa', 'avi', 'aws', 'azure_rm_common', 'basic', 'bigswitch_utils', 'ce', 'cloud', 'cloudstack', 'cnos', 'cnos_devicerules', 'cnos_errorcodes', 'connection', 'crypto', 'database', 'dellos10', 'dellos6', 'dellos9', 'digital_ocean', 'dimensiondata', 'docker_common', 'ec2', 'eos', 'exoscale', 'f5_utils', 'facts', 'fortios', 'gcdns', 'gce', 'gcp', 'infinibox', 'ios', 'iosxr', 'ipa', 'ismount', 'json_utils', 'junos', 'k8s_common', 'known_hosts', 'lxd', 'manageiq', 'mysql', 'netapp', 'netcfg', 'netcli', 'netconf', 'netscaler', 'network', 'network_common', 'nxos', 'oneview', 'openshift_common', 'openstack', 'ordnance', 'ovirt', 'parsing', 'postgres', 'powershell', 'pure', 'pycompat24', 'rax', 'redhat', 'service', 'six', 'splitter', 'sros', 'univention_umc', 'urls', 'vca', 'vmware', 'vyos']
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:58:57 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/module_utils/parsing/init.py', 'ansible.module_utils.parsing') -> ['convert_bool']
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:58:57 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/module_utils/six/init.py', 'ansible.module_utils.six') -> []
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:58:57 D mitogen: mitogen.ssh.Stream('local.23272'): received 'EC0\n'
[pid 23253] 16:58:57 D mitogen: mitogen.ssh.Stream('local.23272')._ec0_received()
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:58:57 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules') -> <pkgutil.ImpLoader instance at 0x1024c2d40>
[pid 23253] 16:58:57 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/modules/init.py', 'ansible.modules') -> ['cloud', 'clustering', 'commands', 'crypto', 'database', 'files', 'identity', 'inventory', 'messaging', 'monitoring', 'net_tools', 'network', 'notification', 'packaging', 'remote_management', 'source_control', 'storage', 'system', 'utilities', 'web_infrastructure', 'windows']
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.modules')
[pid 23253] 16:58:57 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23262] 16:58:57 D mitogen: Context(12, u'ssh.env7-demo-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:58:57 D mitogen: tty_create_child() child 23273 fd 127, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env8-prod-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FLxDAQhc/2V3ibBLMlbRRqobBSxHsRe1CRtskuYdukpF2z6693ShfMehnmmzczj1exurBTPOpRERo55gPSu1uEnXUHQvPoBnt5HFPCWcI5/eOKheRQTVbuejspUoXgQqhD8Cso862dNe/wVL28cfgspjMOT6o7zk3bq3UHsSfXAoNBz3avTN4Yed4uZbO3VrpT/LoZbKt7FXd2yFORPgigEb7xTs+KJAyeS/5hcFYWX2QJLO2oDMYE1wKNnWokeUyze8rgR4/r7WWnZuAB419+laHmrzUQIssE+tyV/92Txf0XcQl30g==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:57 D mitogen: mitogen.ssh.Stream('local.23273').connect(): child process stdin/stdout=127
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:58:57 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules.commands') -> <pkgutil.ImpLoader instance at 0x1024cbbd8>
[pid 23253] 16:58:57 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/modules/commands/init.py', 'ansible.modules.commands') -> ['command', 'expect', 'raw', 'script', 'shell', 'telnet']
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.modules.commands')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible_mitogen')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:58:57 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules.commands.command') -> <pkgutil.ImpLoader instance at 0x1024cbb00>
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env9-demo-bastion'), 'ansible.modules.commands.command')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible_mitogen.helpers')
[pid 23261] 16:58:57 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 1712 ms
[pid 23261] 16:58:57 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23261] 16:58:57 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:58:57 D mitogen: mitogen.core.Stream('unix_client.23261').on_disconnect()
changed: [env9-demo-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003669",
"end": "2018-03-15 23:58:57.627215",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:58:57.623546",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.release')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils')
[pid 23253] 16:58:57 D mitogen: mitogen.ssh.Stream('local.23273'): received "Warning: Permanently added '52.34.221.103' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.modules')
[pid 23253] 16:58:57 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:58:57 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.modules.commands')
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-demo-bastion'), 'ansible.modules.commands.command')
[pid 23262] 16:58:58 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 2120 ms
[pid 23262] 16:58:58 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:58:58 D mitogen: mitogen.core.Stream('unix_client.23262').on_disconnect()
[pid 23262] 16:58:58 D mitogen: Waker(Broker()).on_disconnect()
changed: [env7-demo-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003860",
"end": "2018-03-15 23:58:58.045387",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:58:58.041527",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:58:58 D mitogen: mitogen.ssh.Stream('local.23273'): received 'EC0\n'
[pid 23253] 16:58:58 D mitogen: mitogen.ssh.Stream('local.23273')._ec0_received()
[pid 23253] 16:58:58 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23263] 16:58:58 D mitogen: Context(13, u'ssh.env8-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:58:58 D mitogen: tty_create_child() child 23274 fd 97, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env5-prod-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FLxDAQhc/2V3ibBLMlbRRqobBSxHsRe1CRtskuYdukpF2z6693ShfMehnmmzczj1exurBTPOpRERo55gPSu1uEnXUHQvPoBnt5HFPCWcI5/eOKheRQTVbuejspUoXgQqhD8Cso862dNe/wVL28cfgspjMOT6o7zk3bq3UHsSfXAoNBz3avTN4Yed4uZbO3VrpT/LoZbKt7FXd2yFORPgigEb7xTs+KJAyeS/5hcFYWX2QJLO2oDMYE1wKNnWokeUyze8rgR4/r7WWnZuAB419+laHmrzUQIssE+tyV/92Txf0XcQl30g==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:58 D mitogen: mitogen.ssh.Stream('local.23274').connect(): child process stdin/stdout=97
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible_mitogen')
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible')
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.release')
[pid 23253] 16:58:58 D mitogen: mitogen.ssh.Stream('local.23274'): received "Warning: Permanently added '34.210.65.64' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils')
[pid 23253] 16:58:58 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:58:58 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23274'): received 'EC0\n'
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23274')._ec0_received()
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.modules')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.modules.commands')
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23265] 16:58:59 D mitogen: Context(14, u'ssh.env5-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:58:59 D mitogen: tty_create_child() child 23275 fd 99, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env6-prod-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FrwzAMhc/Lr9hNNnODHTPIAoGOMHYPYzlsYySxW0wT2zjp3O7XzyGFub0IfXqSHq8mTWmm1CorEU4c8RGp3X2AnXEHhIvkLvTiaDNECaMU/3NNYnJBZSv3g5kkqmNwMTQx+BWk/lHO6A94rl/fKXyV0zkMT7I/zm03yHUn4ICuBQKjms1e6qLV4rxdymZvjHCn9G0zmk4NMu3NWGQ8e+SAk/DGOzVLxAi8VPRTh1lVfqMlsDBW6hATXAc4dbIV6CnLGSbwq+x6e9lpCHgI8S+/qljz1xpwnuc8+DxUt+5scf8Db+x3zw==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23275').connect(): child process stdin/stdout=99
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env8-prod-bastion'), 'ansible.modules.commands.command')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible_mitogen')
[pid 23263] 16:58:59 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 3170 ms
[pid 23263] 16:58:59 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:58:59 D mitogen: mitogen.core.Stream('unix_client.23263').on_disconnect()
[pid 23263] 16:58:59 D mitogen: Waker(Broker()).on_disconnect()
changed: [env8-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004126",
"end": "2018-03-15 23:58:59.133791",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:58:59.129665",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.release')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils')
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23275'): received "Warning: Permanently added '52.32.214.44' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.modules')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.modules.commands')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-prod-bastion'), 'ansible.modules.commands.command')
[pid 23265] 16:58:59 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 3613 ms
[pid 23265] 16:58:59 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:58:59 D mitogen: mitogen.core.Stream('unix_client.23265').on_disconnect()
[pid 23265] 16:58:59 D mitogen: Waker(Broker()).on_disconnect()
changed: [env5-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003999",
"end": "2018-03-15 23:58:59.609997",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:58:59.605998",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23275'): received 'EC0\n'
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23275')._ec0_received()
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23266] 16:58:59 D mitogen: Context(15, u'ssh.env6-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:58:59 D mitogen: tty_create_child() child 23276 fd 104, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env7-prod-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FLxDAQhc/2V3ibBLMlbRRqobBSxHsRe1CRtskuYdukpF2z6693ShfMehnmmzczj1exurBTPOpRERo55gPSu1uEnXUHQvPoBnt5HFPCWcI5/eOKheRQTVbuejspUoXgQqhD8Cso862dNe/wVL28cfgspjMOT6o7zk3bq3UHsSfXAoNBz3avTN4Yed4uZbO3VrpT/LoZbKt7FXd2yFORPgigEb7xTs+KJAyeS/5hcFYWX2QJLO2oDMYE1wKNnWokeUyze8rgR4/r7WWnZuAB419+laHmrzUQIssE+tyV/92Txf0XcQl30g==".encode(),"base64"),"zip"))'"
[pid 23253] 16:58:59 D mitogen: mitogen.ssh.Stream('local.23276').connect(): child process stdin/stdout=104
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible_mitogen')
[pid 23253] 16:58:59 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:58:59 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.release')
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('local.23276'): received "Warning: Permanently added '34.209.231.159' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('local.23276'): received 'EC0\n'
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('local.23276')._ec0_received()
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.modules')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23267] 16:59:00 D mitogen: Context(16, u'ssh.env7-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker())).on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:00 D mitogen: send_load_module(mitogen.ssh.Stream(u'ssh.env6-prod-bastion'), 'ansible.modules.commands.command')
[pid 23253] 16:59:00 D mitogen: tty_create_child() child 23277 fd 109, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env5-stage-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FrwzAMhc/Lr9hNNnODHTPIAoGOMHYPYzlsYySxW0wT2zjp3O7XzyGFub0IfXqSHq8mTWmm1CorEU4c8RGp3X2AnXEHhIvkLvTiaDNECaMU/3NNYnJBZSv3g5kkqmNwMTQx+BWk/lHO6A94rl/fKXyV0zkMT7I/zm03yHUn4ICuBQKjms1e6qLV4rxdymZvjHCn9G0zmk4NMu3NWGQ8e+SAk/DGOzVLxAi8VPRTh1lVfqMlsDBW6hATXAc4dbIV6CnLGSbwq+x6e9lpCHgI8S+/qljz1xpwnuc8+DxUt+5scf8Db+x3zw==".encode(),"base64"),"zip"))'"
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('local.23277').connect(): child process stdin/stdout=109
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible_mitogen')
[pid 23266] 16:59:00 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 4644 ms
[pid 23266] 16:59:00 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23266] 16:59:00 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:00 D mitogen: mitogen.core.Stream('unix_client.23266').on_disconnect()
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible_mitogen.helpers')
changed: [env6-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003834",
"end": "2018-03-15 23:59:00.651320",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:00.647486",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.release')
[pid 23253] 16:59:00 D mitogen: mitogen.ssh.Stream('local.23277'): received "Warning: Permanently added '34.209.162.80' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:00 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:00 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.modules')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-prod-bastion'), 'ansible.modules.commands.command')
[pid 23267] 16:59:01 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 5143 ms
[pid 23267] 16:59:01 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:01 D mitogen: mitogen.core.Stream('unix_client.23267').on_disconnect()
[pid 23267] 16:59:01 D mitogen: Waker(Broker()).on_disconnect()
changed: [env7-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004086",
"end": "2018-03-15 23:59:01.170790",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:01.166704",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23277'): received 'EC0\n'
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23277')._ec0_received()
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23268] 16:59:01 D mitogen: Context(17, u'ssh.env5-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:59:01 D mitogen: tty_create_child() child 23278 fd 107, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env6-stage-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FLxDAQhc/2V3ibBLMlbRRqobBSxHsRe1CRtskuYdukpF2z6693ShfMehnmmzczj1exurBTPOpRERo55gPSu1uEnXUHQvPoBnt5HFPCWcI5/eOKheRQTVbuejspUoXgQqhD8Cso862dNe/wVL28cfgspjMOT6o7zk3bq3UHsSfXAoNBz3avTN4Yed4uZbO3VrpT/LoZbKt7FXd2yFORPgigEb7xTs+KJAyeS/5hcFYWX2QJLO2oDMYE1wKNnWokeUyze8rgR4/r7WWnZuAB419+laHmrzUQIssE+tyV/92Txf0XcQl30g==".encode(),"base64"),"zip"))'"
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23278').connect(): child process stdin/stdout=107
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible_mitogen')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.release')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23278'): received "Warning: Permanently added '35.165.138.68' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.modules')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:01 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:01 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env5-stage-bastion'), 'ansible.modules.commands.command')
[pid 23268] 16:59:01 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 5819 ms
[pid 23268] 16:59:01 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:01 D mitogen: mitogen.core.Stream('unix_client.23268').on_disconnect()
[pid 23268] 16:59:01 D mitogen: Waker(Broker()).on_disconnect()
changed: [env5-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003869",
"end": "2018-03-15 23:59:01.865680",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:01.861811",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23278'): received 'EC0\n'
[pid 23253] 16:59:01 D mitogen: mitogen.ssh.Stream('local.23278')._ec0_received()
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23269] 16:59:02 D mitogen: Context(18, u'ssh.env6-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:59:02 D mitogen: tty_create_child() child 23280 fd 113, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env7-stage-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FrwzAMhc/Lr9hNNnODHTPIAoGOMHYPYzlsYySxW0wT2zjp3O7XzyGFub0IfXqSHq8mTWmm1CorEU4c8RGp3X2AnXEHhIvkLvTiaDNECaMU/3NNYnJBZSv3g5kkqmNwMTQx+BWk/lHO6A94rl/fKXyV0zkMT7I/zm03yHUn4ICuBQKjms1e6qLV4rxdymZvjHCn9G0zmk4NMu3NWGQ8e+SAk/DGOzVLxAi8VPRTh1lVfqMlsDBW6hATXAc4dbIV6CnLGSbwq+x6e9lpCHgI8S+/qljz1xpwnuc8+DxUt+5scf8Db+x3zw==".encode(),"base64"),"zip"))'"
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('local.23280').connect(): child process stdin/stdout=113
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible_mitogen')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.release')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('local.23280'): received "Warning: Permanently added '34.212.19.92' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.modules')
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('local.23280'): received 'EC0\n'
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('local.23280')._ec0_received()
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env6-stage-bastion'), 'ansible.modules.commands.command')
[pid 23269] 16:59:02 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 6795 ms
[pid 23269] 16:59:02 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:02 D mitogen: mitogen.core.Stream('unix_client.23269').on_disconnect()
[pid 23269] 16:59:02 D mitogen: Waker(Broker()).on_disconnect()
changed: [env6-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003826",
"end": "2018-03-15 23:59:02.862670",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:02.858844",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('default').connect()
[pid 23270] 16:59:02 D mitogen: Context(19, u'ssh.env7-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, 'ansible_debug': False, 'ansible_shell_executable': u'/bin/sh', 'ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:59:02 D mitogen: tty_create_child() child 23281 fd 116, parent 23253, cmd: "ssh" "-l" "ec2-user" "-o" "Compression yes" "-o" "StrictHostKeyChecking no" "-o" "UserKnownHostsFile /dev/null" "-F" "ansible/ssh_config" "-o" "ControlMaster=auto" "-o" "ControlPersist=60s" "env3-stage-bastion" "'/usr/bin/python2.7'" "'-c'" "'import codecs,os,sys;
=codecs.decode;exec(
(
("eNpdj0FrhDAQhc/1V/Q2Cc1KNBSsIGyR0ruUemhLUZNdwmomRLfu9tc34kKzexnmmzczj1exusAxttoqQiPH5oD07t7DDt2B0Dy687082pRwlnBO/7liITmvJit3PY6KVCG4EOoQ5hWU+dEOzQc8V6/vHL6K8eyHJ9Udp6bt1brjsSfXAoNBT7hXJm+MPG+XstkjSneK3zYDtrpXcYdDnor0UQCN/JvZ6UmRhMFLyT+Nn5XFN1kCS7TK+JjgWqCxU40kT2nGKYNfbdfby07NYAYf//KrDLX5WgMhskx4n4fy1j1Z3P8Ab413zg==".encode(),"base64"),"zip"))'"
[pid 23253] 16:59:02 D mitogen: mitogen.ssh.Stream('local.23281').connect(): child process stdin/stdout=116
[pid 23253] 16:59:02 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:59:02 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible_mitogen')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.release')
[pid 23253] 16:59:03 D mitogen: mitogen.ssh.Stream('local.23281'): received "Warning: Permanently added '52.39.77.124' (ECDSA) to the list of known hosts.\r\n"
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.modules')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env7-stage-bastion'), 'ansible.modules.commands.command')
[pid 23270] 16:59:03 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 7383 ms
[pid 23270] 16:59:03 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:03 D mitogen: mitogen.core.Stream('unix_client.23270').on_disconnect()
[pid 23270] 16:59:03 D mitogen: Waker(Broker()).on_disconnect()
changed: [env7-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.008890",
"end": "2018-03-15 23:59:03.467706",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:03.458816",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:03 D mitogen: mitogen.ssh.Stream('local.23281'): received 'EC0\n'
[pid 23253] 16:59:03 D mitogen: mitogen.ssh.Stream('local.23281')._ec0_received()
[pid 23271] 16:59:03 D mitogen: Context(20, u'ssh.env3-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible_mitogen')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible_mitogen.helpers')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.release')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils')
[pid 23253] 16:59:03 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils._text')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils.parsing')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils.parsing.convert_bool')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils.pycompat24')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils.six')
[pid 23253] 16:59:03 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.module_utils.basic')
[pid 23253] 16:59:04 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 23253] 16:59:04 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.modules')
[pid 23253] 16:59:04 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands')
[pid 23253] 16:59:04 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.modules.commands')
[pid 23253] 16:59:04 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.commands.command')
[pid 23253] 16:59:04 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env3-stage-bastion'), 'ansible.modules.commands.command')
[pid 23271] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 8062 ms
[pid 23271] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23271').on_disconnect()
[pid 23271] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
changed: [env3-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004009",
"end": "2018-03-15 23:59:04.172154",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.168145",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}

TASK [command] **********************************************************************************************************************************************************************************
task path: /Users/andy/forks/mitogen/examples/playbook/issue_131.yml:12
[pid 23282] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23282] 16:59:04 D mitogen: unix.connect(): local ID is 21, remote is 0
[pid 23282] 16:59:04 D mitogen: Context(2, u'ssh.env9-demo-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23283] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23283] 16:59:04 D mitogen: unix.connect(): local ID is 22, remote is 0
[pid 23283] 16:59:04 D mitogen: Context(12, u'ssh.env7-demo-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23284] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23284] 16:59:04 D mitogen: unix.connect(): local ID is 23, remote is 0
[pid 23284] 16:59:04 D mitogen: Context(13, u'ssh.env8-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23285] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23285] 16:59:04 D mitogen: unix.connect(): local ID is 24, remote is 0
[pid 23285] 16:59:04 D mitogen: Context(14, u'ssh.env5-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23286] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23286] 16:59:04 D mitogen: unix.connect(): local ID is 25, remote is 0
[pid 23282] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 67 ms
[pid 23282] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23282] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23282').on_disconnect()
[pid 23283] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 66 ms
[pid 23283] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23283] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23287] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23287] 16:59:04 D mitogen: unix.connect(): local ID is 26, remote is 0
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23283').on_disconnect()
[pid 23286] 16:59:04 D mitogen: Context(15, u'ssh.env6-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23284] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 62 ms
[pid 23284] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23284').on_disconnect()
[pid 23284] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23287] 16:59:04 D mitogen: Context(16, u'ssh.env7-prod-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
changed: [env9-demo-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003773",
"end": "2018-03-15 23:59:04.261797",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.258024",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23285] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 61 ms
[pid 23285] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23285] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23285').on_disconnect()
[pid 23289] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
changed: [env7-demo-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003897",
"end": "2018-03-15 23:59:04.278335",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.274438",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23289] 16:59:04 D mitogen: unix.connect(): local ID is 27, remote is 0
changed: [env8-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004241",
"end": "2018-03-15 23:59:04.287483",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.283242",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23286] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 80 ms
[pid 23290] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
changed: [env5-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004149",
"end": "2018-03-15 23:59:04.302774",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.298625",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23286] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23290] 16:59:04 D mitogen: unix.connect(): local ID is 28, remote is 0
[pid 23286] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23286').on_disconnect()
[pid 23289] 16:59:04 D mitogen: Context(18, u'ssh.env6-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23287] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 68 ms
[pid 23290] 16:59:04 D mitogen: Context(19, u'ssh.env7-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23287] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
changed: [env6-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003517",
[pid 23287] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
;33m "end": "2018-03-15 23:59:04.336287",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.332770",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23287').on_disconnect()
changed: [env7-prod-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004112",
"end": "2018-03-15 23:59:04.352272",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.348160",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23291] 16:59:04 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_zXlNKF')
[pid 23291] 16:59:04 D mitogen: unix.connect(): local ID is 29, remote is 0
[pid 23291] 16:59:04 D mitogen: Context(20, u'ssh.env3-stage-bastion').call_async(<function run_module at 0x1024102a8>, *('ansible.modules.commands.command',), **{'args': {'_ansible_version': '2.4.3.0', '_uses_shell': True, '_ansible_no_log': False, '_ansible_module_name': u'command', u'_raw_params': u'true', '_ansible_verbosity': 3, '_ansible_syslog_facility': u'LOG_USER', '_ansible_socket': None, '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], '_ansible_diff': False, '_ansible_debug': False, '_ansible_shell_executable': u'/bin/sh', '_ansible_check_mode': False}, 'env': {}})
[pid 23290] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 63 ms
[pid 23290] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23290').on_disconnect()
[pid 23290] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
[pid 23289] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 91 ms
[pid 23289] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23289] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
changed: [env7-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004417",
"end": "2018-03-15 23:59:04.404302",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.399885",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23289').on_disconnect()
[pid 23291] 16:59:04 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 54 ms
[pid 23291] 16:59:04 D mitogen: mitogen.core.Stream('unix_listener.23253').on_disconnect()
[pid 23291] 16:59:04 D mitogen: Waker(Broker()).on_disconnect()
changed: [env6-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.004220",
"end": "2018-03-15 23:59:04.405513",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.401293",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
[pid 23253] 16:59:04 D mitogen: mitogen.core.Stream('unix_client.23291').on_disconnect()
changed: [env3-stage-bastion] => {
"changed": true,
"cmd": "true",
"delta": "0:00:00.003855",
"end": "2018-03-15 23:59:04.416654",
"invocation": {
"module_args": {
"_raw_params": "true",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2018-03-15 23:59:04.412799",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}

^C [ERROR]: User interrupted execution

[pid 23253] 16:59:25 D mitogen: <ansible_mitogen.services.ContextService object at 0x10241d890>: channel closed: Channel closed by local end.
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env5-stage-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env8-prod-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: <mitogen.unix.Listener object at 0x10241d810>.on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env3-stage-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env9-demo-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-demo-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env6-stage-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env6-prod-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env5-prod-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-prod-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-stage-bastion') closing CALL_FUNCTION channel
[pid 23253] 16:59:25 D mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env9-demo-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env8-prod-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env5-stage-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env3-stage-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env9-demo-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env7-demo-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env8-prod-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env5-prod-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env6-prod-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env7-prod-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env5-stage-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env6-stage-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen.ctx.ssh.env7-stage-bastion: mitogen: Waker(Broker()).on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-demo-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env5-prod-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env6-prod-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-prod-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env6-stage-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env7-stage-bastion').on_disconnect()
[pid 23253] 16:59:25 D mitogen: mitogen.ssh.Stream(u'ssh.env3-stage-bastion').on_disconnect()

Upload a working version to pypi

Currently you can do pip install mitogen, this will pretend to install the library, but actualy doesn't install anything. There should be some warning or errror, instead of just doing a fake install.

Ansible synchronize action plug-in fails to call Connection.close()

Same test case as in #139.

This time i'm using:

- name: Copy each Policy file to given webfilter
  synchronize:
    src: "{{ item.src }}"
    dest: /dest/dir
  with_filetree:
    - "/this/is/my/dir"
  when: item.state == 'file'

I know you shouldn't do this, but i need to since i want to flatten a directory structure into just one directoy on target host.

When I'm running this it the resulting playbook calls pile up

snip from pstree

playbooโ”€โ”ฌโ”€ansible-playbooโ”€โ”€โ”€499*[{ansible-playboo}]
And this number keeps growing.

This completely clogs my system

fakessh.Process.wake() can never return on Python < 2.7

The function waits until self.wake_event.wait(0.1) returns True, wait_event is an instance of threading.Event https://github.com/dw/mitogen/blob/a8dcd53ccca0d6fffc4568bc216ddedeed610474/mitogen/fakessh.py#L162-L164

However in Python 2.6 and earlier Event.wait() always returns None

This method returns the internal flag on exit, so it will always return True except if a timeout is given and the operation times out.

Changed in version 2.7: Previously, the method always returned None.

ansible: sudo connection timeout parameter is not respected

Hi,

I'm testing a very long playbook with 100s of tasks that can take more than 1.5 hours to execute against 4 servers (Basic A1 (1 vcpu, 1.75 GB memory) on Azure). Both the ansible host and targets are CentOS 7 running in Azure. The target servers are very slow, and used for testing purposes only.

Unfortunately, when running the playbook with mitogen it doesn't get very far. It appears to time out after sudoing. See mitogen_output.txt.

Investigate alerts found by lgtm.com

LGTM is a service that performs static and dynamic code analysis. It can find potential bugs such as use of uninitialized variables, or iteration over types that don't support it.

The initial scan has found 11 Alerts. These should be investigated, then fixed or silenced as appropriate.

core: Investigate pickle and alternatives

Mitogen currently uses cPickle (with some filtering) to serialize data passed between parents and children. Pickle is widely regarded as risky - deserializing an arbitrary pickle from an untrusted source can trivially result in code execution. Mitogen has some protection is in-place already

The pickler will instantiate only built-in types and one of 3 constructor functions, to support unpickling CallError, _DEAD, and Context.
โ€” Mitogen: How it Works

This is a medium to long term undertaking. To assess the feasibility of replacing Pickle I plan to

  • Document how and where Pickle is used by Mitogen
  • Survey of techniques used by similar projects
  • Survey of alternative serialization and RPC libraries
  • Experiment with suitable alternatives

@dw I can document my progress in this issue, as changes to the docs (in a branch/PR), or perhaps as a Wiki page. Do you have a preference?

"Talk without pickle, and it won't exec the worm"
โ€” Paul Atreides, Weapon of Choice

Should Stream._connect_bootstrap() return anything?

I noticed that mitogen.master.Stream._connect_bootstrap() doesn't return anything. However the subclasses (mitogen.ssh.Stream, and mitogen.sudo.Stream) do return the result of self._ec0_received()

Since mitogen.master.Stream._ec0_received() also doesn't return anything, I think this discrepancy has no material impact and I assume the return statements are harmless leftovers from some earlier stage of mitogen. Does this sound right?

Can't gather facts when running seperate Task.

TASK [_gather_facts : Gather facts] ******************************************************************************
11:59:24 I p=29093 u=root | : TASK [_gather_facts : Gather facts] ******************************************************************************
fatal: [tbi_client01]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (setup) module: _ansible_shell_executable Supported parameters include: fact_path,filter,gather_subset,gather_timeout"}
11:59:24 E p=29093 u=root | : fatal: [tbi_client01]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (setup) module: _ansible_shell_executable Supported parameters include: fact_path,filter,gather_subset,gather_timeout"}

task looks like this:

  • name: Gather facts
    action: setup

while gather_facts: no is set in my playbook

core: asynchronous connect

It should be possible to spawn a huge number of contexts during startup, with connection happening in parallel. Probably requires many changes:

  • Teach Router to buffer messages for contexts that are not yet connected but known about, to support via=, with some mechanism to abort the message and inform any interested parties if the connection attempt fails

  • For handling connection timeouts, add timer support to Broker, possibly by replacing the existing defer() mechanism with a callLater(0, ..) style mechanism. This has been attempted once before but reverted, as it introduced ordering differences that led to breakage that I could not analyse at the time.

  • Introduce a new State class associated with BasicStream, and give every BasicStream a state attribute. Most on_*() handlers move to this new class, and that attribute is flipped dynamically over the connection's life (i.e. it's a basic state machine). Example states:

    • AwaitingEc0
    • AwaitingEc1
    • Connected
    • unix: WaitingOnClientPid

Regarding AwaitingEc0, for sudo.py, su.py, and ssh.py, it would be nice if there some kind of generic WaitingOnString implementation that could transition to new states (or receive handlers) according to the presence of e.g. host keys prompt, MITM warning, password prompt, permission denied prompt, usage message, etc.

Something else must exist to keep a log of early connection setup, because iter_read() will die as part of this work, and we still need to log tool output in case something goes awry.

UNIX listeners can also benefit from the new state, see issue #131.

Entrypoint Suggestions for Development

Two things I'd like to say:

  1. You're doing a great job and I hope your kickstarter gets fully funded, and reaches its stretch goals.
  2. As a intermediate-proficient python coder, I've been looking for a project to contribute to and I really like what mitogen is trying to achieve. In light of this:
    • Could I suggest that you create some issues that detail features you'd like to implement, along with level of difficulty. This would provide a great entrypoint for people who want to contribute but are unsure how to being (I have this feeling a lot when I look at open-source projects).
    • I know LibreOffice follows this model to some success - arguably they need this a lot more given their monstrous codebase.

Example tickets could be things that have been bugging you but that you have not have the bandwidth to do: [Easy] Tidy up foo.py

Moderate difficulty tickets: [Moderate] Refactor bar.py

Difficult tickets: [Hard] Add support for FTL in foofoo.py

Permission denied in /tmp/ansible-mitogen-tmp-*

Tried to boil it down:

$ cat test_script.yml 
---

- name: saytrue
  hosts: tx100.local
  become: True

  tasks:

    - name: run script saytrue
      script: saytrue

$ cat saytrue 
#!/bin/bash
/bin/true

fails with

fatal: [tx100.local]: FAILED! => {
    "changed": true, 
    "msg": "non-zero return code", 
    "rc": 126, 
    "stderr": "/bin/sh: 1: /tmp/ansible-mitogen-tmp-fLfQCp/saytrue: Permission denied\n", 
    "stdout": "", 
    "stdout_lines": []
}

test.log

Setting ansible_python_interpreter within a play doesn't work

Here's an awful construct from one of my playbooks. The server has a Python app, with a virtualenv at {{ venv_bin }} that already has psycopg2 installed. Rather than also install psycopg2 systemwide, I set ansible_python_interpreter to point to that virtualenv for any tasks that need it:

- name: Store the original ansible_python_interpreter
  set_fact: original_ansible_python_interpreter={{ ansible_python_interpreter }}

- name: Use app virtualenv for Postgres tasks
  set_fact: ansible_python_interpreter={{ venv_bin }}/python

- name: Ensure the app DB user exists
  postgresql_user:
    db: postgres
    login_host: "{{ db_credentials.host }}"
    port: "{{ db_credentials.port }}"
    login_user: "{{ db_superuser }}"
    login_password: "{{ db_superuser_password }}"
    name: "{{ db_credentials.user }}"
    password: "{{ db_credentials.password }}"
    state: present

- name: Return to default Ansible python
  set_fact: ansible_python_interpreter={{ original_ansible_python_interpreter }}

The only trick necessary for this to be supported by Ansible without mitogen is adding ansible_python_interpreter: /usr/bin/python to group/hostvars.

With mitogen, this errors: FAILED! => {"changed": false, "msg": "the python psycopg2 module is required"} which looks like it did not switch to the new ansible_python_interpreter variable. I'm okay with the answer being "this is terrible and unsupported" :).

Here's the mitogen logs from that task. mitogen does not log anything for the set_fact tasks:

[pid 27834] 12:02:40 D mitogen: Context(10, u'ssh.env1-stage-web').call_async(<function run_module at 0x110db4aa0>, *('ansible.modules.database.postgresql.postgresql_user',), **{ARGS OMITTED})
[pid 27818] 12:02:40 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen')
[pid 27818] 12:02:40 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible_mitogen')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible_mitogen.helpers')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible_mitogen.helpers')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.release')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.release')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.basic')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils._text')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.parsing')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.parsing.convert_bool')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.pycompat24')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.six')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.basic')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules')
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.modules')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.database')
[pid 27818] 12:02:41 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules.database') -> <pkgutil.ImpLoader instance at 0x10ea528c0>
[pid 27818] 12:02:41 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/modules/database/__init__.py', 'ansible.modules.database') -> ['influxdb', 'misc', 'mongodb', 'mssql', 'mysql', 'postgresql', 'proxysql', 'vertica']
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.modules.database')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.database.postgresql')
[pid 27818] 12:02:41 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules.database.postgresql') -> <pkgutil.ImpLoader instance at 0x10ea52f80>
[pid 27818] 12:02:41 D mitogen: _build_tuple('/Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible/modules/database/postgresql/__init__.py', 'ansible.modules.database.postgresql') -> ['postgresql_db', 'postgresql_ext', 'postgresql_lang', 'postgresql_privs', 'postgresql_schema', 'postgresql_user']
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.modules.database.postgresql')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.modules.database.postgresql.postgresql_user')
[pid 27818] 12:02:41 D mitogen: pkgutil._get_module_via_pkgutil('ansible.modules.database.postgresql.postgresql_user') -> <pkgutil.ImpLoader instance at 0x10ea52128>
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.modules.database.postgresql.postgresql_user')
[pid 27818] 12:02:41 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('ansible.module_utils.database')
[pid 27818] 12:02:41 D mitogen: pkgutil._get_module_via_pkgutil('ansible.module_utils.database') -> <pkgutil.ImpLoader instance at 0x10ea52878>
[pid 27818] 12:02:41 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.env1-stage-web'), 'ansible.module_utils.database')
[pid 27834] 12:02:41 D ansible_mitogen.connection: Call run_module('ansible.modules.database.postgresql.postgresql_user',) took 1995 ms
[pid 27834] 12:02:41 D mitogen: mitogen.core.Stream('unix_listener.27818').on_disconnect()
[pid 27818] 12:02:41 D mitogen: mitogen.core.Stream('unix_client.27834').on_disconnect()
[pid 27834] 12:02:41 D mitogen: Waker(Broker()).on_disconnect()

Broker thread crashes on debops playbook

Doing first steps here.
ansible 2.4.3.0 in a python virtual-env, python version = 2.7.14, all on a Fedora 28 machine.

Maybe I miss some dependencies but as I am no python-coder I have problems spotting where to start.

I get:

$ time ansible-playbook run_hostname_100_times.yml 

PLAY [tx100.local] ******************************************************************************************************************************************************************

TASK [Run hostname] *****************************************************************************************************************************************************************
13:46:41 W mitogen: get_module_source('time'): cannot find source
13:46:41 W mitogen: get_module_source('operator'): cannot find source
13:46:41 W mitogen: get_module_source('_locale'): cannot find source
13:46:41 W mitogen: get_module_source('grp'): cannot find source
13:46:41 W mitogen: get_module_source('datetime'): cannot find source
13:46:41 W mitogen: get_module_source('syslog'): cannot find source
13:46:41 W mitogen: get_module_source('itertools'): cannot find source
13:46:41 W mitogen: get_module_source('select'): cannot find source
13:46:41 W mitogen: get_module_source('_random'): cannot find source
13:46:41 W mitogen: get_module_source('binascii'): cannot find source
13:46:41 W mitogen: get_module_source('math'): cannot find source
13:46:41 W mitogen: get_module_source('fcntl'): cannot find source
13:46:41 W mitogen: get_module_source('cStringIO'): cannot find source
13:46:41 W mitogen: get_module_source('_hashlib'): cannot find source
13:46:41 W mitogen: get_module_source('cPickle'): cannot find source
13:46:41 W mitogen: get_module_source('_collections'): cannot find source
13:46:41 W mitogen: get_module_source('zlib'): cannot find source
13:46:41 W mitogen: get_module_source('bz2'): cannot find source
13:46:41 W mitogen: get_module_source('_json'): cannot find source
13:46:41 W mitogen: get_module_source('_io'): cannot find source
13:46:41 W mitogen: get_module_source('strop'): cannot find source
13:46:41 W mitogen: get_module_source('_functools'): cannot find source
13:46:41 W mitogen: get_module_source('_struct'): cannot find source
13:46:41 W mitogen: get_module_source('_heapq'): cannot find source
changed: [tx100.local] => (item=1)
changed: [tx100.local] => (item=2)
changed: [tx100.local] => (item=3)

and playbook runs through.
(how) Can I fix these messages?

I am on my way to try to use your strategy within debops-projects https://github.com/debops/debops

thanks, Stefan

RFC: Use unittest2 for tests?

David, do you have any preference on adding unttest2 as a dev dependency? It would allow using the newer assert* methods in tests (e.g. assertTrue, assertIsInstance) to make tests more descriptive and test failure messages more helpful.

Alternatives:

  • Use pytest as the test runner, and use plain assert statements.
  • Selectively backport/copy from unittest2 into mitogen's own testlib.TestCase

ansible_mitogen strategy not installed by pip

Using pip 9.0.1, only the following ansible_mitogen modules are installed.

site-packages/ansible_mitogen/__init__.py
site-packages/ansible_mitogen/helpers.py
site-packages/ansible_mitogen/mixins.py

DockerizedSshDaemon requires Docker >= 1.13 (API >= 1.25)

TLDR: Ubuntu 17.04 ships with Docker 1.12.6 (API 1.24). Mitogen's test suite uses a feature (AutoRemove) that is only available in Docker 1.13 (API 1.25) and onward.

Attempting to the tests/fakessh_test.py using the version of Docker shipped with Ubuntu 16.04 results in the the error

APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.30, server API version: 1.24)")

API version 1.30 is the default tried by docker-py 2.5.1, which is specified in dev_requirements.txt. docker-py can be made to use an API version supported by the server by applying

diff --git a/tests/testlib.py b/tests/testlib.py
index e60d21d..f49697f 100644
--- a/tests/testlib.py
+++ b/tests/testlib.py
@@ -42,7 +42,7 @@ class TestCase(unittest.TestCase):
 
 class DockerizedSshDaemon(object):
     def __init__(self):
-        self.docker = docker.from_env()
+        self.docker = docker.from_env(version='auto')
         self.container_name = 'mitogen-test-%08x' % (random.getrandbits(64),)
         self.container = self.docker.containers.run(
             image='d2mw/mitogen-test',

However this still results in a new error

:~/src/mitogen [venv] pytest-catchlog(+47/-3)+*ยฑ python tests/fakessh_test.py 
00:21:43 D docker.auth: Trying paths: ['/home/alex/.docker/config.json', '/home/alex/.dockercfg']
00:21:43 D docker.auth: No config file found
00:21:43 D urllib3.connectionpool: http://localhost:None "GET /version HTTP/1.1" 200 199
E
======================================================================
ERROR: setUpClass (__main__.RsyncTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/alex/src/mitogen/tests/testlib.py", line 88, in setUpClass
    cls.dockerized_ssh = DockerizedSshDaemon()
  File "/home/alex/src/mitogen/tests/testlib.py", line 51, in __init__
    publish_all_ports=True,
  File "/home/alex/src/mitogen/venv/local/lib/python2.7/site-packages/docker/models/containers.py", line 697, in run
    raise RuntimeError("The options 'detach' and 'remove' cannot "
RuntimeError: The options 'detach' and 'remove' cannot be used together in api versions < 1.25.

----------------------------------------------------------------------
Ran 0 tests in 0.003s

FAILED (errors=1)

mitogen.core.Router._loop_once() passes sets to select.select()

I'm slowly making my way through Mitogen with MyPy. One line it complains about is

https://github.com/dw/mitogen/blob/43fae4414a2103b7ac6d0e09f9d67b777a2aac39/mitogen/core.py#L1016-L1017

with the message (ignore the line number)

mitogen/core.py:1128: error: Argument 1 to "select" has incompatible type "Set[Side]"; expected "Sequence[Any]"
mitogen/core.py:1128: error: Argument 2 to "select" has incompatible type "Set[Side]"; expected "Sequence[Any]"

The discrepancy is that self._readers & self._readers are each a set of "waitable objects", i.e. they are collections, not sequences.

I don't know if could cause undesired behaviour, or it's just MyPy and the select.select() docs being overly specific. I'll investigate further.

Idea: Unify mitogen.is_master, mitogen.parent_ids, ...

Could the 4 variables in mitogen/__init__.py be unified into one? Would there be benefit? As noddy example/straw design

Example Interpretation
mitogen.lineage == (0,) I am master, my context_id is 0, I have no parents
mitogen.lineage == (4, 0) I'm not master, my context_id is 4, my parent is context 0 (the master)
mitogen.lineage == (42, 4, 0) I'm not master, my context_id is 42, my parent is context 4
def is_master(lineage): return lineage == (0,)
def context_id(lineage): return lineage[0]
def parent_id(lineage): return lineage[1] # or could check length and return None?
def parent_ids(lineage): return lineage[1:]

Timeouts in test.sh obscure deadlocks

All test cases run by test.sh are wrapped by a call to timeout(1). Cases where the process is forcefully terminated due to reaching the timeout are not reported. This is leading to errors passing silently.

ImportError: Master does not have 'termios'

Commit a9c6c13 (importer has priority over system packages when whitelisting is enabled) breaks a large portion of the test suite for me. e.g.

python tests/nested_test.py 
No handlers could be found for logger "mitogen"
E
======================================================================
ERROR: test_nested (__main__.NestedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/nested_test.py", line 13, in test_nested
    context = self.router.local(via=context, name='local%d' % x)
  File "/home/alex/src/mitogen/mitogen/master.py", line 644, in local
    return self.connect('local', **kwargs)
  File "/home/alex/src/mitogen/mitogen/parent.py", line 452, in connect
    return self.proxy_connect(via, method_name, name=name, **kwargs)
  File "/home/alex/src/mitogen/mitogen/parent.py", line 461, in proxy_connect
    name, context_id, method_name, kwargs
  File "/home/alex/src/mitogen/mitogen/master.py", line 612, in call
    return self.call_async(fn, *args, **kwargs).get().unpickle()
  File "/home/alex/src/mitogen/mitogen/core.py", line 314, in unpickle
    raise obj
mitogen.core.CallError: exceptions.ImportError: Master does not have 'termios'
  File "<stdin>", line 1383, in _dispatch_calls
  File "<stdin>", line 1370, in _dispatch_one
  File "<stdin>", line 588, in load_module
  File "master:/home/alex/src/mitogen/mitogen/parent.py", line 38, in <module>
    import termios
  File "<stdin>", line 567, in load_module


----------------------------------------------------------------------
Ran 1 test in 0.109s

FAILED (errors=1)

I identified the commit with bisect. I presume it's something to do with using a virtualenv, but I haven't confirmed that.

installing mitogen

I'm feeling pretty moronic for such a dumb question, but.. do I need some special stuff to install the module? setup.py has py_packages = ['Mitogen'] but afaik distutils and co would expect packages = ['mitogen']. After changing the line to that it seems to install alright.

SshTest: ssh_exchange_identification: Connection closed by remote host

While running the unit tests on my laptop, in Ubuntu 17.10 beta (Artful Aardvark) I am seeing tests in tests/ssh_test.py fail while trying to connect, e.g.

$ PYTHONPATH=. python tests/ssh_test.py 
.E....F.
======================================================================
ERROR: test_password_incorrect (__main__.SshTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/ssh_test.py", line 63, in test_password_incorrect
    password='badpw',
  File "/home/alex/src/mitogen/tests/testlib.py", line 99, in docker_ssh
    return self.router.ssh(**kwargs)
  File "/home/alex/src/mitogen/mitogen/master.py", line 938, in ssh
    return self.connect('ssh', **kwargs)
  File "/home/alex/src/mitogen/mitogen/master.py", line 959, in connect
    return self._connect(context_id, klass, name=name, **kwargs)
  File "/home/alex/src/mitogen/mitogen/master.py", line 945, in _connect
    stream.connect()
  File "/home/alex/src/mitogen/mitogen/ssh.py", line 68, in connect
    super(Stream, self).connect()
  File "/home/alex/src/mitogen/mitogen/master.py", line 760, in connect
    self._connect_bootstrap()
  File "/home/alex/src/mitogen/mitogen/ssh.py", line 80, in _connect_bootstrap
    time.time() + 10.0):
  File "/home/alex/src/mitogen/mitogen/master.py", line 182, in iter_read
    (''.join(bits)[-300:],)
StreamError: EOF on stream; last 300 bytes received: 'ssh_exchange_identification: Connection closed by remote host\r\n'
...

The failures are not 100% consistent. I've seen the following variations

  • "Connection reset by remote host", rather than "Connection closed by remote host"
  • Different tests (e.g. SshTest.pubkey_required, SshTest.pubkey_specified) exhibiting the error

Investigations so far.

  • Rebuilding the Docker image on debian:unstable, ubuntu:zesty, or ubuntu:artful has not not fixed it.
  • Setting TCPKeepAlive=no has not fixed it
  • Running the same test in a 17.10 beta VM has not reproduced it so far

sudo: failure handling could be more robust

I'm super excited by the possibilities of mitogen (and working to get my company to back the Kickstarter...), but with the latest mitogen (b0440b7), I'm getting a crash as soon as I use become: true:

Ansible version:

ansible 2.4.3.0
  config file = /Users/andy/gr/myproject/ansible.cfg
  configured module search path = [u'/Users/andy/gr/myproject/ansible/library', u'/Users/andy/gr/myproject/ansible/library/vendor']
  ansible python module location = /Users/andy/gr/myproject/.tox/deploy/lib/python2.7/site-packages/ansible
  executable location = .tox/deploy/bin/ansible
  python version = 2.7.14 (default, Mar  1 2018, 19:23:40) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

Playbook:

---

- hosts: all
  tasks:
  - command: "true"
    become: true

Remote system

uname -a

Linux some-host-bastion 4.4.23-31.54.amzn1.x86_64 #1 SMP Tue Oct 18 22:02:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

sudo -V

Sudo version 1.8.6p3
Sudoers policy plugin version 1.8.6p3
Sudoers file grammar version 42
Sudoers I/O plugin version 1.8.6p3

Logs

[pid 71988] 22:39:28 D mitogen: unix.connect(path='/var/folders/bw/ghklm2fs6bx_x9x_f0wg5kph0000gn/T/mitogen_unix_YJwmI_')
[pid 71988] 22:39:28 D mitogen: unix.connect(): local ID is 3, remote is 0
[pid 71977] 22:39:28 D mitogen: Context(2, u'ssh.some-host-web').call_async(<function _proxy_connect at 0x10d1602a8>, *(None, 4, 'sudo', {'sudo_path': u'sudo', 'profiling': False, 'sudo_args': ['-H', '-S', '-n'], 'username': u'root', 'password': None, 'python_path': u'/usr/bin/python', 'debug': False}), **{})
[pid 71977] 22:39:28 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('mitogen.parent')
[pid 71977] 22:39:28 D mitogen: pkgutil._get_module_via_pkgutil('mitogen.parent') -> <pkgutil.ImpLoader instance at 0x10d694488>
[pid 71977] 22:39:28 D mitogen: pkgutil._get_module_via_pkgutil('mitogen.core') -> <pkgutil.ImpLoader instance at 0x10d694440>
[pid 71977] 22:39:28 D mitogen: pkgutil._get_module_via_pkgutil('mitogen') -> <pkgutil.ImpLoader instance at 0x10d2faf80>
[pid 71977] 22:39:28 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.some-host-web'), 'mitogen.parent')
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen: _proxy_connect(): constructing ModuleForwarder
[pid 71977] 22:39:28 D mitogen: ModuleResponder(Router(Broker()))._on_get_module('mitogen.sudo')
[pid 71977] 22:39:28 D mitogen: pkgutil._get_module_via_pkgutil('mitogen.sudo') -> <pkgutil.ImpLoader instance at 0x10d2fafc8>
[pid 71977] 22:39:28 D mitogen: _send_load_module(mitogen.ssh.Stream(u'ssh.some-host-web'), 'mitogen.sudo')
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen: mitogen.sudo.Stream('default').connect()
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen.sudo: sudo command line: [u'sudo', '-u', u'root', '--set-home', u'/usr/bin/python', '-c', 'import codecs,os,sys;_=codecs.decode;exec(_(_("eNpdj81OwzAQhM/kKbitLZzKTlQQkSIVRYh7DuQAqMrPtrVIbctOcOHpcZVKuNz225nd0dSsKbVbGWmQ0MQyH5Hc3QbYaftJaJHchHmYTUY4E5zTP65ZTDaoYuF+1A5JHYONoYnBL4DqS1qt3uCpfnnl8FG677A8YT9PbTfi4gk4kmuBwVFOeo+qwD5LZ4d2c+gP9pS6qd1j6rErRJ7xHGgSPngrJySCwXPF31XYVeWWnLsO2qAKDcF2QFcW24E88oc1ZfAjzXJ78TQMPITml19VrPlrDfI8W9+HnLvqf7o4p/8CvEJ1xw==".encode(),"base64"),"zip"))']
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen: tty_create_child() child 13244 fd 15, parent 13203, cmd: "sudo" "-u" "root" "--set-home" "/usr/bin/python" "-c" "import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNpdj81OwzAQhM/kKbitLZzKTlQQkSIVRYh7DuQAqMrPtrVIbctOcOHpcZVKuNz225nd0dSsKbVbGWmQ0MQyH5Hc3QbYaftJaJHchHmYTUY4E5zTP65ZTDaoYuF+1A5JHYONoYnBL4DqS1qt3uCpfnnl8FG677A8YT9PbTfi4gk4kmuBwVFOeo+qwD5LZ4d2c+gP9pS6qd1j6rErRJ7xHGgSPngrJySCwXPF31XYVeWWnLsO2qAKDcF2QFcW24E88oc1ZfAjzXJ78TQMPITml19VrPlrDfI8W9+HnLvqf7o4p/8CvEJ1xw==\".encode(),\"base64\"),\"zip\"))"
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen: mitogen.sudo.Stream('local.13244').connect(): child process stdin/stdout=15
[pid 71977] 22:39:28 D mitogen.ctx.ssh.some-host-web: mitogen.sudo: mitogen.sudo.Stream('local.13244'): received "sudo: invalid option -- '-'\nusage: sudo [-D level] -h | -K | -k | -V\nusage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user\n            name|#uid]\nusage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user\n            name] [-u user name|#uid] [-g groupname|#gid] [command]\nusage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]\n            [VAR=value] [-i|-s] [<command>]\nusage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] file ...\n"
[pid 71977] 22:39:28 E mitogen: While invoking <ansible_mitogen.services.ContextService object at 0x10d177f10>.dispatch()
Traceback (most recent call last):
  File "/Users/andy/forks/mitogen/mitogen/service.py", line 72, in run_once
    msg.reply(self.dispatch(args, msg))
  File "/Users/andy/forks/mitogen/ansible_mitogen/services.py", line 70, in dispatch
    self._context_by_key[key] = method(**dct)
  File "/Users/andy/forks/mitogen/mitogen/master.py", line 647, in sudo
    return self.connect('sudo', **kwargs)
  File "/Users/andy/forks/mitogen/mitogen/parent.py", line 461, in connect
    return self.proxy_connect(via, method_name, name=name, **kwargs)
  File "/Users/andy/forks/mitogen/mitogen/parent.py", line 470, in proxy_connect
    name, context_id, method_name, kwargs
  File "/Users/andy/forks/mitogen/mitogen/master.py", line 612, in call
    return receiver.get().unpickle(throw_dead=False)
  File "/Users/andy/forks/mitogen/mitogen/core.py", line 314, in unpickle
    raise obj
CallError: mitogen.core.StreamError: EOF on stream; last 300 bytes received: 'r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]\n            [VAR=value] [-i|-s] [<command>]\nusage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] file ...\n'
  File "<stdin>", line 1391, in _dispatch_calls
  File "<stdin>", line 1386, in _dispatch_one
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 264, in _proxy_connect
    **kwargs
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 449, in _connect
    stream.connect()
  File "master:/Users/andy/forks/mitogen/mitogen/sudo.py", line 131, in connect
    super(Stream, self).connect()
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 395, in connect
    self._connect_bootstrap()
  File "master:/Users/andy/forks/mitogen/mitogen/sudo.py", line 150, in _connect_bootstrap
    time.time() + 10.0):
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 207, in iter_read
    (''.join(bits)[-300:],)

[pid 71988] 22:39:28 D ansible_mitogen.connection: Call run_module('ansible.modules.commands.command',) took 218 ms
[pid 71988] 22:39:28 D mitogen: mitogen.core.Stream('unix_listener.71977').on_disconnect()
[pid 71977] 22:39:28 D mitogen: mitogen.core.Stream('unix_client.71988').on_disconnect()
[pid 71988] 22:39:28 D mitogen: Waker(Broker()).on_disconnect()
The full traceback is:
Traceback (most recent call last):
  File "/Users/andy/gr/myproject/.tox/ansible/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/Users/andy/gr/myproject/.tox/ansible/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/Users/andy/forks/mitogen/ansible_mitogen/mixins.py", line 128, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/Users/andy/gr/myproject/.tox/ansible/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/Users/andy/forks/mitogen/ansible_mitogen/mixins.py", line 308, in _execute_module
    env=cast(env),
  File "/Users/andy/forks/mitogen/ansible_mitogen/mixins.py", line 137, in call
    return self._connection.call(func, *args, **kwargs)
  File "/Users/andy/forks/mitogen/ansible_mitogen/connection.py", line 238, in call
    return self.call_async(func, *args, **kwargs).get().unpickle()
  File "/Users/andy/forks/mitogen/ansible_mitogen/connection.py", line 224, in call_async
    self._connect()
  File "/Users/andy/forks/mitogen/ansible_mitogen/connection.py", line 204, in _connect
    self.context = self._connect_sudo(via=self.host)
  File "/Users/andy/forks/mitogen/ansible_mitogen/connection.py", line 172, in _connect_sudo
    self._play_context.become_flags or ''
  File "/Users/andy/forks/mitogen/mitogen/service.py", line 91, in call
    return recv.get().unpickle()
  File "/Users/andy/forks/mitogen/mitogen/core.py", line 314, in unpickle
    raise obj
CallError: mitogen.core.CallError: mitogen.core.StreamError: EOF on stream; last 300 bytes received: 'r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]\n            [VAR=value] [-i|-s] [<command>]\nusage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g\n            groupname|#gid] [-p prompt] [-u user name|#uid] file ...\n'
  File "<stdin>", line 1391, in _dispatch_calls
  File "<stdin>", line 1386, in _dispatch_one
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 264, in _proxy_connect
    **kwargs
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 449, in _connect
    stream.connect()
  File "master:/Users/andy/forks/mitogen/mitogen/sudo.py", line 131, in connect
    super(Stream, self).connect()
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 395, in connect
    self._connect_bootstrap()
  File "master:/Users/andy/forks/mitogen/mitogen/sudo.py", line 150, in _connect_bootstrap
    time.time() + 10.0):
  File "master:/Users/andy/forks/mitogen/mitogen/parent.py", line 207, in iter_read
    (''.join(bits)[-300:],)

  File "/Users/andy/forks/mitogen/mitogen/service.py", line 72, in run_once
    msg.reply(self.dispatch(args, msg))
  File "/Users/andy/forks/mitogen/ansible_mitogen/services.py", line 70, in dispatch
    self._context_by_key[key] = method(**dct)
  File "/Users/andy/forks/mitogen/mitogen/master.py", line 647, in sudo
    return self.connect('sudo', **kwargs)
  File "/Users/andy/forks/mitogen/mitogen/parent.py", line 461, in connect
    return self.proxy_connect(via, method_name, name=name, **kwargs)
  File "/Users/andy/forks/mitogen/mitogen/parent.py", line 470, in proxy_connect
    name, context_id, method_name, kwargs
  File "/Users/andy/forks/mitogen/mitogen/master.py", line 612, in call
    return receiver.get().unpickle(throw_dead=False)
  File "/Users/andy/forks/mitogen/mitogen/core.py", line 314, in unpickle
    raise obj

Detect and address Python 2.4 incompatibilities

Thanks to https://www.pythonweekly.com/ I stumbled upon vermin, which can scan a codebase and report the minimum required Python version.

$ vermin -vv mitogen/
Detecting python files..
Analyzing 13 files using 8 processes..
             /home/alex/src/mitogen/mitogen/utils.py
             /home/alex/src/mitogen/mitogen/service.py
             /home/alex/src/mitogen/mitogen/ssh.py
'os.path.realpath' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.version_info' requires (2.0, 3.0)
long is a v2 feature
'Queue' requires (2.0, None)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
'sys.flags' requires (2.6, 3.0)
2.6, !3      /home/alex/src/mitogen/mitogen/core.py
2.6, 3.0     /home/alex/src/mitogen/mitogen/parent.py
             /home/alex/src/mitogen/mitogen/unix.py
2.6, 3.0     /home/alex/src/mitogen/mitogen/compat/pkgutil.py
             /home/alex/src/mitogen/mitogen/__init__.py
             /home/alex/src/mitogen/mitogen/sudo.py
2.0          /home/alex/src/mitogen/mitogen/docker.py
2.0          /home/alex/src/mitogen/mitogen/fakessh.py
2.0, 3.0     /home/alex/src/mitogen/mitogen/master.py
             /home/alex/src/mitogen/mitogen/compat/__init__.py
Minimum required versions: 2.6
Incompatible versions:     3

master: cfmakeraw() sets different flags to those documented for termios(3)

The differences are

  1. mitogen adds clears IXOFF in oflag
  2. mitogen adds clears ECHOE in lflag
  3. mitogen additionally overwrites iflag, oflag, and lflag with 0

According to termios(3) the glibc function performs

c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
c_oflag &= ~(OPOST);
c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
c_cflag &= ~(CSIZE | PARENB);
c_cflag |= CS8;

mitogen's cfmakeraw() currently performs

https://github.com/dw/mitogen/blob/c503706f96a5bf5074d8c807b0873f869f232675/mitogen/master.py#L132-L143

As usual I don't know how much of this is intentional vs accidental.

Edit 2017-12-03 Corrected add -> clear

cfmakeraw: TypeError: 'list' object is not callable

If i try to run the example: pipenv run python foo.py server.mydomain.tld

import curses
import subprocess
import sys
import time

import mitogen.core
import mitogen.master
import mitogen.utils


class Host(object):
    name = None
    context = None
    recv = None

    def __init__(self):
        self.procs = {}  #: pid -> Process()


class Process(object):
    host = None
    user = None
    pid = None
    ppid = None
    pgid = None
    command = None
    rss = None
    pcpu = None
    rss = None


@mitogen.core.takes_router
def remote_main(context_id, handle, delay, router):
    context = mitogen.core.Context(router, context_id)
    sender = mitogen.core.Sender(context, handle)

    args = ['ps', '-axwwo', 'user,pid,ppid,pgid,%cpu,rss,command']
    while True:
        sender.put(subprocess.check_output(args))
        time.sleep(delay)


def parse_output(host, s):
    prev_pids = set(host.procs)

    for line in s.splitlines()[1:]:
        bits = line.split(None, 6)
        pid = int(bits[1])
        new = pid not in prev_pids
        prev_pids.discard(pid)

        try:
            proc = host.procs[pid]
        except KeyError:
            host.procs[pid] = proc = Process()
            proc.hostname = host.name

        proc.new = new
        proc.user = bits[0]
        proc.pid = pid
        proc.ppid = int(bits[2])
        proc.pgid = int(bits[3])
        proc.pcpu = float(bits[4])
        proc.rss = int(bits[5]) / 1024
        proc.command = bits[6]

    # These PIDs had no update, so probably they are dead now.
    for pid in prev_pids:
        del host.procs[pid]


class Painter(object):

    def __init__(self, hosts):
        self.stdscr = curses.initscr()
        curses.start_color()
        self.height, self.width = self.stdscr.getmaxyx()
        curses.cbreak()
        curses.noecho()
        self.stdscr.keypad(1)
        self.hosts = hosts
        self.format = (
            '%(hostname)10.10s '
            '%(pid)7.7s '
            '%(ppid)7.7s '
            '%(pcpu)6.6s '
            '%(rss)5.5s '
            '%(command)20s'
        )

    def close(self):
        curses.endwin()

    def paint(self):
        self.stdscr.erase()
        self.stdscr.addstr(0, 0, time.ctime())

        all_procs = []
        for host in self.hosts:
            all_procs.extend(host.procs.itervalues())

        all_procs.sort(key=(lambda proc: -proc.pcpu))

        self.stdscr.addstr(1, 0, self.format % {
            'hostname': 'HOST',
            'pid': 'PID',
            'ppid': 'PPID',
            'pcpu': '%CPU',
            'rss': 'RSS',
            'command': 'COMMAND',
        })
        for i, proc in enumerate(all_procs):
            if (i + 3) >= self.height:
                break
            if proc.new:
                self.stdscr.attron(curses.A_BOLD)
            else:
                self.stdscr.attroff(curses.A_BOLD)
            self.stdscr.addstr(2 + i, 0, self.format % dict(
                vars(proc),
                command=proc.command[:self.width - 36]
            ))

        self.stdscr.refresh()


def local_main(painter, router, select, delay):
    next_paint = 0
    while True:
        recv, (msg, data) = select.get()
        parse_output(recv.host, data)
        if next_paint < time.time():
            next_paint = time.time() + delay
            painter.paint()


def main(router, argv):
    mitogen.utils.log_to_file()
    if not len(argv):
        print 'mitop: Need a list of SSH hosts to connect to.'
        sys.exit(1)

    delay = 2.0
    select = mitogen.master.Select(oneshot=False)
    hosts = []

    for hostname in argv:
        print 'Starting on', hostname
        host = Host()
        host.name = hostname
        if host.name == 'localhost':
            host.context = router.local()
        else:
            host.context = router.ssh(hostname=host.name)

        host.recv = mitogen.core.Receiver(router)
        host.recv.host = host
        select.add(host.recv)

        call_recv = host.context.call_async(remote_main,
                                            mitogen.context_id, host.recv.handle, delay)

        # Adding call_recv to the select will cause CallError to be thrown by
        # .get() if startup in the context fails, halt local_main() and cause
        # the exception to be printed.
        select.add(call_recv)
        hosts.append(host)

    painter = Painter(hosts)
    try:
        try:
            local_main(painter, router, select, delay)
        except KeyboardInterrupt:
            pass
    finally:
        painter.close()

if __name__ == '__main__':
    mitogen.utils.run_with_router(main, sys.argv[1:])

This is the traceback:

Starting on server.mydomain.tld
Traceback (most recent call last):
  File "foo.py", line 181, in <module>
    mitogen.utils.run_with_router(main, sys.argv[1:])
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/utils.py", line 43, in run_with_router
    return func(router, *args, **kwargs)
  File "foo.py", line 156, in main
    host.context = router.ssh(hostname=host.name)
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 957, in ssh
    return self.connect('ssh', **kwargs)
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 978, in connect
    return self._connect(context_id, klass, name=name, **kwargs)
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 964, in _connect
    stream.connect()
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/ssh.py", line 68, in connect
    super(Stream, self).connect()
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 772, in connect
    pid, fd = self.create_child(*self.get_boot_command())
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 134, in tty_create_child
    disable_echo(master_fd)
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 116, in disable_echo
    new = cfmakeraw(old)
  File "/Users/moritz/Documents/Build/mitoFF/mitogen/mitogen/master.py", line 102, in cfmakeraw
    iflag &= ~flags('IGNBRK BRKINT PARMRK ISTRIP INLCR IGNCR ICRNL IXON')
TypeError: 'list' object is not callable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.