question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JuniperJunosModule' object has no attribute '_pyez_conn'

See original GitHub issue

Issue Type

  • Bug Report

Module Name

facts

juniper.device collection and Python libraries version (python3-venv) [ac043s@sdnautosr12 juniper]$ pip list Package Version


ansible 4.2.0 ansible-core 2.11.2 bcrypt 3.2.0 cffi 1.14.5 colorama 0.4.4 configparser 5.0.2 cryptography 3.4.7 future 0.18.2 icdiff 1.9.1 Jinja2 3.0.1 jsnapy 1.3.6 junos-eznc 2.6.1 jxmlease 1.0.3 lxml 4.6.3 MarkupSafe 2.0.1 ncclient 0.6.9 netaddr 0.8.0 netmiko 3.4.0 ntc-templates 2.1.0 packaging 21.0 paramiko 2.7.2 pip 21.1.3 pycparser 2.20 PyNaCl 1.4.0 pyparsing 2.4.7 pyserial 3.5 PyYAML 5.4.1 resolvelib 0.5.4 scp 0.13.5 setuptools 41.6.0 six 1.16.0 tenacity 7.0.0 textfsm 1.1.2 transitions 0.8.8 xmltodict 0.12.0 yamlordereddictloader 0.4.0 (python3-venv) [ac043s@sdnautosr12 juniper]$

OS / Environment Porter 3

Summary Connection not happening new ansible 4.2.0

(python3-venv) [ac043s@sdnautosr12 juniper]$ python Python 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] on linux Type “help”, “copyright”, “credits” or “license” for more information.

Playbook `—

  • name: Install Junos OS hosts: porter3 connection: juniper.device.pyez gather_facts: no collections:

    • juniper.device

    vars: OS_version: “21.1R1-S1.1” OS_package: “jinstall-host-nfx-3-x86-64-21.1R1-S1.1-secure-signed.tgz” pkg_dir: “{{ lookup(‘env’, ‘HOME’) }}/images” log_dir: “{{ lookup(‘env’, ‘HOME’) }}/log” netconf_port: 830 wait_time: 3600 ansible_python_interpreter: “{{ lookup(‘env’, ‘HOME’) }}/python3-venv/bin/python”

    tasks:

    • name: Checking NETCONF connectivity wait_for: host: “{{ inventory_hostname }}” port: “{{ netconf_port }}” timeout: 5

    • name: Get device facts facts: `

Verbose output of the Error

TASK [Get device facts] *************************************************************************************************************************************************************************************** task path: /home/ac043s/software_sdnautos02/ansible_development/juniper/porter3upgrade.yml:25 redirecting (type: connection) ansible.builtin.netconf to ansible.netcommon.netconf Loading collection ansible.netcommon from /home/ac043s/python3-venv/lib64/python3.8/site-packages/ansible_collections/ansible/netcommon redirecting (type: netconf) ansible.builtin.junos to junipernetworks.junos.junos Loading collection junipernetworks.junos from /home/ac043s/python3-venv/lib64/python3.8/site-packages/ansible_collections/junipernetworks/junos <ptr74-jdm> attempting to start connection <ptr74-jdm> using connection plugin ansible.netcommon.netconf Found ansible-connection at path /home/ac043s/python3-venv/bin/ansible-connection <ptr74-jdm> found existing local domain socket, using it! <ptr74-jdm> <ptr74-jdm> local domain socket path is /home/ac043s/.ansible/pc/5ecf442b60 <ptr74-jdm> ESTABLISH LOCAL CONNECTION FOR USER: ac043s <ptr74-jdm> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363”&& mkdir “echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870” && echo ansible-tmp-1625602138.1041296-29252-272465699950870=“echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870” ) && sleep 0’ Using module file /home/ac043s/.ansible/collections/ansible_collections/juniper/device/plugins/modules/facts.py <ptr74-jdm> PUT /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/tmpggveq12s TO /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py <ptr74-jdm> EXEC /bin/sh -c ‘chmod u+x /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/ /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py && sleep 0’ <ptr74-jdm> EXEC /bin/sh -c ‘/home/ac043s/python3-venv/bin/python /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py && sleep 0’ <ptr74-jdm> EXEC /bin/sh -c ‘rm -f -r /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/ > /dev/null 2>&1 && sleep 0’ The full traceback is: Traceback (most recent call last): File “/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py”, line 100, in <module> _ansiballz_main() File “/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py”, line 92, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File “/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py”, line 40, 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.8/runpy.py”, line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File “/usr/lib64/python3.8/runpy.py”, line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File “/usr/lib64/python3.8/runpy.py”, line 87, in _run_code exec(code, run_globals) File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py”, line 369, in <module> File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py”, line 311, in main File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py”, line 611, in init File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py”, line 686, in get_connection File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py”, line 722, in fail_json File “/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py”, line 1164, in close_configuration AttributeError: ‘JuniperJunosModule’ object has no attribute ‘_pyez_conn’ fatal: [ptr74-jdm]: FAILED! => { “changed”: false, “module_stderr”: “Traceback (most recent call last):\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 100, in <module>\n _ansiballz_main()\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 40, 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.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 369, in <module>\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 311, in main\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 611, in init\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 686, in get_connection\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 722, in fail_json\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 1164, 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 }

PLAY RECAP **************************************************************************************************************************************************************************************************** ptr74-jdm : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
`

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
webtrotercommented, Oct 14, 2021

Doesn’t seem fixed. I’m running juniper.device -> 1.0.1 line 1172, in close_configuration\nAttributeError: 'JuniperJunosModule' object has no attribute '_pyez_conn'

0reactions
smeego78commented, Dec 22, 2022

Hi is there any update with this? Have the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'JuniperJunosModule' object has no attribute 'conn_type ...
Well and when I execute this playbook, I keep getting a AttributeError: 'JuniperJunosModule' object has no attribute 'conn_type'.
Read more >
'JuniperJunosModule' object has no attribute 'conn_type'
The error was: AttributeError: 'JuniperJunosModule' object has no attribute 'conn_type'.
Read more >
Ansible for Junos OS Developer Guide - Juniper Networks
During execution of a juniper.device or Juniper.junos module, the Ansible ... AttributeError: 'JuniperJunosModule' object has no attribute 'conn_type' ...
Read more >
[ansible-project] Need Help! JuniperJunosModule' object has ...
The error was: AttributeError: 'JuniperJunosModule' object has no > attribute '_pyez_conn' > fatal: [vMX]: FAILED!
Read more >
AttributeError: 'Service' object has no attribute 'enabled'
Overcloud deploy fails in task : Create identity service fails with AttributeError: 'Service' object has no attribute 'enabled' We are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found