The following modules failed to execute: setup

134 views
Skip to first unread message

Nagesh sheregar

unread,
Jul 20, 2020, 11:59:05 AM7/20/20
to Ansible Project
Hi Team,

did anyone face this issue, it was working fine but today  i am getting below error not sure what  happened:

fatal: [localhost]: FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "setup": {
            "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ_setup.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ_setup.py\", line 20, in _ansiballz_main\n    import tempfile\n  File \"/opt/rh/python27/root/usr/lib64/python2.7/tempfile.py\", line 32, in <module>\n    import io as _io\n  File \"/opt/rh/python27/root/usr/lib64/python2.7/io.py\", line 51, in <module>\n    import _io\nImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException\n",
            "failed": true,
            "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ_setup.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ_setup.py\", line 20, in _ansiballz_main\n    import tempfile\n  File \"/opt/rh/python27/root/usr/lib64/python2.7/tempfile.py\", line 32, in <module>\n    import io as _io\n  File \"/opt/rh/python27/root/usr/lib64/python2.7/io.py\", line 51, in <module>\n    import _io\nImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException\n",
            "module_stdout": "",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1
        }
    },
    "msg": "The following modules failed to execute: setup\n"
}

Matt Martz

unread,
Jul 20, 2020, 12:05:14 PM7/20/20
to ansible...@googlegroups.com
It sounds like you have a `_io.so` file that was compiled against a different python version, from that which is attempting to use it.

Using python from an SCL as your ansible_python_interpreter is not just an easy 1 and done, by using the correct path.  An SCL sets things like LD_LIBRARY_PATH and such when you enable it, that is not achieved by simply calling the binary in its place.

It looks like you are using `localhost`, which I will assume is "implicit localhost"[1] which automatically selects the python interpreter used by the playbook process, but since that work happens in a fork, I imagine it loses the SCL env vars required to use that SCL.

Overall, I'd probably recommend not using an SCL.  Otherwise, you are going to have to jump through some hoops that are going to require that you better understand what needs to be done.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a78635ad-4bae-4a07-b8c4-6ff0e88ff6beo%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

Nagesh sheregar

unread,
Jul 20, 2020, 12:19:12 PM7/20/20
to ansible...@googlegroups.com
Hi Matt,

i have enabled the scl python27 and it worked, is this not recommended  ?

scl enable python27 bash

i have installed the pip using below process:


Thanks and Regards
Nagesh  

Reply all
Reply to author
Forward
0 new messages