Netbox assigns additionally old (deleted) interface to device #6656

Closed
opened 2025-12-29 19:43:35 +01:00 by adam · 2 comments
Owner

Originally created by @swgATpj on GitHub (Jul 14, 2022).

NetBox version

v3.2.1

Python version

3.10

Steps to Reproduce

  1. Creating new device + interface (f.e. with name 'intf01')
  2. Deleting both
  3. Creating new device + interface (f.e. with name 'intf02')

Also here is the code (snipped) I use with the pynetbox-api to create and assign an interface to an existing/new created device:

pyNetApi = pynetbox.api(
    '<my netbox-url>',
    token='<token>'
    )

intf = self.pyNetApi.dcim.interfaces.create(
                device = dev.id,
                name = name,
                type = intf_type,
                mac_address = mac,
                description = descr
)

Expected Behavior

Assigned interface to device is only {'intf02'}

Observed Behavior

Assigned interface to device is now {'intf01', 'intf02'}
Also the old (deleted) interfaces will added randomly to other devices, which never had assigned the interface.
There is nothing wrong with my code, checked already x-times.

Originally created by @swgATpj on GitHub (Jul 14, 2022). ### NetBox version v3.2.1 ### Python version 3.10 ### Steps to Reproduce 1. Creating new device + interface (f.e. with name 'intf01') 2. Deleting both 3. Creating new device + interface (f.e. with name 'intf02') Also here is the code (snipped) I use with the pynetbox-api to create and assign an interface to an existing/new created device: ``` pyNetApi = pynetbox.api( '<my netbox-url>', token='<token>' ) intf = self.pyNetApi.dcim.interfaces.create( device = dev.id, name = name, type = intf_type, mac_address = mac, description = descr ) ``` ### Expected Behavior Assigned interface to device is only {'intf02'} ### Observed Behavior Assigned interface to device is now {'intf01', 'intf02'} Also the old (deleted) interfaces will added randomly to other devices, which never had assigned the interface. There is nothing wrong with my code, checked already x-times.
adam closed this issue 2025-12-29 19:43:35 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jul 14, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

Also as is written in the bug report template:

If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox.

@kkthxbye-code commented on GitHub (Jul 14, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports. Also as is written in the bug report template: > If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox.
Author
Owner

@jeremystretch commented on GitHub (Jul 15, 2022):

There is nothing wrong with my code, checked already x-times.

I suspect that if you share your code in a discussion, you'll find that people are willing to help sort out the problem. However, this is not a bug in NetBox, so I'm going to close this issue.

@jeremystretch commented on GitHub (Jul 15, 2022): > There is nothing wrong with my code, checked already x-times. I suspect that if you share your code in a [discussion](https://github.com/netbox-community/netbox/discussions/new), you'll find that people are willing to help sort out the problem. However, this is not a bug in NetBox, so I'm going to close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6656