# Tracebacks attempting to collect facts from Juniper ACX-7100-32C device with the juniper.device collection

**URL:** <https://forum.ansible.com/t/tracebacks-attempting-to-collect-facts-from-juniper-acx-7100-32c-device-with-the-juniper-device-collection/7920>\
**Category:** Get Help\
**Created:** [August 18, 2024, 4:44pm UTC](https://forum.ansible.com/t/tracebacks-attempting-to-collect-facts-from-juniper-acx-7100-32c-device-with-the-juniper-device-collection/7920 "2024-08-18T16:44:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ansible\_Ed](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Ansible\_Ed](https://forum.ansible.com/u/Ansible_Ed)\
**Post date:** [August 18, 2024, 4:44pm UTC](https://forum.ansible.com/t/tracebacks-attempting-to-collect-facts-from-juniper-acx-7100-32c-device-with-the-juniper-device-collection/7920/1 "2024-08-18T16:44:35Z")

</div>

I believe I’ve done most the initial troubleshooting including things like making sure the junos.device collection is installed as well as the pre-requisites like junos-eznc, ncclient, lxml. I am using netconf as the connection type. I tried ssh and had other errors (errors trying to sftp/scp to the device.) As I understand it netconf is the correct path forward for this collection.

I have verified with local scripts that both netconf and pyez function with the devices.

## This is my playbook:

- name: Test NETCONF connectivity with Juniper device  
hosts: juniper  
gather\_facts: no  
collections:
  - juniper.device  
tasks:
  - name: Gather basic facts  
juniper.device.facts:

This is my group\_)vars/juniper.yml:

# group\_vars/juniper.yml

ansible\_user: [censored]  
ansible\_password:[censored]  
ansible\_connection: netconf  
ansible\_network\_os: junos

The versions I am running are:  
ansible [core 2.14.14]  
python version = 3.9.18 (main, Jul 3 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)  
jinja version = 3.1.2  
libyaml = True  
ansible --version  
ansible [core 2.14.14]  
python version = 3.9.18 (main, Jul 3 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)  
jinja version = 3.1.2  
libyaml = True

pip show junos-eznc  
Name: junos-eznc  
Version: 2.7.1

ansible-galaxy collection list | grep juniper.device  
juniper.device 1.0.5

I get far along but then I have the following traceback and then I’m stuc as it appears that there is some compatibility issue perhaps, unless I’m missing something. Any ideas would be appreciated.

\<[jnboar1e-er01.diamondstatenetworks.com](http://jnboar1e-er01.diamondstatenetworks.com)\> EXEC /bin/sh -c ‘rm -f -r /home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/ \> /dev/null 2\>&1 && sleep 0’  
114111 1723998872.74582: opening command with Popen()  
114111 1723998872.75711: done running command with Popen()  
114111 1723998872.75721: getting output with communicate()  
114111 1723998872.75820: done communicating  
114111 1723998872.75823: done with local.exec\_command()  
114111 1723998872.75830: \_low\_level\_execute\_command() done: rc=0, stdout=, stderr=  
114111 1723998872.75839: handler run complete  
114111 1723998872.75865: attempt loop complete, returning result  
114111 1723998872.75869: \_execute() done  
114111 1723998872.75870: dumping result to json  
114111 1723998872.75872: done dumping result, returning  
114111 1723998872.75880: done running TaskExecutor() for JNBOAR1E-ER01/TASK: Gather basic facts [1391337c-df50-fd05-b665-000000000004]  
114111 1723998872.75882: sending task result for task 1391337c-df50-fd05-b665-000000000004  
114111 1723998872.75907: done sending task result for task 1391337c-df50-fd05-b665-000000000004  
114111 1723998872.75908: WORKER PROCESS EXITING  
114107 1723998872.76075: marking JNBOAR1E-ER01 as failed  
114107 1723998872.76085: marking host JNBOAR1E-ER01 failed, current state: HOST STATE: block=2, task=1, rescue=0, always=0, handlers=0, run\_state=IteratingStates.TASKS, fail\_state=FailedStates.NONE, pre\_flushing\_run\_state=IteratingStates.TASKS, update\_handlers=True, pending\_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False  
114107 1723998872.76092: ^ failed state is now: HOST STATE: block=2, task=1, rescue=0, always=0, handlers=0, run\_state=IteratingStates.COMPLETE, fail\_state=FailedStates.TASKS, pre\_flushing\_run\_state=IteratingStates.TASKS, update\_handlers=True, pending\_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False  
114107 1723998872.76095: getting the next task for host JNBOAR1E-ER01  
114107 1723998872.76097: host JNBOAR1E-ER01 is done iterating, returning  
The full traceback is:  
Traceback (most recent call last):  
File “/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py”, line 107, in   
\_ansiballz\_main()  
File “/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py”, line 99, in \_ansiballz\_main  
invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)  
File “/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py”, line 47, in invoke\_module  
runpy.run\_module(mod\_name=‘ansible\_collections.juniper.device.plugins.modules.facts’, init\_globals=dict(\_module\_fqn=‘ansible\_collections.juniper.device.plugins.modules.facts’, \_modlib\_path=modlib\_path),  
File “/usr/lib64/python3.9/runpy.py”, line 225, in run\_module  
return \_run\_module\_code(code, init\_globals, run\_name, mod\_spec)  
File “/usr/lib64/python3.9/runpy.py”, line 97, in \_run\_module\_code  
\_run\_code(code, mod\_globals, init\_globals,  
File “/usr/lib64/python3.9/runpy.py”, line 87, in \_run\_code  
exec(code, run\_globals)  
File “/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/modules/facts.py”, line 367, in   
File “/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/modules/facts.py”, line 309, in main  
File “/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py”, line 610, in **init**  
File “/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py”, line 742, in fail\_json  
File “/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py”, line 1213, in close\_configuration  
AttributeError: ‘JuniperJunosModule’ object has no attribute ‘\_pyez\_conn’  
fatal: [JNBOAR1E-ER01]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “Traceback (most recent call last):\n File "/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py", line 107, in \n \_ansiballz\_main()\n File "/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py", line 99, in \_ansiballz\_main\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\n File "/home/emallette/.ansible/tmp/ansible-local-1141073e3fj7b5/ansible-tmp-1723998872.0815227-114111-248625022669254/AnsiballZ\_facts.py", line 47, in invoke\_module\n runpy.run\_module(mod\_name=‘ansible\_collections.juniper.device.plugins.modules.facts’, init\_globals=dict(\_module\_fqn=‘ansible\_collections.juniper.device.plugins.modules.facts’, \_modlib\_path=modlib\_path),\n File "/usr/lib64/python3.9/runpy.py", line 225, in run\_module\n return \_run\_module\_code(code, init\_globals, run\_name, mod\_spec)\n File "/usr/lib64/python3.9/runpy.py", line 97, in \_run\_module\_code\n \_run\_code(code, mod\_globals, init\_globals,\n File "/usr/lib64/python3.9/runpy.py", line 87, in \_run\_code\n exec(code, run\_globals)\n File "/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/modules/facts.py", line 367, in \n File "/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/modules/facts.py", line 309, in main\n File "/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py", line 610, in **init** \n File "/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py", line 742, in fail\_json\n File "/tmp/ansible\_juniper.device.facts\_payload\_2p1rz62s/ansible\_juniper.device.facts\_payload.zip/ansible\_collections/juniper/device/plugins/module\_utils/juniper\_junos\_common.py", line 1213, in close\_configuration\nAttributeError: ‘JuniperJunosModule’ object has no attribute ‘\_pyez\_conn’\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}
