1

We have been using AWX Tower for quite some time now and without any issues but recently we started receiving this error when executing the yum module against all the hosts that we have (30+).

{
  "module_stdout": "/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\r\nTraceback (most recent call last):\r\n  File \"/home/dev/.ansible/tmp/ansible-tmp-1660720864.9922137-51-274548421751601/AnsiballZ_yum.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/dev/.ansible/tmp/ansible-tmp-1660720864.9922137-51-274548421751601/AnsiballZ_yum.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/_dev/.ansible/tmp/ansible-tmp-1660720864.9922137-51-274548421751601/AnsiballZ_yum.py\", line 48, in invoke_module\r\n    run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r\n    fname, loader, pkg_name)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\r\n    mod_name, mod_fname, mod_loader, pkg_name)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/tmp/ansible_ansible.legacy.yum_payload_F8Z41z/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 400, in <module>\r\n  File \"/tmp/ansible_ansible.legacy.yum_payload_F8Z41z/ansible_ansible.legacy.yum_payload.zip/ansible/module_utils/urls.py\", line 115, in <module>\r\n  File \"/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py\", line 46, in <module>\r\n    import OpenSSL.SSL\r\n  File \"/usr/lib/python2.7/site-packages/OpenSSL/__init__.py\", line 8, in <module>\r\n    from OpenSSL import crypto, SSL\r\n  File \"/usr/lib/python2.7/site-packages/OpenSSL/crypto.py\", line 15, in <module>\r\n    from OpenSSL._util import (\r\n  File \"/usr/lib/python2.7/site-packages/OpenSSL/_util.py\", line 152, in <module>\r\n    with ffi.from_buffer(b\"\"):\r\nTypeError: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object\r\n",
  "module_stderr": "Shared connection to 10.60.24.54 closed.\r\n",
  "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
  "rc": 1,
  "_ansible_no_log": false,
  "changed": false
}

AWX Tower is version 21.1.0 and I can confirm that python2 and pyton3 are installed on the target hosts. I have also made sure that all the systems are updated with the latest updates.

Edit 1: After removing the python-cryptography yum package via yum remove at first it seemed that the issue was resolved but upon the next invocation of the yum module the issue reappeared.

Dimitar Dimov
  • 91
  • 2
  • 7
  • According the error the more meaningful message to proceed further with is `OpenSSL/_util.py\", line 152, in \r\n with ffi.from_buffer(b\"\"):\r\nTypeError: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object`. – U880D Aug 17 '22 at 19:04

1 Answers1

1

Got it working. The issue was in the OpenSSL and pyopenssl modules. The way I got it working is by executing these commands on the target machine and not the AWX host:

rm -rf /usr/local/lib/python3.5/dist-packages/OpenSSL/

pip3 uninstall pyopenssl

easy_install pyopenssl
Dimitar Dimov
  • 91
  • 2
  • 7