netbox-netprod-importer icon indicating copy to clipboard operation
netbox-netprod-importer copied to clipboard

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

Open erdems opened this issue 5 years ago • 5 comments
trafficstars

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)

erdems avatar Mar 15 '20 01:03 erdems

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.

aruhier avatar Mar 15 '20 20:03 aruhier

Hey!

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

erdems avatar Mar 16 '20 03:03 erdems

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.

aruhier avatar Mar 16 '20 18:03 aruhier

Hey there,

That's fair enough; thanks a bunch for the work so far!

Cheers, Erdem

On 16 Mar 2020, at 19:48, Anthony Ruhier [email protected] wrote:

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 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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aruhier/netbox-netprod-importer/issues/34#issuecomment-599702856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIAYL5YJ4OLLHJNLQ2WDNLRHZX7HANCNFSM4LKGHYQA.

erdems avatar Mar 19 '20 10:03 erdems

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 :|

AnythingOverIP avatar Aug 19 '21 17:08 AnythingOverIP