-
Notifications
You must be signed in to change notification settings - Fork 95
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
Error creating manufacturers - netbox v3.7.1 #123
Comments
+1 |
I did determine that the import works if you specify a vendor to install. I only encounter the error when running the script to install everything at once. |
The device library itself has "Watchguard" and "WatchGuard" directories containing devices. I'm going guess it breaks when it tires to create a slug the second time. The index is likely case insensitive but the script isn't. |
netbox-community/devicetype-library#1978 fixes this issue. |
Used the master branch of the repository here for the importer. Tried limiting the vendors to different ones. Without any real success. # /opt/Device-Type-Library-Import/venv/bin/python3 /opt/Device-Type-Library-Import/nb-dt-import.py --vendors Generic
Package devicetype-library is already installed, updating /opt/Device-Type-Library-Import/repo
Traceback (most recent call last):
File "/opt/Device-Type-Library-Import/nb-dt-import.py", line 54, in <module>
main()
File "/opt/Device-Type-Library-Import/nb-dt-import.py", line 17, in main
netbox = NetBox(settings)
^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 29, in __init__
self.existing_manufacturers = self.get_manufacturers()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 58, in get_manufacturers
return {str(item): item for item in self.netbox.dcim.manufacturers.all()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 58, in <dictcomp>
return {str(item): item for item in self.netbox.dcim.manufacturers.all()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/response.py", line 127, in __next__
next(self.response), self.endpoint.api, self.endpoint
^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/query.py", line 280, in get
req = self._make_call(add_params=add_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/query.py", line 247, in _make_call
raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error but more specific details were not returned in json. Check the NetBox Logs or investigate this exception's error attribute. # ./nb-dt-import.py --vendors apc
Package devicetype-library is already installed, updating /opt/Device-Type-Library-Import/repo
Traceback (most recent call last):
File "/opt/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
main()
File "/opt/Device-Type-Library-Import/./nb-dt-import.py", line 17, in main
netbox = NetBox(settings)
^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 29, in __init__
self.existing_manufacturers = self.get_manufacturers()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 58, in get_manufacturers
return {str(item): item for item in self.netbox.dcim.manufacturers.all()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/netbox_api.py", line 58, in <dictcomp>
return {str(item): item for item in self.netbox.dcim.manufacturers.all()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/response.py", line 127, in __next__
next(self.response), self.endpoint.api, self.endpoint
^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/query.py", line 280, in get
req = self._make_call(add_params=add_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Device-Type-Library-Import/venv/lib/python3.11/site-packages/pynetbox/core/query.py", line 247, in _make_call
raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error but more specific details were not returned in json. Check the NetBox Logs or investigate this exception's error attribute. |
v3 is supported, but a newer version must have broke this functionality. We will look into it ASAP, or anyone is welcome to submit a PR if the issue is found |
The PR is already merged: netbox-community/devicetype-library#1978 |
Now double-checking, after your response, and ensuring I have pulled the latest import and repo commits. It works... To a degree. Now I am hitting different kind of errors during the device type import.
|
having the same problem, the netbox-community/devicetype-library#1978 PR don't fix this issue and I encounter the issue when trying to import all devices but it's working when trying each vendor standalone. here is verbose output of error in my case
|
My guess here is that this script doesn't support netbox v3. But this is the error I get when trying to run the script to do an initial import on a new system. There are currently 0 manufacturers existing on this system yet.
I tried changing requirements.txt to bump pynetbox up to 7.3.3 and I still get the same error.
The text was updated successfully, but these errors were encountered: