Juniper / ansible-junos-stdlib

Junos modules for Ansible
Apache License 2.0
303 stars 157 forks source link

"module_stderr": "No handlers could be found for logger #360

Closed farhadkam closed 6 years ago

farhadkam commented 6 years ago

Can you please check this error and tell me how to fix this? Thank you!

My ansible-host file:

[all:vars]
ansible_python_interpreter=/Library/Frameworks/Python.framework/Versions/2.7/bin/python

[Juniper]
core001 ansible_host=cor-001.aaaa.com

and my playbook:

---
- name: simpletest
  hosts: Juniper
  connection: local
  gather_facts: no
  roles:
    - Juniper.junos
  tasks:
    - debug:
        msg: "{{ ansible_host }}"
    - junos_get_facts:
        host:  "{{ ansible_host }}"
        user: user
        passwd: password

But I am getting this error:

fatal: [core001]: FAILED! => {
    "changed": false, 
    "module_stderr": "No handlers could be found for logger \"ncclient.transport.session\"\nTraceback (most recent call last):\n  File 
\"/var/folders/tj/hycb0kl92xzfv9cmnqyhky9d_63sjc/T/ansible_8Zs8fS/ansible_module_junos_get_fact
s.py\", line 383, in <module>\n    main()\n  File 
\"/var/folders/tj/hycb0kl92xzfv9cmnqyhky9d_63sjc/T/ansible_8Zs8fS/ansible_module_junos_get_fact
s.py\", line 344, in main\n    facts = get_facts_dict(junos_module)\n  File 
\"/var/folders/tj/hycb0kl92xzfv9cmnqyhky9d_63sjc/T/ansible_8Zs8fS/ansible_module_junos_get_fact
s.py\", line 250, in get_facts_dict\n    facts['version_info'] = dict(facts['version_info'])\nTypeError: 'NoneType' object is not iterable\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 1

Thanks.

stacywsmith commented 6 years ago

As requested over in the Google group, can you please add the output of show version from the target Junos device where you're seeing this error?

farhadkam commented 6 years ago

Hi Stacy,

please check the show version below:

Hostname: core001
Model: mx480
Junos: 14.2R8.4
JUNOS Base OS boot [14.2R8.4]
JUNOS Base OS Software Suite [14.2R8.4]
JUNOS platform Software Suite [14.2R8.4]
JUNOS Web Management [14.2R8.4]
JUNOS Runtime Software Suite [14.2R8.4]
JUNOS Online Documentation [14.2R8.4]
JUNOS Services AACL Container package [14.2R8.4]
JUNOS Services Application Level Gateways [14.2R8.4]
JUNOS AppId Services [14.2R8.4]
JUNOS Border Gateway Function package [14.2R8.4]
JUNOS Services COS [14.2R8.4]
JUNOS Services Captive Portal and Content Delivery Container package [14.2R8.4]
JUNOS Services HTTP Content Management package [14.2R8.4]
JUNOS IDP Services [14.2R8.4]
JUNOS Services Jflow Container package [14.2R8.4]
JUNOS Services LL-PDF Container package [14.2R8.4]
JUNOS Services MobileNext Software package [14.2R8.4]
JUNOS Services Mobile Subscriber Service Container package [14.2R8.4]
JUNOS Services PTSP Container package [14.2R8.4]
JUNOS Services NAT [14.2R8.4]
JUNOS Services RPM [14.2R8.4]
JUNOS Services Stateful Firewall [14.2R8.4]
JUNOS Voice Services Container package [14.2R8.4]
JUNOS Macsec Software Suite [14.2R8.4]
JUNOS Services Crypto [14.2R8.4]
JUNOS Services SSL [14.2R8.4]
JUNOS Services IPSec [14.2R8.4]
JUNOS py-base-i386 [14.2R8.4]
JUNOS 64-bit Kernel Software Suite [14.2R8.4]
JUNOS Crypto Software Suite [14.2R8.4]
JUNOS 64-bit Runtime Software Suite [14.2R8.4]
JUNOS Packet Forwarding Engine Support (M/T/EX Common) [14.2R8.4]
JUNOS Packet Forwarding Engine Support (MX Common) [14.2R8.4]
JUNOS Routing Software Suite [14.2R8.4]
JUNOS 64-bit JAM Plugin Software Suite (MPC2E/3E) [14.2R8.4-C1.3]
stacywsmith commented 6 years ago
JUNOS 64-bit JAM Plugin Software Suite (MPC2E/3E) [14.2R8.4-C1.3]

I suspect you might be hitting Juniper/py-junos-eznc#651

farhadkam commented 6 years ago

Is there any work around to fix it?

farhadkam commented 6 years ago

Update: I hve reinstalled everything but still getting the same error.

farhadkam commented 6 years ago

Stacy,

Do you know if there is any way to fix this?

stacywsmith commented 6 years ago

I submitted pull request #361 which should allow the junos_get_facts module to run without crashing in this case. Although you'll still end up with empty version-related facts until Juniper/py-junos-eznc#651 is also fixed.

vnitinv commented 6 years ago

Closing the issue, as the fix gone in PyEZ. Will be released in next version. For now can be installed from git.

farhadkam commented 6 years ago

Hi Nitin, Can you please advise what to do to fix this as per your earlier email?(what should I update and Any links how to do it?)

Regards, Farhad

On 7 May 2018, at 4:13 pm, Nitin Kr notifications@github.com<mailto:notifications@github.com> wrote:

[External Email]

Closing the issue, as the fix gone in PyEZ. Will be released in next version. For now can be installed from git.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Juniper_ansible-2Djunos-2Dstdlib_issues_360-23issuecomment-2D386967318&d=DwMCaQ&c=Zok6nrOF6Fe0JtVEqKh3FEeUbToa1PtNBZf6G01cvEQ&r=S4HxSIKfKaLNfwoNNLQ4YZMD8wZ10DemnxHhiPMHiMQ&m=igYY1XMuJjzwC0UPp8AEc9VY5KOBYTCP0qBdeb53E5k&s=njGGmy9zwQncVBlFqT1F1fDU9B4wQB8QgbUMqi0bCEE&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AkwjmWxViXQHxj0z5oJYwXPmMmjojROZks5tv-2DYFgaJpZM4Tn0yZ&d=DwMCaQ&c=Zok6nrOF6Fe0JtVEqKh3FEeUbToa1PtNBZf6G01cvEQ&r=S4HxSIKfKaLNfwoNNLQ4YZMD8wZ10DemnxHhiPMHiMQ&m=igYY1XMuJjzwC0UPp8AEc9VY5KOBYTCP0qBdeb53E5k&s=9jug5sq9e458qbXUJX-O7gCl001nc2c6q8VLjWO1XbM&e=.