Unable to assign IP to interface #3062

Closed
opened 2025-12-29 18:25:16 +01:00 by adam · 1 comment
Owner

Originally created by @abrahamvegh on GitHub (Dec 12, 2019).

Originally assigned to: @kobayashi on GitHub.

Environment

  • Python version: 3.7.3
  • NetBox version: 2.6.8

Steps to Reproduce

  1. From a Device with an Interface, click the ‘Add IP address’ button
  2. Click the ‘Assign IP’ tab
  3. Search for an IP
  4. Click an IP in the search results

Expected Behavior

The IP address link should contain the ID of the interface we are attempting to assign to.

Observed Behavior

For IPs not currently assigned to an interface, the interface URL parameter is empty.
For IPs currently assigned to an interface, the interface URL parameter is the ID of the interface it is currently assigned to, not the one we are attempting to assign to.

Notes

It appears this was introduced by #3687. I’m not familiar enough with Python or the codebase to determine what the correct fix would be that would satisfy both the bug being addressed by that PR and this regression. In the meantime, it is still possible to assign an IP by manually inserting the ID of the correct interface into the link URL.

Originally created by @abrahamvegh on GitHub (Dec 12, 2019). Originally assigned to: @kobayashi on GitHub. <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.7.3 * NetBox version: 2.6.8 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. From a Device with an Interface, click the ‘Add IP address’ button 2. Click the ‘Assign IP’ tab 3. Search for an IP 4. Click an IP in the search results <!-- What did you expect to happen? --> ### Expected Behavior The IP address link should contain the ID of the `interface` we are attempting to assign to. <!-- What happened instead? --> ### Observed Behavior For IPs not currently assigned to an interface, the `interface` URL parameter is empty. For IPs currently assigned to an interface, the `interface` URL parameter is the ID of the interface it is currently assigned to, not the one we are attempting to assign to. ### Notes It appears this was introduced by #3687. I’m not familiar enough with Python or the codebase to determine what the correct fix would be that would satisfy both the bug being addressed by that PR and this regression. In the meantime, it is still possible to assign an IP by manually inserting the ID of the correct interface into the link URL.
adam added the type: bugstatus: accepted labels 2025-12-29 18:25:16 +01:00
adam closed this issue 2025-12-29 18:25:16 +01:00
Author
Owner

@kobayashi commented on GitHub (Dec 13, 2019):

Thank you for letting me know.
Yes, that PR fixed to see correct ip assign information (device -> interface -> ip address), but makes this bug. I am taking this issue.

@kobayashi commented on GitHub (Dec 13, 2019): Thank you for letting me know. Yes, that PR fixed to see correct ip assign information (device -> interface -> ip address), but makes this bug. I am taking this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3062