New issue

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

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

Already on GitHub? Sign in to your account

Mitogen fails on Ubuntu 16.04 #114

Closed
mlaurense opened this Issue Mar 7, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@mlaurense
Copy link

mlaurense commented Mar 7, 2018

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)]

@dw

This comment has been minimized.

Copy link
Owner

dw commented Mar 7, 2018

Thanks for reporting this! I actually test regularly on a 16.04 host against itself, and from OS X toward 16.04 as a target, and have not encountered this issue yet.

I notice it looks like you're using a Git checkout of Ansible, that could be a big clue.

Let me try to reproduce your setup (tomorrow) and will see if I can reproduce.

Thanks again!

@dw

This comment has been minimized.

Copy link
Owner

dw commented Mar 7, 2018

Whoops, my bad, it's a Git archive of the Mitogen plugin, not Ansible itself :)

Are you running under virtualenv or similar?

@mlaurense

This comment has been minimized.

Copy link
Author

mlaurense commented Mar 7, 2018

No, we’re not using virtualenv.

I encountered the same error using the downloaded zip, but later added Mitogen as a submodule to our project (we have our playbooks checked in to git ;))

@dw

This comment has been minimized.

Copy link
Owner

dw commented Mar 8, 2018

Looks like I may have bumped into this on one of my own playbooks. Should hopefully have a fix by end of Thursday

@dw

This comment has been minimized.

Copy link
Owner

dw commented Mar 8, 2018

The problem is that you have an old system version of Ansible installed on the target machine, most likely the Ansible 2.0 package that came with Ubuntu. This is a bug in the extension, will be fixed shortly.

@dw dw closed this in a9c6c13 Mar 8, 2018

@dw

This comment has been minimized.

Copy link
Owner

dw commented Mar 8, 2018

Let me know if you have any more trouble, and thanks for testing!

@dw dw added bug ansible NeedsTest and removed ansible bug labels Mar 8, 2018

dw added a commit that referenced this issue Mar 19, 2018

importer: take priority over system packages when whitelisting is ena…
…bled

Might want to de-overload the meaning of whitelist in future, but in
the meantime it works fine for Ansible and I can't think of a
whitelisting use case that would break because of it.

Closes #114.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment