Error in removing primary IP from device #5296

Closed
opened 2025-12-29 19:26:22 +01:00 by adam · 4 comments
Owner

Originally created by @miaow2 on GitHub (Sep 2, 2021).

NetBox version

v3.0.1

Python version

3.8

Steps to Reproduce

  1. Start editing IP address which is assigned to an interface and is the primary IP of the device.
  2. delete interface in Interface field
  3. uncheck Make this the primary IP for the device/VM
  4. press Save

Expected Behavior

IP should be removed from interface and primary ip

Observed Behavior

Got an error: IP address is primary for device device-name but not assigned to it!

Originally created by @miaow2 on GitHub (Sep 2, 2021). ### NetBox version v3.0.1 ### Python version 3.8 ### Steps to Reproduce 1. Start editing IP address which is assigned to an interface and is the primary IP of the device. 2. delete interface in `Interface` field 3. uncheck `Make this the primary IP for the device/VM` 4. press `Save` ### Expected Behavior IP should be removed from interface and primary ip ### Observed Behavior Got an error: IP address is primary for device *device-name* but not assigned to it!
adam added the type: bugstatus: needs ownerpending closure labels 2025-12-29 19:26:22 +01:00
adam closed this issue 2025-12-29 19:26:22 +01:00
Author
Owner

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

We might be able to refactor the IPAddressForm logic inside save() to clear the primary IP assignment from the parent device/VM prior to saving the IP address.

As a workaround, you can uncheck "Make this the primary IP" without clearing the interface assignment first, or disassociate the IP address as primary by editing the device or VM directly.

@jeremystretch commented on GitHub (Sep 2, 2021): We might be able to refactor the IPAddressForm logic inside `save()` to clear the primary IP assignment from the parent device/VM prior to saving the IP address. As a workaround, you can uncheck "Make this the primary IP" without clearing the interface assignment first, or disassociate the IP address as primary by editing the device or VM directly.
Author
Owner

@Carbenium commented on GitHub (Sep 5, 2021):

Linking for reference: https://github.com/netbox-community/netbox/issues/7074

@Carbenium commented on GitHub (Sep 5, 2021): Linking for reference: https://github.com/netbox-community/netbox/issues/7074
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 5, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Dec 6, 2021):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Dec 6, 2021): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5296