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.

Juniper.junos 2.0.2 Error

See original GitHub issue

Issue Type

  • Bug Report

Module Name

Juniper.Junos role and Python libraries version

Juniper.junos version 2.0.2

juniper_junos_command and juniper_junos_config

Python 2.7.5

ansible 2.5.1

pip freeze
ansible==2.5.1
asn1crypto==0.24.0
backports.ssl-match-hostname==3.4.0.2
bcrypt==3.1.4
bigsuds==1.0.1
cffi==1.11.5
chardet==2.2.1
colorama==0.3.9
configobj==4.7.2
configparser==3.5.0
cryptography==2.2.2
decorator==3.4.0
enum34==1.1.6
ethtool==0.8
f5-icontrol-rest==1.3.8
f5-sdk==3.0.14
future==0.16.0
icdiff==1.9.1
idna==2.6
iniparse==0.4
ipaddress==1.0.22
isoparser==0.3
Jinja2==2.10
jsnapy==1.3.1
junos-eznc==2.1.7
junos-netconify==1.0.2
jxmlease==1.0.1
kitchen==1.1.1
langtable==0.0.31
lxml==4.2.1
M2Crypto==0.21.1
Magic-file-extensions==0.2
MarkupSafe==1.0
ncclient==0.5.3
netaddr==0.7.19
paramiko==2.4.1
pciutils==1.7.3
perf==0.1
pexpect==4.5.0
ptyprocess==0.5.2
pyasn1==0.4.2
pycontrol==2.1
pycparser==2.18
pycrypt==0.7.2
pycurl==7.19.0
pygobject==3.14.0
pygpgme==0.3
pyliblzma==0.5.3
PyNaCl==1.2.1
pyOpenSSL==0.13.1
pyparsing==1.5.6
pyserial==3.4
python-augeas==0.5.0
python-dateutil==1.5
python-dmidecode==3.10.13
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.12
redhat-access-insights==1.0.6
requests==2.6.0
rhnlib==2.5.65
rhsm==1.15.4
scp==0.10.2
six==1.9.0
slip==0.4.0
slip.dbus==0.4.0
suds==0.4
suds-jurko==0.6
urlgrabber==3.10
urllib3==1.10.2
virtualenv==15.2.0
whois==0.7
yum-langpacks==0.4.2
yum-metadata-parser==1.1.4

Juniper.junos 2.0.2

OS / Environment

Model: vsrx
Junos: 15.1X49-D100.6
JUNOS Software Release [15.1X49-D100.6]

Summary

After installing Juniper.junos 2.0.2, when running modules such as juniper_junos_command or juniper_junos_config, I get: ERROR! Unexpected Exception, this is probably a bug: name 'juniper_junos_common_action' is not defined

Steps to reproduce

ansible$ ansible-playbook mop_base_config_oam.yml --tags license_test -vvv
ansible-playbook 2.5.1
  config file = /tftpboot/vSRX/ansible/ansible.cfg
  configured module search path = [u'/tftpboot/vSRX/ansible/.plugins/action']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
Using /tftpboot/vSRX/ansible/ansible.cfg as config file
Parsed /tftpboot/vSRX/ansible/inventory/dynamic_inventory.py inventory source with script plugin
statically imported: /tftpboot/vSRX/ansible/roles/vSRX/tasks/junos_licenseT.yml

PLAYBOOK: mop_base_config_oam.yml ********************************************************************
2 plays in mop_base_config_oam.yml
Enter your username: test
Enter your password: 
confirm Enter your password: 

PLAY [vSRX Base Configuration] ***********************************************************************
ERROR! Unexpected Exception, this is probably a bug: name 'juniper_junos_common_action' is not defined
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 118, in <module>
    exit_code = cli.run()
  File "/usr/lib/python2.7/site-packages/ansible/cli/playbook.py", line 122, in run
    results = pbex.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 159, in run
    result = self._tqm.run(play=play)
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 290, in run
    play_return = strategy.run(iterator, play_context)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.py", line 217, in run
    action = action_loader.get(task.action, class_only=True)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 366, in get
    self._module_cache[path] = self._load_module_source(name, path)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 345, in _load_module_source
    module = imp.load_source(full_name, path, module_file)
  File "/tftpboot/vSRX/ansible/roles/Juniper.junos/action_plugins/juniper_junos_command.py", line 1, in <module>
    juniper_junos_common_action.py
NameError: name 'juniper_junos_common_action' is not defined


- name: "Run show system license command and capture output"
  juniper_junos_command:
    host: "{{IP_Address}}" 
    user: "{{username}}"
    passwd: "{{ passwd }}"
    port: 22
    timeout: "{{timer_license}}"
    commands: "show system license"
    dest: "{{current_dir}}/{{Hostname}}_license"

Expected results


Actual results


Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adolphsonscommented, Jun 5, 2018

Thank you stacywsmith for the directions. I did have it installed using the ansible-galaxy install Juniper.junos command but when I copied it over to a custom roles directory, I did not notice the symlinks. So I did a “cp -P <Juniper.junos directory>” and all is well.

0reactions
stacywsmithcommented, Jun 5, 2018

The role is not installed correctly. Most of the files in <role_dir>/Juniper.junos/action_plugins/ should be soft links to <role_dir>/Juniper.junos/action_plugins/juniper_junos_common_action.py.

You really need to follow the installation instructions

Read more comments on GitHub >

github_iconTop Results From Across the Web

upgrade from 20.4R2-S2.2 to 21.1 | Junos OS
You see this message because there was an upgrade in the Kernel-Space below JunOS (BSD-Upgrade) :) And since an older Version cannot correctly ......
Read more >
Troubleshooting Network Issues | Junos OS - Juniper Networks
This checklist provides links to troubleshooting basics, an example network, and includes a summary of the commands you might use to diagnose problems...
Read more >
Verifying That the Port Error Disable Setting Is Working Correctly
Verify that the port error disable setting is working as expected for MAC limited, MAC move limited, and rate-limited interfaces on an EX...
Read more >
Recovery of Junos OS - Juniper Networks
In case of failed software installation or a failure after installing Junos OS, such as the CLI not working, you can recover the...
Read more >
error | Junos OS | Juniper Networks
Options · fatal —Fatal error on the FPC. An error that results in the blockage of a considerable amount of traffic across modules...
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