napalm proxy not starting

890 views
Skip to first unread message

Petre Bandac

unread,
Sep 15, 2017, 4:02:20 AM9/15/17
to salt-...@googlegroups.com
hello,

after installing the napalm proxy i am having troubles making it run;
it crashes with the error below, although the napalm libs are installed.

could you please point me in the right direction for further analysing
this issue ?

thanks,

petre

###


[DEBUG ] Unable to derive osmajorrelease from osrelease_info
'('proxy',)'. The osmajorrelease grain will not be set.
[WARNING ] /usr/lib/python2.7/site-packages/salt/proxy/dummy.py:22:
RuntimeWarning: tmpnam is a potential security risk to your program
FILENAME = os.tmpnam()

[DEBUG ] dummy proxy __virtual__() called...
[CRITICAL] fx2 proxy minion needs "racadm" to be installed.
[INFO ] nxos proxy __virtual__() called...
[DEBUG ] rest_sample proxy __virtual__() called...
[INFO ] ssh_sample proxy __virtual__() called...
[DEBUG ] Could not LazyLoad napalm.grains: 'napalm' __virtual__
returned False: Please install the NAPALM library: `pip install napalm`!
[ERROR ] Proxymodule napalm is missing an init() or a shutdown() or
both. Check your proxymodule. Salt-proxy aborted.
[INFO ] Proxy Minion Stopping the Salt ProxyMinion
[ERROR ] Proxymodule napalm is missing an init() or a shutdown() or
both. Check your proxymodule. Salt-proxy aborted.
[INFO ] Shutting down the Salt ProxyMinion
The Salt ProxyMinion is shutdown.
Proxymodule napalm is missing an init() or a shutdown() or both. Check
your proxymodule. Salt-proxy aborted.

--

/etc/salt/master

user: salt
file_roots:
base:
- /repo/salt/base
asx_olp:
- /repo/salt/asx_olp
pillar_roots:
base:
- /repo/salt/base/pillar
asx_olp:
- /repo/salt/asx_olp/pillar

--

/etc/salt/proxy.d/network.conf

master: localhost
multiprocessing: false
user: salt

--

/repo/salt/base/pillar/top.sls
base:
'sw1':
- sw1_pillar

--

/repo/salt/base/pillar/sw1_pillar.sls
proxy:
proxytype: napalm
driver: nxos
host: 192.168.100.21
username: admin
passwd: 12345




# pip2.7 list | grep napalm
DEPRECATION: The default format will switch to columns in the future.
You can use --format=(legacy|columns) (or define a
format=(legacy|columns) in your pip.conf under the [list] section) to
disable this warning.
napalm (1.2.0)
napalm-base (0.25.0)
napalm-eos (0.6.1)
napalm-fortios (0.4.0)
napalm-ios (0.7.0)
napalm-iosxr (0.5.4)
napalm-junos (0.12.0)
napalm-nxos (0.6.0)
napalm-panos (0.4.0)
napalm-pluribus (0.5.1)
napalm-ros (0.2.2)
napalm-vyos (0.1.3)

Mircea Ulinic

unread,
Sep 15, 2017, 4:44:40 AM9/15/17
to salt-...@googlegroups.com
Hi Petre,

[DEBUG   ] Could not LazyLoad napalm.grains: 'napalm' __virtual__ returned False: Please install the NAPALM library: `pip install napalm`!

This suggests you have an older version of the grains module.

[ERROR   ] Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule.  Salt-proxy aborted.
[INFO    ] Proxy Minion Stopping the Salt ProxyMinion
[ERROR   ] Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule.  Salt-proxy aborted.
[INFO    ] Shutting down the Salt ProxyMinion
The Salt ProxyMinion is shutdown.
Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule.  Salt-proxy aborted.

This one says that the napalm proxy module is missing.

Did you follow the notes from this section by any chance: https://github.com/napalm-automation/napalm-salt#legacy-napalm-salt-installation
Because you shouldn’t :-)
…Unless you really have some constraints to use older versions of Salt.
Otherwise, I recommend you to install Nitrogen (2017.7), without any extension modules (everything is available in the official code base).

Cheers,
-Mircea

Petre Bandac

unread,
Sep 15, 2017, 7:56:22 AM9/15/17
to salt-...@googlegroups.com
hi mircea,

no, i took the documentation from
https://github.com/napalm-automation/napalm-salt#install-napalm

# for i in libffi-dev libssl-dev python-dev python-cffi libxslt
python-pip; do rpm -qa | grep $i; done
libffi-devel-3.0.5-3.2.el6.x86_64
python-devel-2.6.6-64.el6.x86_64
python-cffi-0.6-5.el6.x86_64
libxslt-devel-1.1.26-2.el6_3.1.x86_64
libxslt-1.1.26-2.el6_3.1.x86_64
python-pip-7.1.0-1.el6.noarch

the rpms are there, the pip packages too (with pip2.7, because it's an
old machine and default python is 2.6) - it's true i did an ugly trick
and symlinked a few python2.6 modules to the 2.7 folder, but in my
opinion they shouldn't be relevant for our discussion (MySQLdb,
M2Crypto, pygit2)

below the output from salt -V

which module exactly have i missed (or should be upgraded) ?

thanks,

petre

###

Salt Version:
Salt: 2017.7.1

Dependency Versions:
cffi: 1.10.0
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8.1
libgit2: 0.20.0
libnacl: Not Installed
M2Crypto: 0.20.2
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.2.3c1
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.20.3
Python: 2.7.13 (default, Jul 12 2017, 17:32:34)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.5.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: redhat 6.7 Santiago
locale: UTF-8
machine: x86_64
release: 2.6.32-573.18.1.el6.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 6.7 Santiago

On 15.09.2017 10:44, 'Mircea Ulinic' via Salt-users wrote:
> Hi Petre,
>
>> [DEBUG ] Could not LazyLoad napalm.grains: 'napalm' __virtual__
>> returned False: Please install the NAPALM library: `pip install
>> napalm`!
>
> This suggests you have an older version of the grains module.
>
>> [ERROR ] Proxymodule napalm is missing an init() or a shutdown() or
>> both. Check your proxymodule. Salt-proxy aborted.
>> [INFO ] Proxy Minion Stopping the Salt ProxyMinion
>> [ERROR ] Proxymodule napalm is missing an init() or a shutdown() or
>> both. Check your proxymodule. Salt-proxy aborted.
>> [INFO ] Shutting down the Salt ProxyMinion
>> The Salt ProxyMinion is shutdown.
>> Proxymodule napalm is missing an init() or a shutdown() or both.
>> Check your proxymodule. Salt-proxy aborted.
>
> This one says that the napalm proxy module is missing.
>
> Did you follow the notes from this section by any chance:
>
> https://github.com/napalm-automation/napalm-salt#legacy-napalm-salt-installation
> [1]
> Because you shouldn’t :-)
> …Unless you really have some constraints to use older versions of
> Salt.
> Otherwise, I recommend you to install Nitrogen (2017.7), _without_
> any
> extension modules (everything is available in the official code
> base).
>
> Cheers,
> -Mircea
>
> --
> You received this message because you are subscribed to the Google
> Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to salt-users+...@googlegroups.com [2].
> To view this discussion on the web visit
>
> https://groups.google.com/d/msgid/salt-users/0235CA24-93A4-4F52-8943-06E3834CF0F6%40cloudflare.com
> [3].
> For more options, visit https://groups.google.com/d/optout [4].
>
>
> Links:
> ------
> [1]
>
> https://github.com/napalm-automation/napalm-salt#legacy-napalm-salt-installation
> [2] mailto:salt-users+...@googlegroups.com
> [3]
>
> https://groups.google.com/d/msgid/salt-users/0235CA24-93A4-4F52-8943-06E3834CF0F6%40cloudflare.com?utm_medium=email&utm_source=footer
> [4] https://groups.google.com/d/optout

--

Petre Bandac

Network Scientist

-

pe...@kgb.ro

Mircea Ulinic

unread,
Sep 15, 2017, 8:05:57 AM9/15/17
to salt-...@googlegroups.com
Check the napalm installation notes to see the system dependencies for each library: http://napalm.readthedocs.io/en/latest/installation/index.html#dependencies
For ease of use, if you are more comfortable with Salt, you can use this formula: https://github.com/saltstack-formulas/napalm-install-formula to install the libraries and their dependencies.

To check if the installation is correct, you can go through that checklist: https://github.com/napalm-automation/napalm#faq

The error messages you paste suggest other problems however; as previously mentioned, you seem to be running older modules, not the official — in Nitrogen the error message has been changed to https://github.com/saltstack/salt/blob/develop/salt/utils/napalm.py#L91 for all napalm modules, while yours still says “Please install the NAPALM library: `pip install napalm`”, like in the previous versions…

To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/62d0ff2eeeb36411d0d6edd6a4a80f80%40kgb.ro.
For more options, visit https://groups.google.com/d/optout.

Petre Bandac

unread,
Sep 15, 2017, 12:11:48 PM9/15/17
to salt-...@googlegroups.com
hello mircea,

i got rid of "user: salt" in the proxy.d file and ran the proxy as root
- it works (at least it tries to connect to the nexus switch using
https, which is not yet enabled, but that's another story)

(regarding my error message below -
https://github.com/saltstack/salt/blob/develop/salt/proxy/napalm.py#L166
has exactly the same message, when unable to load the napalm module)

many thanks for your time,

petre

##

[DEBUG ] LazyLoaded napalm.get_device
[ERROR ] Cannot execute "get_facts" on [unspecified hostname] as .
Reason: not connected!
[ERROR ] Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/utils/napalm.py", line
144, in call
raise Exception('not connected')
Exception: not connected

[INFO ] The following CRITICAL message may not be an error; the
proxy may not be completely established yet.
[CRITICAL] Failed to load grains defined in grain file
napalm.optional_args in function <function optional_args at
0x7f49e8419230>, error:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 738, in
grains
ret = funcs[key](proxy)
File "/usr/lib/python2.7/site-packages/salt/grains/napalm.py", line
453, in optional_args
opt_args.pop(arg, None)
AttributeError: 'NoneType' object has no attribute 'pop'
[DEBUG ] dummy proxy __virtual__() called...
[INFO ] nxos proxy __virtual__() called...
[DEBUG ] rest_sample proxy __virtual__() called...
[INFO ] ssh_sample proxy __virtual__() called...
[DEBUG ] Could not LazyLoad napalm.grains: 'napalm.grains' is not
available.
[DEBUG ] Setting up NAPALM connection
[DEBUG ] Starting new HTTPS connection (1): 192.168.100.21

On 15.09.2017 14:05, 'Mircea Ulinic' via Salt-users wrote:
> Check the napalm installation notes to see the system dependencies
> for
> each library:
>
> http://napalm.readthedocs.io/en/latest/installation/index.html#dependencies
> [5]
> For ease of use, if you are more comfortable with Salt, you can use
> this formula:
> https://github.com/saltstack-formulas/napalm-install-formula [6] to
> install the libraries and their dependencies.
>
> To check if the installation is correct, you can go through that
> checklist: https://github.com/napalm-automation/napalm#faq [7]
>
> The error messages you paste suggest other problems however; as
> previously mentioned, you seem to be running older modules, not the
> official — in Nitrogen the error message has been changed to
>
> https://github.com/saltstack/salt/blob/develop/salt/utils/napalm.py#L91
> [8] for all napalm modules, while yours still says “Please install
> the NAPALM library: `pip install napalm`”, like in the previous
> versions…
>
>> On 15 Sep 2017, at 12:56, Petre Bandac <pe...@kgb.ro [2]> wrote:
>>
>> hi mircea,
>>
>> no, i took the documentation from
>> https://github.com/napalm-automation/napalm-salt#install-napalm [3]
>> pe...@kgb.ro [4]
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Salt-users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to salt-users+...@googlegroups.com.
>> To view this discussion on the web visit
>>
>
> https://groups.google.com/d/msgid/salt-users/62d0ff2eeeb36411d0d6edd6a4a80f80%40kgb.ro.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to salt-users+...@googlegroups.com [9].
> To view this discussion on the web visit
>
> https://groups.google.com/d/msgid/salt-users/719FBA35-4014-4E34-BD0D-A81FE2ED5F41%40cloudflare.com
> [10].
> For more options, visit https://groups.google.com/d/optout [11].
> [2] mailto:pe...@kgb.ro
> [3] https://github.com/napalm-automation/napalm-salt#install-napalm
> [4] mailto:pe...@kgb.ro
> [5]
>
> http://napalm.readthedocs.io/en/latest/installation/index.html#dependencies
> [6] https://github.com/saltstack-formulas/napalm-install-formula
> [7] https://github.com/napalm-automation/napalm#faq
> [8]
> https://github.com/saltstack/salt/blob/develop/salt/utils/napalm.py#L91
> [9] mailto:salt-users+...@googlegroups.com
> [10]
>
> https://groups.google.com/d/msgid/salt-users/719FBA35-4014-4E34-BD0D-A81FE2ED5F41%40cloudflare.com?utm_medium=email&utm_source=footer
> [11] https://groups.google.com/d/optout
Reply all
Reply to author
Forward
0 new messages