Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device inventory fails with "ERROR: netbox_importer: Error getting neighbours on 2 device(s)" #34

Open
erdems opened this issue Mar 15, 2020 · 5 comments

Comments

@erdems
Copy link

erdems commented Mar 15, 2020

For all three devices, netbox shows LLDP neighbors without errors.

Full output:

Initializing importers…
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 21.46it/s]
Fetching and pushing data…
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [01:10<00:00, 23.53s/it]
Finding neighbours and interconnecting…
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:04<00:00, 1.37s/it]
0 interconnection(s) applied
ERROR: netbox_importer: Error getting neighbours on 3 device(s)

@aruhier
Copy link
Contributor

aruhier commented Mar 15, 2020

Hi,
You have to enable the debug mode with -v debug. I made the choice to not print errors in normal verbosity, otherwise you would be flooded, and maybe by errors that are not important.

@erdems
Copy link
Author

erdems commented Mar 16, 2020

Hey!

Sorry I've completely missed the debug mode. Mailed the output since it's probably way too long (68732 lines) to paste here.

@aruhier
Copy link
Contributor

aruhier commented Mar 16, 2020

The error seems to be this one:

DEBUG: netbox_importer: Error when defining interconnections on host xxx-xxx-xx-xxxx: list index out of range

I guess the error is here: https://github.com/aruhier/netbox-netprod-importer/blob/master/netbox_netprod_importer/vendors/juniper/base.py#L148
But sadly it will be difficult for me to debug with having a junOS to debug (with the version you're running). And I'm sorry to say that, but I don't want to push the debug further, as don't want to spend time on this tool anymore (because also of the difficulty to work on it without an infrastructure to target, and because I don't have any need for this tool anymore), and I'm looking for a new maintainer for it.

If you find the issue, however, please feel fry to send me a patch.

@erdems
Copy link
Author

erdems commented Mar 19, 2020 via email

@AnythingOverIP
Copy link

Bonjour!

I am facing the same issue here. Looking at the 101 600 lines debug output, I realize that at some point, the accessed API URL is missing information and it obtains a 404 page:

DEBUG: ncclient.transport.parser: [host 10.37.230.1 session-id 67931] parsing netconf v1.0
ERROR: netbox_importer: Error when polling device DEVICENAMEHERE: 404 Client Error: Not Found for url: https://FULL-URL.DOMAIN/ipshack/api/dcim/_choices/?limit=50 -- <html lang="en"><head><title>Page Not Found - NetBox</title><link rel="stylesheet" href="/ipshack/static/bootstrap-3.4.1-dist/css/bootstrap.min.css" onerror="window.location='/ipshack/media-failure/?filename=bootstrap-3.4.1-dist/css/bootstrap.min.css'"><link rel="stylesheet" href="/ipshack/static/materialdesignicons-5.4.55/css/materialdesignicons.min.css" onerror="window.location='/ipshack/media-failure/?filename=materialdesignicons-5.4.55/css/materialdesignicons.min.css'"><link rel="stylesheet" href="/ipshack/static/jquery-ui-1.12.1/jquery-ui.css" onerror="window.location='/ipshack/media-failure/?filename=jquery-ui-1.12.1/jquery-ui.css'"><link rel="stylesheet" href="/ipshack/static/select2-4.0.13/dist/css/select2.min.css" onerror="window.location='/ipshack/media-failure/?filename=select2-4.0.13/dist/css/select2.min.css'"><link rel="stylesheet" href="/ipshack/static/select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css" onerror="window.location='/ipshack/media-failure/?filename=select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css'"><link rel="stylesheet" href="/ipshack/static/flatpickr-4.6.3/themes/light.css" onerror="window.location='/ipshack/media-failure/?filename=flatpickr-4.6.3/themes/light.css'"><link rel="stylesheet" href="/ipshack/static/css/base.css?v2.11.11" onerror="window.location='/ipshack/media-failure/?filename=css/base.css'"><link rel="icon" type="image/png" href="/ipshack/static/img/netbox.ico"><meta charset="UTF-8"><meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"></head><body>
...

This error appears for my 2 devices in scope for this import.

My understanding is that the script should try https://FULL-URL.DOMAIN/ipshack/api/dcim/devices/?name=DEVICENAMEHERE&limit=50 instead of https://FULL-URL.DOMAIN/ipshack/api/dcim/_choices/?limit=50

I simply cannot put my finger on the issue looking at the code as I am not fluent in python :|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants