Device-Type-Library-Import icon indicating copy to clipboard operation
Device-Type-Library-Import copied to clipboard

Getting Credentials not provided

Open bnicoson opened this issue 10 months ago • 6 comments

I've tried different tokens and users, but get the same result. Followed the steps provided with no change.

Traceback (most recent call last):
  File "/home/bnicoson/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
    main()
  File "/home/bnicoson/Device-Type-Library-Import/./nb-dt-import.py", line 17, in main
    netbox = NetBox(settings)
  File "/home/bnicoson/Device-Type-Library-Import/netbox_api.py", line 28, in __init__
    self.verify_compatibility()
  File "/home/bnicoson/Device-Type-Library-Import/netbox_api.py", line 50, in verify_compatibility
    version_split = [int(x) for x in self.netbox.version.split('.')]
  File "/home/bnicoson/Device-Type-Library-Import/venv/lib/python3.10/site-packages/pynetbox/core/api.py", line 109, in version
    ).get_version()
  File "/home/bnicoson/Device-Type-Library-Import/venv/lib/python3.10/site-packages/pynetbox/core/query.py", line 187, in get_version
    raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 403 Forbidden: {'detail': 'Authentication credentials were not provided.'}

bnicoson avatar Feb 06 '25 23:02 bnicoson

Same issue. NetBox v4.1.11

lukify85 avatar Feb 07 '25 21:02 lukify85

Also here, 4.2.3

MaxPower654 avatar Feb 10 '25 20:02 MaxPower654

same issue with 4.2.3

lmuroot avatar Feb 12 '25 15:02 lmuroot

Edit the requirements.txt with version 7.3.4 for pynetbox

adamvance avatar Feb 12 '25 23:02 adamvance

Had same Issue. I got it solved in netbox_api.py, with setting the AUTH_HEADER manualy

def connect_api(self):
    try:
        self.netbox = pynetbox.api(self.url, token=self.token)

        # Manuel set Auth_header!
        self.netbox.http_session.headers.update({"Authorization": f"Token {self.token}"})

        if self.ignore_ssl:
            self.handle.verbose_log("IGNORE_SSL_ERRORS is True, disabling SSL verification.")
            requests.packages.urllib3.disable_warnings()
            self.netbox.http_session.verify = False
    except Exception as e:
        self.handle.exception("Exception", 'NetBox API Error', e)

BassdoxXx avatar Feb 17 '25 21:02 BassdoxXx

Edit the requirements.txt with version 7.3.4 for pynetbox

this worked for me

matheusmoliveira avatar Mar 09 '25 06:03 matheusmoliveira