Error while creating device: duplicate key value violates unique constraint "dcim_device_pkey" #5438

Closed
opened 2025-12-29 19:28:01 +01:00 by adam · 1 comment
Owner

Originally created by @gmiranda on GitHub (Sep 29, 2021).

NetBox version

2.11.1

Python version

3.8

Steps to Reproduce

I created some devices using the netbox shell, and when I try to create a new one via the web interface, I get this error.

Expected Behavior

A new device should have been created with no errors whatsoever.

Observed Behavior

This is the exception:
`<class 'django.db.utils.IntegrityError'>

duplicate key value violates unique constraint "dcim_device_pkey"
DETAIL: Key (id)=(36) already exists.

Python version: 3.8.5
NetBox version: 2.11.1`

Originally created by @gmiranda on GitHub (Sep 29, 2021). ### NetBox version 2.11.1 ### Python version 3.8 ### Steps to Reproduce I created some devices using the netbox shell, and when I try to create a new one via the web interface, I get this error. ### Expected Behavior A new device should have been created with no errors whatsoever. ### Observed Behavior This is the exception: `<class 'django.db.utils.IntegrityError'> duplicate key value violates unique constraint "dcim_device_pkey" DETAIL: Key (id)=(36) already exists. Python version: 3.8.5 NetBox version: 2.11.1`
adam closed this issue 2025-12-29 19:28:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 29, 2021):

2.11.1

I'm afraid your NetBox version is severely out of date. Please upgrade to the latest stable release (or at least to v2.11.12), as it's likely that you're running into a bug that has already been resolved.

If you continue to experience issues after upgrading, please open a new bug report with detailed steps that someone else can follow to reproduce the bug. (Your description above is insufficient.)

@jeremystretch commented on GitHub (Sep 29, 2021): > 2.11.1 I'm afraid your NetBox version is severely out of date. Please upgrade to the latest stable release (or at least to v2.11.12), as it's likely that you're running into a bug that has already been resolved. If you continue to experience issues after upgrading, please open a _new_ bug report with detailed steps that someone else can follow to reproduce the bug. (Your description above is insufficient.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5438