Skip to content

The Mitogen master process was unable to serve u'ansible_mitogen.target'. on ansible core 2.13Β #946

@uumas

Description

@uumas

Running the latest master of mitogen, I'm getting the following error on all hosts I've tried against (Debian 10-11, CentOS 7-8, Ubuntu 20-22):

[WARNING]: Unhandled error in Python interpreter discovery for host: exceptions.ImportError: The Mitogen master process was
unable to serve u'ansible_mitogen.target'. It may be a native Python extension, or it may be missing entirely. Check the importer debug logs on the master
for more information.   File "<stdin>", line 3698, in _dispatch_one   File "<stdin>", line 3685, in _parse_request   File "<stdin>", line 682, in
import_module   File "<stdin>", line 1521, in load_module

Ansible version info:

ansible [core 2.13.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/uumas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/uumas/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0]
  jinja version = 3.1.2
  libyaml = True

Traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 157, in run
    res = self._execute()
  File "/usr/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 635, in _execute
    result = self._handler.run(task_vars=vars_copy)
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/mixins.py", line 146, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/usr/lib/python3.10/site-packages/ansible/plugins/action/normal.py", line 47, in run
    result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/mixins.py", line 376, in _execute_module
    self._set_temp_file_args(module_args, wrap_async)
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/mixins.py", line 355, in _set_temp_file_args
    self._connection.get_good_temp_dir()
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/connection.py", line 832, in get_good_temp_dir
    self._connect()
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/connection.py", line 854, in _connect
    self._connect_stack(stack)
  File "/home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/connection.py", line 801, in _connect_stack
    dct = mitogen.service.call(
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/service.py", line 126, in call
    return call_context.call_service(service_name, method_name, **kwargs)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/core.py", line 2314, in call_service
    return recv.get().unpickle()
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/core.py", line 977, in unpickle
    raise obj
mitogen.core.CallError: builtins.ModuleNotFoundError: The Mitogen master process was unable to serve 'ansible_mitogen.target'. It may be a native Python extension, or it may be missing entirely. Check the importer debug logs on the master for more information.
  File "<stdin>", line 3698, in _dispatch_one
  File "<stdin>", line 3685, in _parse_request
  File "<stdin>", line 682, in import_module
  File "<stdin>", line 1521, in load_module

Some log (hostname replaced with ...):

[mux  22293] 12:58:33.935628 D mitogen.responder: sending ansible (0.53 KiB) to ssh....
[mux  22293] 12:58:33.937290 D mitogen.responder: ansible.module_utils is a package at /usr/lib/python3.10/site-packages/ansible/module_utils/__init__.py with submodules ['_text', 'ansible_release', 'api', 'basic', 'common', 'compat', 'connection', 'csharp', 'distro', 'errors', 'facts', 'json_utils', 'parsing', 'powershell', 'pycompat24', 'service', 'six', 'splitter', 'urls', 'yumdnf']
[mux  22293] 12:58:33.937960 D mitogen.responder: sending ansible.module_utils (0.48 KiB) to ssh....
[mux  22293] 12:58:33.999957 D mitogen: PkgutilMethod(): <_frozen_importlib_external.SourceFileLoader object at 0x7f67bd505db0>.get_file_name('ansible.module_utils.distro') failed: ImportError('loader for distro cannot handle ansible.module_utils.distro')
[mux  22293] 12:58:34.000093 D mitogen: SysModulesMethod(): <module 'distro' from '/usr/lib/python3.10/site-packages/distro/__init__.py'>.__name__ is 'distro', aborting
[mux  22293] 12:58:34.000192 D mitogen: ParentEnumerationMethod(): 'ansible.module_utils.distro' is PKG_DIRECTORY: '/usr/lib/python3.10/site-packages/ansible/module_utils/distro/__init__.py'
[mux  22293] 12:58:34.016629 D mitogen: While importing 'ansible.module_utils.basic'
Traceback (most recent call last):
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1134, in _send_module_and_related
    tup = self._build_tuple(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1087, in _build_tuple
    for name in self._finder.find_related(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 959, in find_related
    names = self.find_related_imports(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 933, in find_related_imports
    set(
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 937, in <genexpr>
    and not is_stdlib_name(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 140, in is_stdlib_name
    modpath = os.path.abspath(getattr(module, '__file__', ''))
  File "/usr/lib/python3.10/posixpath.py", line 378, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
[mux  22293] 12:58:34.017687 D mitogen.responder: sending ansible.module_utils.json_utils (2.68 KiB) to ssh....
[mux  22293] 12:58:34.018253 D mitogen.responder: sending ansible.release (0.99 KiB) to ssh....
[mux  22293] 12:58:34.018647 D mitogen.responder: ansible_mitogen is a package at /home/uumas/.local/lib/python3.10/site-packages/ansible_mitogen/__init__.py with submodules ['affinity', 'compat', 'connection', 'loaders', 'logging', 'mixins', 'module_finder', 'parsing', 'planner', 'plugins', 'process', 'runner', 'services', 'strategy', 'target', 'transport_config', 'utils']
[mux  22293] 12:58:34.018774 D mitogen.responder: sending ansible_mitogen (0.44 KiB) to ssh....
[mux  22293] 12:58:34.076591 D mitogen: While importing 'ansible_mitogen.runner'
Traceback (most recent call last):
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1134, in _send_module_and_related
    tup = self._build_tuple(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1087, in _build_tuple
    for name in self._finder.find_related(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 959, in find_related
    names = self.find_related_imports(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 933, in find_related_imports
    set(
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 937, in <genexpr>
    and not is_stdlib_name(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 140, in is_stdlib_name
    modpath = os.path.abspath(getattr(module, '__file__', ''))
  File "/usr/lib/python3.10/posixpath.py", line 378, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
[mux  22293] 12:58:34.094960 D mitogen: While importing 'ansible_mitogen.target'
Traceback (most recent call last):
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1134, in _send_module_and_related
    tup = self._build_tuple(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 1087, in _build_tuple
    for name in self._finder.find_related(fullname)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 959, in find_related
    names = self.find_related_imports(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 933, in find_related_imports
    set(
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 937, in <genexpr>
    and not is_stdlib_name(name)
  File "/home/uumas/.local/lib/python3.10/site-packages/mitogen/master.py", line 140, in is_stdlib_name
    modpath = os.path.abspath(getattr(module, '__file__', ''))
  File "/usr/lib/python3.10/posixpath.py", line 378, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
[mux  22293] 12:58:34.158828 D mitogen.responder: sending mitogen.parent (18.87 KiB) to ssh....
[mux  22293] 12:58:34.159104 D mitogen.responder: sending mitogen.fork (2.63 KiB) to ssh....
[mux  22293] 12:58:34.191350 D mitogen.responder: sending mitogen.select (1.62 KiB) to ssh....
[mux  22293] 12:58:34.191604 D mitogen.responder: sending mitogen.service (8.90 KiB) to ssh....

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-0.3Issues related to 0.3.X Mitogen releasesbugCode feature that hinders desired execution outcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions