lxml.etree.XMLSyntaxError: Start tag expected, '<' not found

Posted on

This is failing on python3.6 however works when

interpreter_python = /usr/bin/python2.7

Setup:

ansible 2.9.13
config file = /var/lib/awx/projects/services-ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Dec 5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Package Version


ansible 2.9.13
asn1crypto 0.24.0
Babel 2.5.1
bcrypt 3.1.6
beautifulsoup4 4.6.3
cffi 1.11.5
chardet 3.0.4
click 6.7
colorama 0.4.3
configobj 5.0.6
cryptography 2.3
cssselect 0.9.2
dbus-python 1.2.4
decorator 4.2.1
ethtool 0.14
file-magic 0.3.0
gpg 1.10.0
html5lib 0.999999999
idna 2.5
iniparse 0.4
insights-client 3.0.13
install 1.3.4
isc 2.0
Jinja2 2.11.2
jmespath 0.9.0
jxmlease 1.0.3
lxml 4.2.3
MarkupSafe 1.1.1
ncclient 0.6.9
netifaces 0.10.6
nftables 0.1
packaging 20.4
paramiko 2.4.3
pciutils 2.3.6
perf 0.1
pip 20.2.3
ply 3.9
psutil 5.7.2
psycopg2 2.7.5
pyasn1 0.3.7
pycairo 1.16.3
pycparser 2.14
pygobject 3.28.3
pyinotify 0.9.6
PyNaCl 1.4.0
pyOpenSSL 18.0.0
pyparsing 2.4.7
PySocks 1.6.8
python-dateutil 2.6.1
python-dmidecode 3.12.2
python-linux-procfs 0.6
pytz 2017.2
pyudev 0.21.0
PyYAML 3.12
requests 2.20.0
rhnlib 2.8.6
rpm 4.14.2
schedutils 0.6
selinux 2.9
sepolicy 1.1
setools 4.2.2
setroubleshoot 1.1
setuptools 39.2.0
six 1.11.0
slip 0.6.4
slip.dbus 0.6.4
sos 3.8
SSSDConfig 2.2.3
subscription-manager 1.26.20
syspurpose 1.26.20
systemd-python 234
twill 2.0.1
urllib3 1.24.2
webencodings 0.5.1
xmltodict 0.12.0

Updating Subscription Management repositories.
Last metadata expiration check: 0:50:21 ago on Thu 01 Oct 2020 08:16:09 PM EDT.
Installed Packages
ansible.noarch 2.9.13-1.el8 @epel

The full traceback is:
Traceback (most recent call last):

344

<?xml version="1.0" encoding="UTF-8"?>

212

<NodeID/>
<Name/>

#

2020-10-01 21:00:05,374 p=878303 u=root n=ncclient.transport.ssh | [host 10.212.12.16 session-id 174] Received message from host
2020-10-01 21:00:05,375 p=878303 u=root n=ansible | jsonrpc response: {"jsonrpc": "2.0", "id": "e5f610aa-b00b-4740-a008-fac40ed76744", "result": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>212e9fa6779-c667-4733-8db2-61f904b8205eaj08025933-upf-31uab48b157-fd08-46af-9355-5384e90979b4ak18000735-leaf-29u1c6e769f-02f0-41f7-a0f5-957d54d6e788controller-1"}
2020-10-01 21:00:05,395 p=878419 u=root n=ansible | <10.212.12.16> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/ > /dev/null 2>&1 && sleep 0'
2020-10-01 21:00:05,408 p=878290 u=root n=ansible | The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py", line 102, in
ansiballz_main()
File "/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.network.netconf.netconf_rpc', init_globals=None, run_name='main', alter_sys=True)
File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/modules/network/netconf/netconf_rpc.py", line 264, in
File "/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/modules/network/netconf/netconf_rpc.py", line 246, in main
File "/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/module_utils/network/common/netconf.py", line 141, in remove_namespaces
File "/usr/local/lib/python3.6/site-packages/ncclient/xml
.py", line 174, in init
self.__doc = self.remove_namespaces(self.__result)
File "/usr/local/lib/python3.6/site-packages/ncclient/xml_.py", line 222, in remove_namespaces
parser=self.__parser))),
File "src/lxml/etree.pyx", line 3426, in lxml.etree.parse
File "src/lxml/parser.pxi", line 1857, in lxml.etree._parseDocument
File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1758, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc
File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
File "", line 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

2020-10-01 21:00:05,408 p=878290 u=root n=ansible | fatal: [10.212.12.16]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py\", line 102, in \n ansiballz_main()\n File \"/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-local-878290k3k87u9h/ansible-tmp-1601600404.6218197-878419-186552684559172/AnsiballZ_netconf_rpc.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.network.netconf.netconf_rpc', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/modules/network/netconf/netconf_rpc.py\", line 264, in \n File \"/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/modules/network/netconf/netconf_rpc.py\", line 246, in main\n File \"/tmp/ansible_netconf_rpc_payload_yffyg1oq/ansible_netconf_rpc_payload.zip/ansible/module_utils/network/common/netconf.py\", line 141, in remove_namespaces\n File \"/usr/local/lib/python3.6/site-packages/ncclient/xml.py\", line 174, in init\n self.__doc = self.remove_namespaces(self.__result)\n File \"/usr/local/lib/python3.6/site-packages/ncclient/xml_.py\", line 222, in remove_namespaces\n parser=self.__parser))),\n File \"src/lxml/etree.pyx\", line 3426, in lxml.etree.parse\n File \"src/lxml/parser.pxi\", line 1857, in lxml.etree._parseDocument\n File \"src/lxml/parser.pxi\", line 1877, in lxml.etree._parseMemoryDocument\n File \"src/lxml/parser.pxi\", line 1758, in lxml.etree._parseDoc\n File \"src/lxml/parser.pxi\", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc\n File \"src/lxml/parser.pxi\", line 601, in lxml.etree._ParserContext._handleParseResultDoc\n File \"src/lxml/parser.pxi\", line 711, in lxml.etree._handleParseResult\n File \"src/lxml/parser.pxi\", line 640, in lxml.etree._raiseParseError\n File \"\", line 1\nlxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1