Skip to content

import py fails with a 403 Authentication credentials were not provided. ignores NETBOX_TOKEN #144

@julianfirminger-united

Description

@julianfirminger-united

nb-dt-import.py fails with a 403. It seems to us it's ignoring the .env file?
I have a previous version running on rocky9.3 that works fine, we cant see a conf difference between them.
new nb4 on rokey9.4 does this:

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 28, in __init__
    self.verify_compatibility()
  File "/opt/Device-Type-Library-Import/netbox_api.py", line 50, in verify_compatibility
    version_split = [int(x) for x in self.netbox.version.split('.')]
  File "/opt/Device-Type-Library-Import/venv/lib64/python3.9/site-packages/pynetbox/core/api.py", line 106, in version
    version = Request(
  File "/opt/Device-Type-Library-Import/venv/lib64/python3.9/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.'}

Netbox runs fine, there is an api user with a token enabled. the .env file looks like:

NETBOX_URL=http://<netbox_url>
NETBOX_TOKEN=<token>
REPO_URL=https://github.com/netbox-community/devicetype-library.git
REPO_BRANCH=master
IGNORE_SSL_ERRORS=True
#SLUGS=c9300-48u isr4431 isr4331

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions