Closed rubenjimenezit closed 3 weeks ago
There are multiple issues being reported here so I'm going to address each of them below.
ImporterIssue(uid='98', name='', issue_type='ValueError', message='Content type id mismatch: 76 != 75')
I was able to replicate this by changing the order of the content types in my netbox dump. This code is relying on the content types being provided in ascending order in the dump file. @snaselj is this intentional?
ImporterIssue(uid='00c4393e-9fa4-563d-b411-876c8ef99e8e', name='', issue_type='SourceFieldImporterIssue', message="{'u_height': 'Invalid source value 0.5, truncated to 0'}")
This appears to be working as intended. A feature request is open for half-height devices here but for now this needs to be changed on the source.
DETAIL: Key (nat_inside_id)=(648d4310-a261-54f8-a786-64ae06dca166) is not present in table "ipam_ipaddress".
There's probably another issue preventing the referenced IP Address from being imported but it's not provided in the issue report. If you still have access to the data can you provide the complete log?
This code is relying on the content types being provided in ascending order in the dump file. @snaselj is this intentional?
@gsnider2195
The reason for this was to generate NetBox content type IDs based on the order in the source file if IDs were not provided in the source file. This can probably be updated just to issue a warning instead of raising an exception, in case, the content type ID is provided.
gsnider2195
Thanks for checking on this. We are now trying onboarding app 4.0 so we can get the info directly from the networking devices. Still a task in progress by now :)
@rubenjimenezit please let us know if you try to use netbox importer again and still encounter this problem. I'm going to close this issue now since I was unable to reproduce the issue but if you can provide example json data that reproduces the issue we will reopen it. Thanks!
Environment
Expected Behavior
Data extracted from Netbox using command (several excludes were added to avoid errors found while importing in Nautobot):
python3 /opt/netbox-3.7.0/netbox/manage.py dumpdata --traceback --format=json --exclude extras.ObjectChange --exclude extras.Script --exclude extras.Report --exclude django_rq --exclude extras.imageattachment --exclude social_django.usersocialauth --output=/tmp/netbox_data.json
Data expected to be imported into Nautobot
Observed Behavior
Data not imported Several "ImporterIssue" found like the following at the beginning of the import process:
ImporterIssue(uid='e3ac8932-01d2-506a-afd1-bd5c4123950d', name='', issue_type='TypeError', message="'int' object is not iterable")
orImporterIssue(uid='98', name='', issue_type='ValueError', message='Content type id mismatch: 76 != 75')
orImporterIssue(uid='00c4393e-9fa4-563d-b411-876c8ef99e8e', name='', issue_type='SourceFieldImporterIssue', message="{'u_height': 'Invalid source value 0.5, truncated to 0'}")
Import process crashes with the following exception:
Steps to Reproduce
nautobot-server import_netbox --bypass-data-validation --save-json-summary-path /tmp/netbox_summary.json --save-text-summary-path /tmp/netbox_summary.txt /tmp/netbox_data.json >> /tmp/netbox_clioutput.txt 2>> /tmp/netbox_clioutput.txt
python3 /opt/netbox-3.7.0/netbox/manage.py dumpdata --traceback --format=json --exclude extras.ObjectChange --exclude extras.Script --exclude extras.Report --exclude django_rq --exclude extras.imageattachment --exclude social_django.usersocialauth --output=/tmp/netbox_data.json