mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

community.docker.docker_swarm_service_info - docker_swarm_service_info.py - ModuleNotFoundError: No module named 'ansible_collections'

Open Antoine-Sevec opened this issue 3 years ago • 1 comments

I did the test with and without mitogen And without Mitogen, I have no problems with community.docker.docker_swarm_service_info

Feel free to write an issue in your preferred format, however if in doubt, use the following checklist as a guide for what to include.

  • Which version of Ansible are you running? 2.10.6

  • Is your version of Ansible patched in any way? No

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

  • Have you tried the latest master version from Git? Yes

  • Do you have some idea of what the underlying problem may be?

fatal: [XXXX]: FAILED! => {"changed": false, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible_mitogen_runner_7rd4uy66/docker_swarm_service_info.py\", line 71, in <module>\r\n    from ansible_collections.community.docker.plugins.module_utils.common import (\r\nModuleNotFoundError: No module named 'ansible_collections'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
  • Mention your host and target OS and versions

  • Mention your host and target Python versions Host : Debian buster / Python 3.7 Target : Ubuntu 20.04 / Python 3.8.5

  • 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.

TASK [swarm_deploy : Get info from app-front] ******************************************************************************************
task path: /tmp/ansible/roles/swarm_deploy/tasks/deploy.yml:18
Thursday 25 February 2021  13:27:19 +0000 (0:00:00.434)       0:00:25.797 ***** 
[task 154] 13:27:19.022308 D ansible_mitogen.affinity: CPU mask for WorkerProcess: 0x000004
[task 154] 13:27:19.042478 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_3zashipu.sock) to connect to "adm-swarm-cluster-manager-01"
[task 154] 13:27:19.042664 D mitogen.unix: client: connecting to /tmp/mitogen_unix_3zashipu.sock
[task 154] 13:27:19.043009 D mitogen.unix: client: local ID is 2020, remote is 0
[mux  11] 13:27:19.043050 D mitogen.unix: listener: accepted connection from PID 154: unix_client.154
[task 154] 13:27:19.046880 D ansible_mitogen.planner: <class 'ansible_mitogen.planner.BinaryPlanner'> rejected 'community.docker.docker_swarm_service_info'
[task 154] 13:27:19.046987 D ansible_mitogen.planner: <class 'ansible_mitogen.planner.NewStylePlanner'> rejected 'community.docker.docker_swarm_service_info'
[task 154] 13:27:19.047090 D ansible_mitogen.planner: <class 'ansible_mitogen.planner.JsonArgsPlanner'> rejected 'community.docker.docker_swarm_service_info'
[task 154] 13:27:19.047165 D ansible_mitogen.planner: <class 'ansible_mitogen.planner.WantJsonPlanner'> rejected 'community.docker.docker_swarm_service_info'
[task 154] 13:27:19.047227 D ansible_mitogen.planner: <class 'ansible_mitogen.planner.OldStylePlanner'> accepted 'community.docker.docker_swarm_service_info' (filename '/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py')
[mux  11] 13:27:19.047636 D mitogen.service: caching small file /root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py
[mux  11] 13:27:19.047799 D mitogen.service: requesting Context(2, 'ssh.217.182.170.164') cache and forward small file to Context(4, 'ssh.217.182.170.164.sudo.root'): /root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py
[task 154] 13:27:19.048303 D mitogen.parent: starting function call to ssh.217.182.170.164.sudo.root: ansible_mitogen.target.run_module(kwargs={'runner_name': 'OldStyleRunner', 'module': 'community.docker.docker_swarm_service_info', 'path': '/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', 'json_args': '{"name": "app", "_ansible_check_mode": false, "_ansible_no_log": false, "_ansible_debug": false, "_ansible_diff": false, "_ansible_verbosity": 3, "_ansible_version": "2.10.6", "_ansible_module_name": "community.docker.docker_swarm_service_info", "_ansible_syslog_facility": "LOG_USER", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p", "vfat"], "_ansible_string_conversion_action": "warn", "_ansible_socket": null, "_ansible_shell_executable": "/bin/sh", "_ansible_keep_remote_files": false, "_ansible_tmpdir": null, "_ansible_remote_tmp": "~/.ansible/tmp"}', 'env': {}, 'interpreter_fragment': '/usr/bin/python3', 'is_python': False, 'good_temp_dir': '/root/.ansible/tmp', 'cwd': None, 'extra_env': None, 'emulate_tty': True, 'service_context': Context(0, None)})
[mux  11] 13:27:19.102144 D mitogen.service.[ssh.217.182.170.164]: PushFileService().store_and_forward('/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', [blob: 2976 bytes], Context(4, 'sudo.root')) 'mitogen.Pool.7340.1'
[mux  11] 13:27:19.102401 D mitogen.service.[ssh.217.182.170.164]: requesting Context(4, 'sudo.root') cache and forward small file to Context(4, 'sudo.root'): /root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py
[mux  11] 13:27:19.102554 D mitogen.[ssh.217.182.170.164]: calling service mitogen.service.PushFileService.store_and_forward of Context(4, 'sudo.root'), args: {'path': '/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', 'data': [blob: 2976 bytes], 'context': Context(4, 'sudo.root')}
[mux  11] 13:27:19.102901 D mitogen.[ssh.217.182.170.164]: sending message to Context(4, 'sudo.root'): Message(4, 2, 2, 110, 1017, b'\x80\x02X\x1f\x00\x00\x00mitogen.service.PushFileServiceq\x00X\x11\x00\x00\x00store'..3358)
[mux  11] 13:27:19.103059 D mitogen.service.[ssh.217.182.170.164.sudo.root]: PushFileService().store_and_forward('/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', [blob: 2976 bytes], Context(4, 'sudo.root')) 'mitogen.Pool.0c70.1'
[mux  11] 13:27:19.106517 D mitogen.[ssh.217.182.170.164.sudo.root]: Dispatcher: dispatching ('f32bc8984daf-154-7fcb2fc96740-40c9b94fd', 'ansible_mitogen.target', None, 'run_module', (), Kwargs({'kwargs': {'runner_name': 'OldStyleRunner', 'module': 'community.docker.docker_swarm_service_info', 'path': '/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', 'json_args': '{"name": "app", "_ansible_check_mode": false, "_ansible_no_log": false, "_ansible_debug": false, "_ansible_diff": false, "_ansible_verbosity": 3, "_ansible_version": "2.10.6", "_ansible_module_name": "community.docker.docker_swarm_service_info", "_ansible_syslog_facility": "LOG_USER", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p", "vfat"], "_ansible_string_conversion_action": "warn", "_ansible_socket": null, "_ansible_shell_executable": "/bin/sh", "_ansible_keep_remote_files": false, "_ansible_tmpdir": null, "_ansible_remote_tmp": "~/.ansible/tmp"}', 'env': {}, 'interpreter_fragment': '/usr/bin/python3', 'is_python': False, 'good_temp_dir': '/root/.ansible/tmp', 'cwd': None, 'extra_env': None, 'emulate_tty': True, 'service_context': Context(0, None)}}))
[mux  11] 13:27:19.106835 D ansible_mitogen.target.[ssh.XXXXXXX.sudo.root]: exec_args(['/bin/sh', '-c', '/usr/bin/python3 /root/.ansible/tmp/ansible_mitogen_runner_3cpu1wau/docker_swarm_service_info.py /root/.ansible/tmp/ansible_mitogen_runner_3cpu1wau/ansible_mitogen2wexso8y-args'], ..., chdir=None)
[mux  11] 13:27:19.453106 D mitogen.[ssh.XXXXXXX.sudo.root]: Dispatcher: Message(4, 2020, 0, 101, 1002, b"\x80\x02(X'\x00\x00\x00f32bc8984daf-154-7fcb2fc96740-40c9b94fdq\x00X"..1224) -> {'rc': 1, 'stdout': 'Traceback (most recent call last):\r\n  File "/root/.ansible/tmp/ansible_mitogen_runner_3cpu1wau/docker_swarm_service_info.py", line 71, in <module>\r\n    from ansible_collections.community.docker.plugins.module_utils.common import (\r\nModuleNotFoundError: No module named \'ansible_collections\'\r\n', 'stderr': ''}
[task 154] 13:27:19.453718 D ansible_mitogen.connection: Call took 405 ms: ansible_mitogen.target.run_module(kwargs={'runner_name': 'OldStyleRunner', 'module': 'community.docker.docker_swarm_service_info', 'path': '/root/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_swarm_service_info.py', 'json_args': '{"name": "app", "_ansible_check_mode": false, "_ansible_no_log": false, "_ansible_debug": false, "_ansible_diff": false, "_ansible_verbosity": 3, "_ansible_version": "2.10.6", "_ansible_module_name": "community.docker.docker_swarm_service_info", "_ansible_syslog_facility": "LOG_USER", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p", "vfat"], "_ansible_string_conversion_action": "warn", "_ansible_socket": null, "_ansible_shell_executable": "/bin/sh", "_ansible_keep_remote_files": false, "_ansible_tmpdir": null, "_ansible_remote_tmp": "~/.ansible/tmp"}', 'env': {}, 'interpreter_fragment': '/usr/bin/python3', 'is_python': False, 'good_temp_dir': '/root/.ansible/tmp', 'cwd': None, 'extra_env': None, 'emulate_tty': True, 'service_context': Context(0, None)})
[task 154] 13:27:19.454299 D ansible_mitogen.mixins: _remove_tmp_path(None)
[task 154] 13:27:19.454496 D ansible_mitogen.mixins: _remove_tmp_path(None)
[task 154] 13:27:19.454876 D mitogen.parent: starting no-reply function call to 'ssh.XXXXXXXX.sudo.root': mitogen.core.Dispatcher.forget_chain('f32bc8984daf-154-7fcb2fc96740-40c9b94fd')
[mux  11] 13:27:19.455734 D ansible_mitogen.services: decrementing reference count for Context(4, 'ssh.XXXXXXXX.sudo.root')
[task 154] 13:27:19.456501 D mitogen: MitogenProtocol(unix_listener.11): disconnecting
[mux  11] 13:27:19.456931 D mitogen: <Side of unix_client.154 fd 75>: empty read, disconnecting
[mux  11] 13:27:19.457181 D mitogen: MitogenProtocol(unix_client.154): disconnecting
[task 154] 13:27:19.457066 D mitogen: Waker(fd=10/11): disconnecting
[task 154] 13:27:19.457654 D mitogen: Router(Broker(e198)): 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 "/root/.ansible/tmp/ansible_mitogen_runner_3cpu1wau/docker_swarm_service_info.py", line 71, in <module>
    from ansible_collections.community.docker.plugins.module_utils.common import (
ModuleNotFoundError: No module named 'ansible_collections'
fatal: [XXXXXXXXXXXXX]: FAILED! => {
    "changed": false,
    "module_stderr": "",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible_mitogen_runner_3cpu1wau/docker_swarm_service_info.py\", line 71, in <module>\r\n    from ansible_collections.community.docker.plugins.module_utils.common import (\r\nModuleNotFoundError: No module named 'ansible_collections'\r\n",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Antoine-Sevec avatar Feb 25 '21 13:02 Antoine-Sevec

This was resolved for me by using the latest code from github, not the Release Candidate

t2d avatar Oct 16 '21 10:10 t2d