Skip to content

mitogen_via + transport=smart throws KeyError: u'smart' #548

@liborburda

Description

@liborburda

Hello,

I'm getting following error while executing Ansible with mitogen:

$ ansible -m ping 'lindevtestv02.lindev.test' --ask-vault-pass -vvv
ansible 2.7.5
  config file = /home/burdalib/ansible-mitogen/ansible.cfg
  configured module search path = [u'/home/burdalib/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible
  executable location = /home/burdalib/ansible-mitogen/bin/ansible
  python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Using /home/burdalib/ansible-mitogen/ansible.cfg as config file
Vault password:
/home/burdalib/ansible-mitogen/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
/home/burdalib/ansible-mitogen/hosts did not meet script requirements, check plugin documentation if this is unexpected
Parsed /home/burdalib/ansible-mitogen/hosts inventory source with yaml plugin
[pid 23865] 10:38:53.910936 D mitogen: mitogen.service.Pool(0x7fbc373ea450, size=32, th='MainThread'): initialized
[pid 23865] 10:38:53.912781 D ansible_mitogen.process: Service pool configured: size=32
META: ran handlers
Tuesday 19 February 2019  10:38:53 +0200 (0:00:00.258)       0:00:00.258 ******
[pid 23900] 10:38:53.997113 D mitogen: unix.connect(path='/tmp/mitogen_unix_suc5XS.sock')
[pid 23900] 10:38:53.998268 D mitogen: unix.connect(): local ID is 1, remote is 0
[pid 23865] 10:38:53.998221 D mitogen: mitogen.unix.Listener('/tmp/mitogen_unix_suc5XS.sock'): accepted mitogen.core.Stream('unix_client.23900')
[pid 23900] 10:38:54.004739 D mitogen: mitogen.core.Stream('unix_listener.23865').on_disconnect()
[pid 23900] 10:38:54.005015 D mitogen: Waker(Broker(0x7fbc36b9b150) rfd=9, wfd=10).on_disconnect()
[pid 23865] 10:38:54.005028 D mitogen: mitogen.core.Stream('unix_client.23900').on_disconnect()
[pid 23900] 10:38:54.005362 D mitogen: Router(Broker(0x7fbc36b9b150)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg.
The full traceback is:
Traceback (most recent call last):
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 140, in run
    res = self._execute()
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 612, in _execute
    result = self._handler.run(task_vars=variables)
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/mixins.py", line 115, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 46, in run
    result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/mixins.py", line 331, in _execute_module
    self._temp_file_gibberish(module_args, wrap_async)
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/mixins.py", line 310, in _temp_file_gibberish
    self._connection.get_good_temp_dir()
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/connection.py", line 702, in get_good_temp_dir
    self._connect()
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/connection.py", line 749, in _connect
    stack = self._build_stack()
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/connection.py", line 657, in _build_stack
    inventory_name=self.inventory_hostname,
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/connection.py", line 623, in _stack_from_spec
    seen_names=seen_names + (spec.inventory_name(),),
  File "/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/connection.py", line 626, in _stack_from_spec
    stack += (CONNECTION_METHOD[spec.transport()](spec),)
KeyError: u'smart'

lindevtestv02.lindev.test | FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}
Tuesday 19 February 2019  10:38:54 +0200 (0:00:00.045)       0:00:00.304 ******
===============================================================================
ping ------------------------------------------------------------------------------------------------------------------------------------------------ 0.05s
 ----------------------------------------------------------------------------------------------------------------------------------------------------------
[pid 23865] 10:38:54.011405 D mitogen: Waker(Broker(0x7fbc37428cd0) rfd=6, wfd=8).on_disconnect()
[pid 23865] 10:38:54.011757 D mitogen: Router(Broker(0x7fbc37428cd0)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg.
$ ansible-config dump --only-changed
ANSIBLE_NOCOWS(/home/burdalib/ansible-mitogen/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/burdalib/ansible-mitogen/ansible.cfg) = -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o UserKnownHostsF
DEFAULT_CALLBACK_WHITELIST(/home/burdalib/ansible-mitogen/ansible.cfg) = [u'profile_tasks']
DEFAULT_HOST_LIST(/home/burdalib/ansible-mitogen/ansible.cfg) = [u'/home/burdalib/ansible-mitogen/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/burdalib/ansible-mitogen/ansible.cfg) = True
DEFAULT_NO_TARGET_SYSLOG(/home/burdalib/ansible-mitogen/ansible.cfg) = True
DEFAULT_ROLES_PATH(/home/burdalib/ansible-mitogen/ansible.cfg) = [u'/home/burdalib/ansible-mitogen/roles', u'/etc/ansible/roles']
DEFAULT_STRATEGY(/home/burdalib/ansible-mitogen/ansible.cfg) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(/home/burdalib/ansible-mitogen/ansible.cfg) = [u'/home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible_mitogen/plu
DEFAULT_TIMEOUT(/home/burdalib/ansible-mitogen/ansible.cfg) = 60
HOST_KEY_CHECKING(/home/burdalib/ansible-mitogen/ansible.cfg) = False
PERSISTENT_CONNECT_TIMEOUT(/home/burdalib/ansible-mitogen/ansible.cfg) = 30
$ ansible --version
ansible 2.7.5
  config file = /home/burdalib/ansible-mitogen/ansible.cfg
  configured module search path = [u'/home/burdalib/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/burdalib/ansible-mitogen/lib/python2.7/site-packages/ansible
  executable location = /home/burdalib/ansible-mitogen/bin/ansible
  python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
$ pip show mitogen
Name: mitogen
Version: 0.2.5
Summary: Library for writing distributed self-replicating programs.
Home-page: https://github.com/dw/mitogen/
Author: David Wilson
Author-email: UNKNOWN
License: New BSD
Location: /home/burdalib/ansible-mitogen/lib/python2.7/site-packages

After some tests I found out that this error happens only when:

  • ansible_transport is set to smart (default)
  • mitogen_via is set in inventory

When I tried to set ansible_transport = ssh, ping worked.
Also, when I set ansible_ssh_common_args = ' -o ProxyJump ...' instead of mitogen_via, it also worked.

Please let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions