Receiving non_field_errors on POST for /dcim/console-ports/ #3478

Closed
opened 2025-12-29 18:29:26 +01:00 by adam · 2 comments
Owner

Originally created by @niallvwalshe on GitHub (Mar 13, 2020).

Environment

Python: 3.7.5
NetBox: 2.6.6

Steps to Reproduce

Trying to create console ports on a range of devices by looping through a list of integers for their IDs and naming the new console port simply "Console" every time. Device IDs are pulled initially from a GET on /dcim/devices/ and a dictionary of pairs for key:value of name:id. Postman testing resulting in the same behaviour for single creation.

Data:

{
    "name": "Console",
    "device": 19
}

Expected Behaviour

Console port(s) is created.

Observed Behaviour

Status code 400 with following error:

{
    "non_field_errors": [
        "The fields device, name must make a unique set."
    ]
}

Even attempting a single port creation results in this return.

Originally created by @niallvwalshe on GitHub (Mar 13, 2020). ### Environment Python: 3.7.5 NetBox: 2.6.6 ### Steps to Reproduce Trying to create console ports on a range of devices by looping through a list of integers for their IDs and naming the new console port simply "Console" every time. Device IDs are pulled initially from a GET on /dcim/devices/ and a dictionary of pairs for key:value of name:id. Postman testing resulting in the same behaviour for single creation. Data: ``` { "name": "Console", "device": 19 } ``` ### Expected Behaviour Console port(s) is created. ### Observed Behaviour Status code 400 with following error: ``` { "non_field_errors": [ "The fields device, name must make a unique set." ] } ``` Even attempting a single port creation results in this return.
adam closed this issue 2025-12-29 18:29:26 +01:00
Author
Owner

@niallvwalshe commented on GitHub (Mar 13, 2020):

I've also tested this on devices with an existing console port named "Console" to compare any difference in output but is seen to be the same error either way.

@niallvwalshe commented on GitHub (Mar 13, 2020): I've also tested this on devices with an existing console port named "Console" to compare any difference in output but is seen to be the same error either way.
Author
Owner

@niallvwalshe commented on GitHub (Mar 13, 2020):

Just realised I had created a dictionary with incorrect IDs (was pulling nested IDs not matching device) , apologies!

@niallvwalshe commented on GitHub (Mar 13, 2020): Just realised I had created a dictionary with incorrect IDs (was pulling nested IDs not matching device) , apologies!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3478