Unable to free a OOB IP from a device and reassign it #646

Closed
opened 2026-04-05 17:01:30 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Jamie- on 1/7/2026

NetBox Edition

NetBox Community

NetBox Version

v4.4.5-Docker-3.4.1

Python Version

3.12

Steps to Reproduce

This issue was already reported here https://github.com/netbox-community/netbox/issues/19809 but closed without a reproduction. I can reproduce but can't re-open the previous issue so creating a new one.

Reproduced by cloning netbox-docker repo https://github.com/netbox-community/netbox-docker and docker compose up to give me the latest version.
Created a superuser and logged in.

tl;dr: Create a device, create an OOB mgmt interface on the device, assign an IP and check "Make this the out-of-band IP for the device". Then remove the assigned IP and see that it is still showing on the device view and causes an internal server error if re-assigned.

I found this as I'm currently replacing some hosts and re-using the old host IPs for the new host.

  1. Create a device, server1 (you will need to also create a site, device role, device type, etc to be able to create a device from scratch).
  2. On the new device, add components, interfaces
  3. Create an mgmt interface, type pick any, make sure to check "Management only", create.
  4. Create an IP address, 192.168.1.1/24
  5. Go to the mgmt interface on server1 and assign an IP, go to assign IP tab and search for 192.168.1.1. Click it and check "Make this the out-of-band IP for the device", click save.
  6. Observer on server1 now the "Out-of-band IP" field shows our assigned IP 192.168.1.1
  7. Now we need to re-assign this IP address to a different device, so click the assigned IP to view it and then click edit.
  8. Clear the interface assignment by pressing the X on the right side of the interface input box, and uncheck "Make this the out-of-band IP for the device". Save.
  9. Observe that now when viewing the IP address, there is no assignment shown and "OOB IP" is "X".
  10. First part of the bug: View server1, note that it is still showing 192.168.1.1 as it's "Out-of-band IP" - but it shouldn't be because we removed it. Check the interface tab and observe that the mgmt interface has no IP address assigned.
  11. Create server2 and create a mgmt interface on it in the same way as server1.
  12. In server2, assign an IP address to it's mgmt interface in the same way as server1, after checking "Make this the out-of-band IP for the device" and clicking save, an internal server error is returned with the error:
<class 'django.db.utils.IntegrityError'>

duplicate key value violates unique constraint "dcim_device_oob_ip_id_key"
DETAIL:  Key (oob_ip_id)=(5) already exists.

Python version: 3.12.3
NetBox version: 4.4.5-Docker-3.4.1
Plugins: None installed
Image

Expected Behavior

As part of step 10, when viewing the server after removing the IP assignment, that the IP address is no longer linked.
Then as part of step 12 when assigning the same IP to a different device, that it is assigned correctly and does not throw an internal server error.

Observed Behavior

IP address remained still linked to the previous device and caused an internal server error when re-assigned.

*Originally created by @Jamie- on 1/7/2026* ### NetBox Edition NetBox Community ### NetBox Version v4.4.5-Docker-3.4.1 ### Python Version 3.12 ### Steps to Reproduce This issue was already reported here https://github.com/netbox-community/netbox/issues/19809 but closed without a reproduction. I can reproduce but can't re-open the previous issue so creating a new one. Reproduced by cloning netbox-docker repo https://github.com/netbox-community/netbox-docker and `docker compose up` to give me the latest version. Created a superuser and logged in. tl;dr: Create a device, create an OOB mgmt interface on the device, assign an IP and check "Make this the out-of-band IP for the device". Then remove the assigned IP and see that it is still showing on the device view and causes an internal server error if re-assigned. I found this as I'm currently replacing some hosts and re-using the old host IPs for the new host. 1. Create a device, `server1` (you will need to also create a site, device role, device type, etc to be able to create a device from scratch). 2. On the new device, add components, interfaces 3. Create an `mgmt` interface, type pick any, make sure to check "Management only", create. 4. Create an IP address, `192.168.1.1/24` 5. Go to the `mgmt` interface on `server1` and assign an IP, go to assign IP tab and search for 192.168.1.1. Click it and check "Make this the out-of-band IP for the device", click save. 6. Observer on `server1` now the "Out-of-band IP" field shows our assigned IP 192.168.1.1 7. Now we need to re-assign this IP address to a different device, so click the assigned IP to view it and then click edit. 8. Clear the interface assignment by pressing the X on the right side of the interface input box, and uncheck "Make this the out-of-band IP for the device". Save. 9. Observe that now when viewing the IP address, there is no assignment shown and "OOB IP" is "X". 10. First part of the bug: View `server1`, note that it is still showing 192.168.1.1 as it's "Out-of-band IP" - but it shouldn't be because we removed it. Check the interface tab and observe that the `mgmt` interface has no IP address assigned. 11. Create `server2` and create a `mgmt` interface on it in the same way as `server1`. 12. In `server2`, assign an IP address to it's `mgmt` interface in the same way as `server1`, after checking "Make this the out-of-band IP for the device" and clicking save, an internal server error is returned with the error: ``` <class 'django.db.utils.IntegrityError'> duplicate key value violates unique constraint "dcim_device_oob_ip_id_key" DETAIL: Key (oob_ip_id)=(5) already exists. Python version: 3.12.3 NetBox version: 4.4.5-Docker-3.4.1 Plugins: None installed ``` <img width="799" height="470" alt="Image" src="https://github.com/user-attachments/assets/14ef4b12-1d1c-42d6-8f22-1660cc670f74" /> ### Expected Behavior As part of step 10, when viewing the server after removing the IP assignment, that the IP address is no longer linked. Then as part of step 12 when assigning the same IP to a different device, that it is assigned correctly and does not throw an internal server error. ### Observed Behavior IP address remained still linked to the previous device and caused an internal server error when re-assigned.
MrUnknownDE added the type: bugnetboxnetboxstatus: duplicatenetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxstatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatestatus: duplicatetype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bugtype: bug labels 2026-04-05 17:01:49 +02:00
Sign in to join this conversation.
No Label netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate status: duplicate type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug type: bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#646