null value in column "rf_role" violates not-null constraint #6241

Closed
opened 2025-12-29 19:38:25 +01:00 by adam · 2 comments
Owner

Originally created by @ecoutinho on GitHub (Mar 21, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.9

Python version

3.8

Steps to Reproduce

After updating netbox-netprod-importer and netboxapi to latest git versions, to make use of OPTIONS, while importing a switch, it fails on "PUT /api/dcim/interfaces/416/" with the following error:

ERROR: netbox_importer: Error when polling device switch1: Interface Ethernet1/1 could not be created: 500 Server Error: Internal Server Error for url: https://netbox/api/dcim/interfaces/416/ -- {'error': 'null value in column "rf_role" violates not-null constraint\nDETAIL: Failing row contains (416, Ethernet1/1, 1000base-t, f, Uplink, 38, 00:c8:8b:35:d3:08, null, t, 1500, access, 13, null, 0001999999999999Ethernet000001............, 1, null, null, null, 2021-04-16, {}, 2022-03-21 18:25:52.690757+00, f, null, null, null, null, , null, null, null, null).\n', 'exception': 'IntegrityError', 'netbox_version': '3.1.9', 'python_version': '3.8.8'}

At the server, it is logged:

Internal Server Error: /api/dcim/interfaces/416/

Expected Behavior

This is not a wifi port, so rf_role should be null.

Observed Behavior

Internal Server Error

Originally created by @ecoutinho on GitHub (Mar 21, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.9 ### Python version 3.8 ### Steps to Reproduce After updating netbox-netprod-importer and netboxapi to latest git versions, to make use of OPTIONS, while importing a switch, it fails on "PUT /api/dcim/interfaces/416/" with the following error: ERROR: netbox_importer: Error when polling device switch1: Interface Ethernet1/1 could not be created: 500 Server Error: Internal Server Error for url: https://netbox/api/dcim/interfaces/416/ -- {'error': 'null value in column "rf_role" violates not-null constraint\nDETAIL: Failing row contains (416, Ethernet1/1, 1000base-t, f, Uplink, 38, 00:c8:8b:35:d3:08, null, t, 1500, access, 13, null, 0001999999999999Ethernet000001............, 1, null, null, null, 2021-04-16, {}, 2022-03-21 18:25:52.690757+00, f, null, null, null, null, , null, null, null, null).\n', 'exception': 'IntegrityError', 'netbox_version': '3.1.9', 'python_version': '3.8.8'} At the server, it is logged: Internal Server Error: /api/dcim/interfaces/416/ ### Expected Behavior This is not a wifi port, so rf_role should be null. ### Observed Behavior Internal Server Error
adam added the type: bugstatus: accepted labels 2025-12-29 19:38:25 +01:00
adam closed this issue 2025-12-29 19:38:25 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 21, 2022):

After updating netbox-netprod-importer and netboxapi to latest git versions

Please revise your post above to include instructions that someone else can use to reliably reproduce the reported behavior without relying on any external tools. If this is related to a REST API request, please provide instructions for reproducing the request using curl or a similar tool.

@jeremystretch commented on GitHub (Mar 21, 2022): > After updating netbox-netprod-importer and netboxapi to latest git versions Please revise your post above to include instructions that someone else can use to reliably reproduce the reported behavior without relying on any external tools. If this is related to a REST API request, please provide instructions for reproducing the request using `curl` or a similar tool.
Author
Owner

@ecoutinho commented on GitHub (Mar 21, 2022):

This is what I did to update netbox-netprod-importer to a version compatible with OPTIONS, instead of CHOICES:

source /opt/netbox/venv/bin/activate
pip uninstall netbox-netprod-importer netboxapi
pip install git+https://github.com/scaleway/python-netboxapi.git
pip install git+https://github.com/nahun/netbox-netprod-importer.git@options_choices

This is a simple curl command which reproduces the error:

curl -k -X PUT https://netbox/api/dcim/interfaces/416/ \
     -H "Authorization: Token xxxx" \
     -H "Content-Type: application/json" \
     -d '{ "device": { "id": 38 }, "name": "Ethernet1/1", "type": "1000base-t", "rf_role": null }'

and results in:

{"error": "null value in column "rf_role" violates not-null constraint\nDETAIL: Failing row contains (416, Ethernet1/1, 1000base-t, f, , 38, null, null, t, null, access, 71, null, 0001999999999999Ethernet000001............, 1, null, null, null, 2021-04-16, {}, 2022-03-21 19:47:38.006975+00, f, null, null, null, null, , null, null, null, null).\n", "exception": "IntegrityError", "netbox_version": "3.1.9", "python_version": "3.8.8"}

@ecoutinho commented on GitHub (Mar 21, 2022): This is what I did to update netbox-netprod-importer to a version compatible with OPTIONS, instead of CHOICES: ``` source /opt/netbox/venv/bin/activate pip uninstall netbox-netprod-importer netboxapi pip install git+https://github.com/scaleway/python-netboxapi.git pip install git+https://github.com/nahun/netbox-netprod-importer.git@options_choices ``` This is a simple curl command which reproduces the error: ``` curl -k -X PUT https://netbox/api/dcim/interfaces/416/ \ -H "Authorization: Token xxxx" \ -H "Content-Type: application/json" \ -d '{ "device": { "id": 38 }, "name": "Ethernet1/1", "type": "1000base-t", "rf_role": null }' ``` and results in: _{"error": "null value in column \"rf_role\" violates not-null constraint\nDETAIL: Failing row contains (416, Ethernet1/1, 1000base-t, f, , 38, null, null, t, null, access, 71, null, 0001999999999999Ethernet000001............, 1, null, null, null, 2021-04-16, {}, 2022-03-21 19:47:38.006975+00, f, null, null, null, null, , null, null, null, null).\n", "exception": "IntegrityError", "netbox_version": "3.1.9", "python_version": "3.8.8"}_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6241