-
Notifications
You must be signed in to change notification settings - Fork 199
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
RuntimeError: load_plugins() called twice - Ansible 2.10.5, RHEL 8, package module #776
Comments
This also occurs if the dnf/yum module is used more than once in the same playbook. ansible_facts: {}
module_stderr: |-
Traceback (most recent call last):
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible_mitogen/runner.py", line 975, in _run
self._run_code(code, mod)
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible_mitogen/runner.py", line 939, in _run_code
exec(code, vars(mod))
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible/modules/dnf.py", line 1330, in <module>
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible/modules/dnf.py", line 1319, in main
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible/modules/dnf.py", line 1288, in run
File "master:/home/wouterhummelink/.local/lib/python3.9/site-packages/ansible/modules/dnf.py", line 620, in _base
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 300, in init_plugins
self._plugins._load(self.conf, disabled_glob, enable_plugins)
File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 131, in _load
raise RuntimeError("load_plugins() called twice")
RuntimeError: load_plugins() called twice
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1 |
This could be solved by calling into |
I've locally patched dnf.py in ansible to call _unload() just before the call to |
@moreati The ansible project appears to be unwilling to fix this on their end. |
thank you, I don't think this will make it into the next release candidate. Possibly the one after. |
Hi, I can confirm this on 3 centos8 and a rhel8. |
Another confirmation for CentOS8 |
As workaround I added the following to the task:
Example:
|
@Madic- workaround works for me too. |
I can confirm this bug for Oracle Linux 8. Mitogen 0.3.0-rc1 and ansible-base 2.10.5. |
I've reproduced this in https://github.com/moreati/mitogen/tree/issue776, after checking out the branch you can use Tox to run these tests, e.g.
|
Adding
|
@annttu yep, I could confirm that it works with RHEL8/Python3 and Ansible 2.10 . thanks for sharing this fix! guys could you somehow release the fix even as an unofficial version? right now I need to reference fork in my build but it just would be nice to reference your awesome project ;) btw maybe this |
Can confirm this fixes it on Ansible 2.10.7 on MacOS as well, for both |
If you want to easily install the PR #845 that contains this fix without manually patching, you can run something like: |
if you look at the |
Hello, this is a must have! |
When using the
package
module with the latest RC (as well as latest commit on master branch) of Mitogen for Ansible 2.10.5, I am receiving an exception;However, using the individual modules works fine;
Which version of Ansible are you running?
Ansible 2.10.5
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?
Running v0.3.0-rc.0
Do you have some idea of what the underlying problem may be?
Mention your host and target OS and versions
Red Hat Enterprise Linux release 8.3 (Ootpa)
Mention your host and target Python versions
EDIT (AW): Formatted error and traceback
The text was updated successfully, but these errors were encountered: