-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
app: pynetboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
pynetbox version
v7.5.0
NetBox version
v4.4.7
Python version
3.11
Steps to Reproduce
On NetBox server:
sudo tail -f /var/log/nginx/access.log | grep /api/
Then:
import pynetbox
nb = pynetbox.api(NETBOX_URL, NETBOX_TOKEN)
nb.version
Expected Behavior
Request handled with status 200, and no errors in Django logs.
Observed Behavior
Request handled with status 403:
xxx.xxx.xxx.xxx - - [03/Dec/2025:15:39:34 +0200] "GET /api/ HTTP/1.1" 403 58 "-" "python-requests/2.32.5"
There is also error in Django logs (when logging has been enabled):
2025-12-03 15:39:34,257 django.request WARNING: Forbidden: /api/
The reason seems to be that Request.get_version() does not set the token in the request header:
pynetbox/pynetbox/core/query.py
Lines 262 to 264 in a285372
| headers = { | |
| "Content-Type": "application/json", | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
app: pynetboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application