Closed tim-fiola closed 3 years ago
same issue here, hopefully #8 will solve this
Tryed new version
pip install git+https://github.com/nautobot/nautobot-plugin-device-onboarding.git@develop
But still have the same error
@bsmeding Have you restarted your worker?
If you did, can you provide more information? Is it re-onboarding, first onboarding, what kind of objects already exist in your database etc?
hi @mzbroch yes i restarted both services
It happen with both, existing and non-existing devices. Also directly after starting the task. database is rather empty, only one device manual added
@mzbroch - I can confirm that onboarding devices end up with the same error for me. Maybe the issue should be reopened?
@Kani999 @bsmeding
Please install plugin release 1.0.1 via PyPi:
pip install pip install 'nautobot-device-onboarding==1.0.1'
@mzbroch - It works now.
ERROR: Error reading SSH protocol banner
error, but this is a totally different thing (iosxr). This error occurs even for netbox.@Kani999
We see this error from time to time - it's related to underlying library and the device type itself.
You might need to tweak SSH settings on XR, plus see of following plugin settings in configuration.py
help :
NAPALM_ARGS = {
"conn_timeout": 30,
"session_timeout": 60,
"auth_timeout": 40,
"banner_timeout": 40,
}
@mzbroch I tried this args and even others with different timeouts, but I always end up with the error
==> nautobot-worker.log <==
09:23:45 default: nautobot_device_onboarding.worker.onboard_device(UUID('a2ab8fd1-9952-4bf6-a5ea-ea2ed2843bfd'), *Credentials argument hidden*) (e9cfb421-a677-4554-b377-e0f339bfbe66)
09:23:45 START: onboard device
09:23:45 Getting device with IP lookup failed: Device matching query does not exist.
09:23:45 CHECK: IP 195.xxx.xxx.xxx:22
09:23:45 COLLECT: device information 195.xxx.xxx.xxx
==> nautobot-worker-error.log <==
09:23:45 OnboardException: fail-general: Error reading SSH protocol banner
Please first try to create a new platform object in netbox for IOSXR (define napalm driver), and select this platform manually during onboarding. If this doesn't help, within this environment's context, spawn-up napalm session manually to this device and check connectivity.
root@faadb8a8a6f8:/opt/nautobot# ./bin/napalm --user 'kani999'--password 'password' --vendor iosxr --debug IPADDRESS call get_facts
2021-04-28 05:31:46,863 - napalm - DEBUG - Starting napalm's debugging tool
2021-04-28 05:31:46,863 - napalm - DEBUG - Gathering napalm packages
2021-04-28 05:31:46,863 - napalm - DEBUG - napalm==3.2.0
2021-04-28 05:31:46,863 - napalm - DEBUG - get_network_driver - Calling with args: ('iosxr',), {}
2021-04-28 05:31:46,863 - napalm - DEBUG - get_network_driver - Successful
2021-04-28 05:31:46,864 - napalm.iosxr.iosxr - INFO - {}
2021-04-28 05:31:46,864 - napalm - DEBUG - __init__ - Successful
2021-04-28 05:31:46,864 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:31:46,864 - napalm - DEBUG - open - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:31:58,191 - napalm - DEBUG - open - Successful
2021-04-28 05:31:58,191 - napalm - DEBUG - connection_tests - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:31:58,192 - napalm - DEBUG - get_facts - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:32:03,052 - napalm.pyIOSXR.iosxr - DEBUG - <Element Response at 0x7f8df5203c80>
2021-04-28 05:32:04,888 - napalm.pyIOSXR.iosxr - DEBUG - <Element Response at 0x7f8df52359c0>
2021-04-28 05:32:04,895 - napalm - DEBUG - get_facts - Successful
2021-04-28 05:32:04,895 - napalm - DEBUG - method - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>, 'get_facts'), {}
2021-04-28 05:32:04,895 - napalm - DEBUG - get_facts - Attempting to resolve method
2021-04-28 05:32:04,895 - napalm - DEBUG - get_facts - Attempting to call method with kwargs: {}
2021-04-28 05:32:09,959 - napalm.pyIOSXR.iosxr - DEBUG - <Element Response at 0x7f8df52353c0>
2021-04-28 05:32:11,405 - napalm.pyIOSXR.iosxr - DEBUG - <Element Response at 0x7f8df5259940>
2021-04-28 05:32:11,411 - napalm - DEBUG - get_facts - Response
{
"vendor": "Cisco",
"os_version": "6.6.3",
"hostname": "R-lab",
"serial_number": "SMA18040SW7",
"model": "CRS-4-CH",
"interface_list": [
"GigabitEthernet0/1/0/0",
]
}
2021-04-28 05:32:11,412 - napalm - DEBUG - method - Successful
2021-04-28 05:32:11,412 - napalm - DEBUG - close - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:32:11,412 - napalm.iosxr.iosxr - DEBUG - Closed connection with device
2021-04-28 05:32:11,412 - napalm - DEBUG - close - Successful
2021-04-28 05:32:11,412 - napalm - DEBUG - post_connection_tests - Calling with args: (<napalm.iosxr.iosxr.IOSXRDriver object at 0x7f8df51333d0>,), {}
2021-04-28 05:32:11,412 - napalm.iosxr.iosxr - DEBUG - Closed connection with device
==> nautobot-worker.log <==
10:36:15 default: nautobot_device_onboarding.worker.onboard_device(UUID('a6113304-8349-4f0d-8a6d-f423461c43f1'), *Credentials argument hidden*) (b0229a46-c6d1-43d6-b74d-f4cf4f1069ce)
==> nautobot-worker-error.log <== 10:36:15 ERROR: Error reading SSH protocol banner 10:36:15 OnboardException: fail-general: OnboardException: fail-connect: ERROR: Error reading SSH protocol banner
==> nautobot-worker.log <== 10:36:15 START: onboard device 10:36:15 Getting device with IP lookup failed: Device matching query does not exist. 10:36:15 CHECK: IP IPADDR:22 10:36:15 COLLECT: device information IPADDR 10:36:15 INFO OPTIONAL ARGS: {'conn_timeout': 3000, 'session_timeout': 3000, 'auth_timeout': 3000, 'banner_timeout': 3000} 10:36:15 INFO guessing device type: IPADDR 10:36:15 default: Job OK (b0229a46-c6d1-43d6-b74d-f4cf4f1069ce) 10:36:15 Result is kept for 500 seconds
- and it does not matter if I create the platform or not (and assign it when onboarding)
![image](https://user-images.githubusercontent.com/17337078/116391001-ec303680-a81e-11eb-94aa-a1084cd8d9d1.png)
--
I figure out, that there is a point, where my code crashes to exception napalm_device.open()
or with SSHDetect(**remote_device)
when the platform is not set manually
{'device_type': 'autodetect', 'host': 'IPADDRESS', 'username': 'kani999', 'password': 'pass', 'conn_timeout': 3000, 'auth_timeout': 3000, 'banner_timeout': 3000, 'session_timeout': 3000, 'port': 22, 'timeout': 30}
pip install pip install 'nautobot-device-onboarding==1.0.1'
@mzbroch installed this version instead of development and onboarding still works! Thanks
@Kani999 can you add a device manually and check if the NAPALM is working from within the device page? Get the current config.
@bsmeding
Configuration
tab (which displays current config) it works without any problem.{'conn_timeout': 3000, 'auth_timeout': 3000, 'banner_timeout': 3000, 'session_timeout': 3000}
is also used, as when onboarding
is used==> nautobot-app-error.log <==
[29/Apr/2021 09:49:50] "GET /dcim/devices/d2ad7d2c-9c16-4db1-97c6-97a429b54fbe/config/ HTTP/1.1" 200 55477
{'conn_timeout': 3000, 'auth_timeout': 3000, 'banner_timeout': 3000, 'session_timeout': 3000}
Local version/idstring: SSH-2.0-paramiko_2.7.2
Remote version/idstring: SSH-2.0-Cisco-2.0
Connected (version 2.0, client Cisco-2.0)
.
.
.
Adding ecdsa-sha2-nistp256 host key for XXX.XXX.XXX.XX:
userauth is OK
Authentication (password) successful!
XXX:R199-lab#
Thu Apr 29 11:50:01.325 METDST
XML>
read_channel:
write_channel: b'<?xml version="1.0" encoding="UTF-8"?><Request MajorVersion="1" MinorVersion="0"><CLI><Configuration>show running-config</Configuration></CLI></Request>\n'
read_channel: <?xml version="1.0" encoding="UTF-8"?>
<Response MajorVersion="1" MinorVersion="0"><CLI><Configuration>
Building configuration...
!! IOS XR Configuration 6.6.3
!! Last configuration change at Tue Apr 27 11:31:59 2021 by username
!
hostname R199-lab
.
.
.
</Configuration></CLI><ResultSummary ErrorCount="0"/></Response>
XML>
Closed connection with device XXX.XXX.XXX.XX
[chan 0] EOF sent (0)
Closed connection with device XXX.XXX.XXX.XX
[29/Apr/2021 09:50:05] "GET /api/dcim/devices/d2ad7d2c-9c16-4db1-97c6-97a429b54fbe/napalm/?method=get_config HTTP/1.1" 200 75707
[chan 0] EOF received (0)
EOF in transport thread
Increasing rate-limit on the device solved the problem. Yet another problem occurs:
OnboardException: fail-general: ERROR: Could not detect device type with SSHDetect
CiscoXrSSH' object has no attribute 'receive_data_generator
Environment
Steps to Reproduce
Create
buttonExpected Behavior
Device to be successfully onboarded
Observed Behavior
Failure due to
Related Field got invalid lookup: address
Log snips