Quickadd MAC address created when adding an interface can not be saves/set as primary #10880

Closed
opened 2025-12-29 21:37:11 +01:00 by adam · 10 comments
Owner

Originally created by @Domoninic on GitHub (Mar 12, 2025).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

V4.2.5

Python Version

3.12

Steps to Reproduce

1: Add Interface to existing Device
2: Use quickadd widget to create new primary mac address
3: set new mac address a primary
4 Save new interface

Expected Behavior

Save should work and newly create MAC should be assigned to new interface and set as primary.

Observed Behavior

Saving the new interface fails with error on field Primary MAC address "MAC address XX:XX:XX:XX:XX:XX is not assigned to this interface".
While creating the MAC address it is not possible to assign it to the new interface as that does not yet exist.
One must first save the interface then edit it and use the quick add to create the MAC as assigned to the interface and then save it.
Seems to be a chicken and egg problem.

Originally created by @Domoninic on GitHub (Mar 12, 2025). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version V4.2.5 ### Python Version 3.12 ### Steps to Reproduce 1: Add Interface to existing Device 2: Use quickadd widget to create new primary mac address ~3: set new mac address a primary~ 4 Save new interface ### Expected Behavior Save should work and newly create MAC should be assigned to new interface and set as primary. ### Observed Behavior Saving the new interface fails with error on field Primary MAC address "MAC address XX:XX:XX:XX:XX:XX is not assigned to this interface". While creating the MAC address it is not possible to assign it to the new interface as that does not yet exist. One must first save the interface then edit it and use the quick add to create the MAC as assigned to the interface and then save it. Seems to be a chicken and egg problem.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:37:11 +01:00
adam closed this issue 2025-12-29 21:37:11 +01:00
Author
Owner
@tomasz-c commented on GitHub (Mar 12, 2025): This topic is also covered in other reports and discussions: https://github.com/netbox-community/netbox/issues/18787 https://github.com/netbox-community/netbox/discussions/18807 https://github.com/netbox-community/netbox/issues/18821
Author
Owner

@jeremystretch commented on GitHub (Apr 9, 2025):

3: set new mac address a primary

How are you doing this? There is no option to designate the MAC address as primary on the form.

Further the MAC address can't be assigned to the interface until the interface has been created.

@jeremystretch commented on GitHub (Apr 9, 2025): > 3: set new mac address a primary How are you doing this? There is no option to designate the MAC address as primary on the form. Further the MAC address can't be assigned to the interface until the interface has been created.
Author
Owner

@Domoninic commented on GitHub (Apr 10, 2025):

3: set new mac address a primary

How are you doing this? There is no option to designate the MAC address as primary on the form.

Further the MAC address can't be assigned to the interface until the interface has been created.

After clicking create in the "Quick Add MAC Address" the new MAC address is automatically filled in.

@Domoninic commented on GitHub (Apr 10, 2025): > > 3: set new mac address a primary > > How are you doing this? There is no option to designate the MAC address as primary on the form. > > Further the MAC address can't be assigned to the interface until the interface has been created. After clicking create in the "Quick Add MAC Address" the new MAC address is automatically filled in.
Author
Owner

@jeremystretch commented on GitHub (Apr 10, 2025):

I'm not sure what you're looking at. NetBox itself does not automatically populate any of the fields. Maybe your browser is auto filling the form.

But my question stands: How are you marking the MAC as primary before it is created? There is currently no option for this.

Please review your reproduction steps.

@jeremystretch commented on GitHub (Apr 10, 2025): I'm not sure what you're looking at. NetBox itself does not automatically populate any of the fields. Maybe your browser is auto filling the form. But my question stands: How are you marking the MAC as primary before it is created? There is currently no option for this. Please review your reproduction steps.
Author
Owner

@Domoninic commented on GitHub (Apr 10, 2025):

Step 2:

Image

Image

Step 3 'Primary MAC Address' is automatically filled:

Image

This behavior is with both edge and firefox with all auto fill options off and clearing autofill form data.

Step 4:

Image

@Domoninic commented on GitHub (Apr 10, 2025): Step 2: ![Image](https://github.com/user-attachments/assets/58fbfc93-a9f7-453c-bc30-d6ba8017c8c2) ![Image](https://github.com/user-attachments/assets/285fee01-ca3f-4c18-892a-4dce5cef9f2c) Step 3 'Primary MAC Address' is automatically filled: ![Image](https://github.com/user-attachments/assets/fdd8090e-328b-4bad-b43c-c323c9397e70) This behavior is with both edge and firefox with all auto fill options off and clearing autofill form data. Step 4: ![Image](https://github.com/user-attachments/assets/b0663d2e-de0e-418a-b640-ee51afa62713)
Author
Owner

@jeremystretch commented on GitHub (Apr 10, 2025):

Ok, so #3 in your instructions isn't a separate step, hence my confusion.

I don't see how this was ever intended to work for creating a new interface. It's a chicken-and-egg problem: The MAC address can't be assigned to the interface as the interface has not yet been created, and the interface can't be created with a primary MAC that isn't assigned to it.

@jeremystretch commented on GitHub (Apr 10, 2025): Ok, so #3 in your instructions isn't a separate step, hence my confusion. I don't see how this was ever intended to work for creating a new interface. It's a chicken-and-egg problem: The MAC address can't be assigned to the interface as the interface has not yet been created, and the interface can't be created with a primary MAC that isn't assigned to it.
Author
Owner

@tokkyuuressha commented on GitHub (Apr 30, 2025):

I've noticed this issue as well. I understand it was caused by introduction of multiple mac address feature.
In my opinion there should be a way to add a device with single MAC address(which is likely majority of devices) as it used to be all along. Having to go through the same edit dialog second time just to add the MAC address wastes a lot of time. Can't understate how confusing it is (given that it is a recent change) and every member of my team went through it scratching their head.

How about disabling validation on the 'Primary MAC address' field, letting the user enter any mac, and if it doesn't exist then create the MAC address and assign it automatically?
Or perhaps you could put a 'Add new MAC address' in the /add/ form what would open a MAC text field.

@tokkyuuressha commented on GitHub (Apr 30, 2025): I've noticed this issue as well. I understand it was caused by introduction of multiple mac address feature. In my opinion there should be a way to add a device with single MAC address(which is likely majority of devices) as it used to be all along. Having to go through the same edit dialog second time just to add the MAC address wastes a lot of time. Can't understate how confusing it is (given that it is a recent change) and every member of my team went through it scratching their head. How about disabling validation on the 'Primary MAC address' field, letting the user enter any mac, and if it doesn't exist then create the MAC address and assign it automatically? Or perhaps you could put a 'Add new MAC address' in the /add/ form what would open a MAC text field.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 30, 2025):

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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jul 30, 2025): 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. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Author
Owner

@jlundstrom commented on GitHub (Aug 21, 2025):

Bulk updating/adding MAC addresses was a feature from issue #2733 that was previously implemented.

Currently (v4.3.6) when creating a new interface on an existing device there is an option to add a Primary MAC (which fails with the above error). I would think it's possible to take ownership of the unassigned MAC and create MAC address objects to assign to the remaining ports if interfaces are being bulk created. The bulk edit should also be able to do something similar.

@jlundstrom commented on GitHub (Aug 21, 2025): Bulk updating/adding MAC addresses was a feature from issue #2733 that was previously implemented. Currently (v4.3.6) when creating a new interface on an existing device there is an option to add a Primary MAC (which fails with the above error). I would think it's possible to take ownership of the unassigned MAC and create MAC address objects to assign to the remaining ports if interfaces are being bulk created. The bulk edit should also be able to do something similar.
Author
Owner

@jeremystretch commented on GitHub (Aug 21, 2025):

@jlundstrom would you like to volunteer to implement this feature request?

@jeremystretch commented on GitHub (Aug 21, 2025): @jlundstrom would you like to volunteer to implement this feature request?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10880