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

ModuleNotFoundError: 'mmap' is present in the Mitogen importer blacklist #1103

Open
ondrejkopka opened this issue Aug 15, 2024 · 1 comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@ondrejkopka
Copy link

ondrejkopka commented Aug 15, 2024

  • Ansible 2.15.8

  • Ansible is not patched

  • No custom modules

  • Did not tried latest master version from Git?

  • Debian 12 (Bookworm)

  • Host Python 3.9.2, target Python 3.11.2

this task:

- name: wait for port 53 to be open on localhost
  wait_for:
    host: localhost
    port: 53
    state: started
    timeout: 120

leads to this error:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: 'mmap' is present in the Mitogen importer blacklist, therefore this context will not attempt to request it from the master, as the request will always be refused.
fatal: [host]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"master:/opt/mitogen/ansible_mitogen/runner.py\", line 1056, in _run\n    self._run_code(code, mod)\n  File \"master:/opt/mitogen/ansible_mitogen/runner.py\", line 1020, in _run_code\n    exec(code, vars(mod))\n  File \"master:/home/tom/.local/lib/python3.10/site-packages/ansible/modules/wait_for.py\", line 231, in <module>\n  File \"<stdin>\", line 1627, in create_module\n  File \"<stdin>\", line 1548, in _refuse_imports\nModuleNotFoundError: 'mmap' is present in the Mitogen importer blacklist, therefore this context will not attempt to request it from the master, as the request will always be refused.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@ondrejkopka ondrejkopka added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels Aug 15, 2024
@moreati
Copy link
Member

moreati commented Aug 20, 2024

Sorry for the wait. I wasn't able to to reproduce this error, with the following

- hosts: localhost
  vars:
    ansible_python_interpreter: /usr/bin/python3.11
  tasks:
    - wait_for:
        host: localhost
        port: 22
        state: started
        timeout: 5
root@u2204:~# python3.9 -mvenv v39
root@u2204:~# v39/bin/pip install ansible ansible-core==2.15.8 mitogen
root@u2204:~# ANSIBLE_STRATEGY=mitogen_linear ANSIBLE_STRATEGY_PLUGINS=v39/lib/python3.9/site-packages/ansible_mitogen/plugins/strategy/ v39/bin/ansible-playbook issue1103_repro.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ****************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************
ok: [localhost]

TASK [wait_for] *****************************************************************************************************
ok: [localhost]

PLAY RECAP **********************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

OS is Ubuntu 22.04 in a Proxmox LXC container, with Pythons installed from Deadsnakes repo.

root@u2204:~# uname -a
Linux u2204 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64 x86_64 x86_64 GNU/Linux
root@u2204:~# v39/bin/python --version; v39/bin/pip list
Python 3.9.19
Package             Version
------------------- -------
ansible             8.7.0
ansible-core        2.15.8
cffi                1.17.0
cryptography        43.0.0
importlib-resources 5.0.7
Jinja2              3.1.4
MarkupSafe          2.1.5
mitogen             0.3.9
packaging           24.1
pip                 23.0.1
pycparser           2.22
PyYAML              6.0.2
resolvelib          1.0.1
setuptools          58.1.0

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: python3.9 -m pip install --upgrade pip
root@u2204:~# /usr/bin/python3.11 --version
Python 3.11.9

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

2 participants