Skip to content

Moving primary ip address for a device to a new device generates Integrity error #11934

Closed
@drossy

Description

@drossy

NetBox version

v3.4.5

Python version

3.8

Steps to Reproduce

We encountered this on our local version (3.4.2) but were able to reproduce on the demo instance (3.4.5)

  1. Browse to the edit page for an ipv4 address marked as primary ip for a device
  2. Change the device and interface to another device and interface, leave the "Make this the primary IP for the device/VM" box ticked
  3. Press Save

Expected Behavior

IP address is updated to be set as primary ip for the new device, and assigned to the new interface, and is no longer primary ip address for the old device and is no longer assigned to the old interface.

Observed Behavior

The web server displays:

<class 'django.db.utils.IntegrityError'>

duplicate key value violates unique constraint "dcim_device_primary_ip4_id_key"
DETAIL: Key (primary_ip4_id)=(185) already exists.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions