Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ansible fails to load submodule from upstream role linux-system-roles.network when mitogen is enabled #911

Open
aneagoe opened this issue Mar 10, 2022 · 7 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@aneagoe
Copy link

aneagoe commented Mar 10, 2022

  • Which version of Ansible are you running?

    • 2.12.2
    • 2.9.27
  • Is your version of Ansible patched in any way?

    • no
  • Are you running with any custom modules, or module_utils loaded?

    • yes, coming from upstream roles/collections
  • Have you tried the latest master version from Git?

    • no
  • Do you have some idea of what the underlying problem may be?
    https://mitogen.networkgenomics.com/ansible_detailed.html#common-problems has
    instructions to help figure out the likely cause and how to gather relevant
    logs.

    • no
  • Mention your host and target OS and versions

    • control-host: Fedora 35, target-host: CentOS8 Stream, ansible 2.12.2, python 3.10.2, mitogen 0.3.2
    • control-host: CentOS8 Stream, target-host: CentOS8 Stream, ansible 2.9.27, python 3.6.8, mitogen 0.2.10
  • If reporting a crash or hang in Ansible, please rerun with -vvv and include
    200 lines of output around the point of the error, along with a full copy of
    any traceback or error text in the log. Beware "-vvv" may include secret
    data! Edit as necessary before posting.

    • ansible_mitogen-a2.9-p3.6.log
    • ansible_mitogen-a2.12-p3.10.log
    • error snippet:
      [WARNING]: exception: Traceback (most recent call last): File "master:/home/andrei/.ansible/roles/linux-system-roles.network/library/network_connections.py", line 2620, in main File "master:/home/andrei/.ansible/roles/linux-system-roles.network/library/network_connections.py", line 1792, in create File "master:/home/andrei/.ansible/roles/linux-system-roles.network/library/network_connections.py", line 2008, in __init__ ModuleNotFoundError: No module named 'ansible.module_utils.network_lsr.nm'
      The same works as expected when mitogen is disabled.
  • If reporting any kind of problem with Ansible, please include the Ansible
    version along with output of "ansible-config dump --only-changed".

ANSIBLE_NOCOWS(/home/andrei/code/ansible/env/prod/ansible.cfg) = True
CACHE_PLUGIN(/home/andrei/code/ansible/env/prod/ansible.cfg) = redis
CACHE_PLUGIN_CONNECTION(/home/andrei/code/ansible/env/prod/ansible.cfg) = distill-redis.example.com:30379:0:redacted
CACHE_PLUGIN_TIMEOUT(/home/andrei/code/ansible/env/prod/ansible.cfg) = 0
CALLBACKS_ENABLED(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['profile_tasks']
COLLECTIONS_PATHS(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/.ansible/collections', '/home/andrei/code/ansible/requirements_collections']
DEFAULT_ACTION_PLUGIN_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/env/prod/plugins/action', '/home/andrei/code/ansible/roles/ceph/plugins/actions']
DEFAULT_CALLBACK_PLUGIN_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/env/prod/plugins/callback', '/usr/share/ansible/plugins/callback', '/home/andrei/code/ansible/roles/ceph/plugins/callback']
DEFAULT_FILTER_PLUGIN_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/env/prod/plugins/filter', '/usr/share/ansible/plugins/filter', '/home/andrei/code/ansible/roles/ceph/plugins/filter']
DEFAULT_FORKS(/home/andrei/code/ansible/env/prod/ansible.cfg) = 500
DEFAULT_GATHERING(/home/andrei/code/ansible/env/prod/ansible.cfg) = implicit
DEFAULT_GATHER_TIMEOUT(/home/andrei/code/ansible/env/prod/ansible.cfg) = 60
DEFAULT_HASH_BEHAVIOUR(/home/andrei/code/ansible/env/prod/ansible.cfg) = merge
DEFAULT_HOST_LIST(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/env/prod/inventory']
DEFAULT_JINJA2_EXTENSIONS(/home/andrei/code/ansible/env/prod/ansible.cfg) = tt.j2ext.RaiseExtension, tt.j2ext.GitRevisionExtension
DEFAULT_MANAGED_STR(/home/andrei/code/ansible/env/prod/ansible.cfg) = This file is managed by ansible. Your changes will be overwritten.
DEFAULT_MODULE_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/env/prod/plugins/modules', '/home/andrei/code/ansible/roles/ceph/library']
DEFAULT_PRIVATE_KEY_FILE(/home/andrei/code/ansible/env/prod/ansible.cfg) = /home/andrei/.ssh/ansible
DEFAULT_REMOTE_USER(/home/andrei/code/ansible/env/prod/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/code/ansible/roles', '/home/andrei/.ansible/roles', '/home/andrei/code/ansible/roles/ceph/roles', '/home/andrei/code/ansible/requirements_roles']
DEFAULT_STRATEGY(/home/andrei/code/ansible/env/prod/ansible.cfg) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['/home/andrei/.ansible/plugins/strategy', '/usr/share/ansible/plugins/strategy', '/usr/local/lib/python3.10/site-packages/ansible_mitogen/plugins/strategy', '/usr/lib/python3.10/site-packages/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(/home/andrei/code/ansible/env/prod/ansible.cfg) = 60
HOST_KEY_CHECKING(/home/andrei/code/ansible/env/prod/ansible.cfg) = False
INTERPRETER_PYTHON(/home/andrei/code/ansible/env/prod/ansible.cfg) = /usr/bin/python3
INVALID_TASK_ATTRIBUTE_FAILED(/home/andrei/code/ansible/env/prod/ansible.cfg) = False
INVENTORY_ENABLED(/home/andrei/code/ansible/env/prod/ansible.cfg) = ['script']
RETRY_FILES_ENABLED(/home/andrei/code/ansible/env/prod/ansible.cfg) = False
RETRY_FILES_SAVE_PATH(/home/andrei/code/ansible/env/prod/ansible.cfg) = /home/andrei/code/ansible/env/prod/"~/" # The directory they will go into
@aneagoe aneagoe added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels Mar 10, 2022
@moreati
Copy link
Member

moreati commented Mar 29, 2022

This may have been fixed in master, by #913

@cjeanner
Copy link

cjeanner commented Mar 31, 2022

Hello @moreati !
Unfortunately, I'm also hitting this issue, with a fresh "master" checkout (so I have #913).

The issue is for another module, but it seems to be really, really the same issue:

2022-03-31 04:41:33.480636 | 24420198-6297-967d-b366-000000000017 | TASK | Reserve instances
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'ansible.module_utils.openstack'
2022-03-31 04:41:33.638778 | 24420198-6297-967d-b366-000000000017 | FATAL | Reserve instances | localhost | error={"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"master:/home/stack/mitogen/ansible_mit
ogen/runner.py\", line 975, in _run\n self._run_code(code, mod)\n File \"master:/home/stack/mitogen/ansible_mitogen/runner.py\", line 939, in _run_code\n exec(code, vars(mod))\n File \"master:/usr/share/ansible/plugins/modules/metalsmith_instances.py\", line 21, in <module>\nModuleNotFoundError: No module named 'ansible.module_utils.openstack'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Involved code is, among things:

Note that it's working just fine with the "linear" strategy from Ansible.

@amarao
Copy link

amarao commented Mar 31, 2022

We are having the same problem with openstack modules.

Solution was to set strategy to linear explicitly for play with those modules.

@cjeanner
Copy link

It's as if mitogen doesn't know about /usr/share/ansible/collections/ansible_collections actually.
For instance, the "metalsmith_instances" module is in /usr/share/ansible/plugins/modules, and is found; but the openstack collection is, well, a collection, and its python content ends in /usr/share/ansible/collections/ansible_collections/openstack/cloud/plugins, in subdirectories.

May it be "just" that?

@moreati
Copy link
Member

moreati commented Apr 25, 2022

Notes to self

@maxpain
Copy link

maxpain commented Jun 27, 2022

Any updates?

@aneagoe
Copy link
Author

aneagoe commented Aug 22, 2024

Bump. I just hit this again as I've tried to update this role (linux-system-roles.network), (which I manually hacked and bundled everything together. Hopefully, it will be addressed at some point in directly in mitogen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

5 participants