IP Address list API showing duplicate objects when using VRFs and duplicate IPs #4273

Closed
opened 2025-12-29 18:34:21 +01:00 by adam · 2 comments
Owner

Originally created by @tyler-8 on GitHub (Nov 13, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: v3.6.8
  • NetBox version: v2.9.9

Steps to Reproduce

  1. Create 10 VRFs
  2. Create the IP address 5.5.5.5/32 10 times, using one of the 10 VRFs each time
  3. Do a GET on /api/ipam/ip-addresses/?limit=2&offset=0 and record the IDs of each IP address (list or Counter object)
  4. Increase the offset by 2 (or follow the next URL) and record all IDs.
  5. Count the number of times each ID appears in the full dataset

Expected Behavior

A list of 10 unique IP address objects.

Observed Behavior

Object/IDs appears more than once (more IPs = more duplicates). I tested this on v2.8.8 using a more expansive dataset (hundreds of thousands of IPs giving several thousand duplicated objects) as well as a fresh clean install of v2.9.9 using the above steps and getting 1 duplicate object.

[Edit] I forgot to mention that this is causing data to be missing. Using the above steps, one of those 10 IPs will be missing from the list as it's "overwritten" by the duplicate.

Based on a few past issues that were for related problems, I'm guessing that vrf may need to be added to the ordering attribute but haven't verified that myself.

Originally created by @tyler-8 on GitHub (Nov 13, 2020). Originally assigned to: @jeremystretch on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. 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/g/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, and that any plugins have been disabled. --> ### Environment * Python version: v3.6.8 * NetBox version: v2.9.9 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. 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 client library such as pynetbox. --> ### Steps to Reproduce 1. Create 10 VRFs 2. Create the IP address `5.5.5.5/32` 10 times, using one of the 10 VRFs each time 3. Do a `GET` on `/api/ipam/ip-addresses/?limit=2&offset=0` and record the IDs of each IP address (`list` or `Counter` object) 4. Increase the `offset` by 2 (or follow the `next` URL) and record all IDs. 5. Count the number of times each ID appears in the full dataset <!-- What did you expect to happen? --> ### Expected Behavior A list of 10 unique IP address objects. <!-- What happened instead? --> ### Observed Behavior Object/IDs appears more than once (more IPs = more duplicates). I tested this on **v2.8.8** using a more expansive dataset (hundreds of thousands of IPs giving several thousand duplicated objects) as well as a fresh clean install of **v2.9.9** using the above steps and getting 1 duplicate object. [Edit] I forgot to mention that this is causing data to be missing. Using the above steps, one of those 10 IPs will be missing from the list as it's "overwritten" by the duplicate. Based on a few past issues that were for related problems, I'm guessing that `vrf` may need to be added to the `ordering` attribute but haven't verified that myself.
adam added the type: bugstatus: accepted labels 2025-12-29 18:34:21 +01:00
adam closed this issue 2025-12-29 18:34:21 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 16, 2020):

Looks like this was missed when addressing #4871.

@jeremystretch commented on GitHub (Nov 16, 2020): Looks like this was missed when addressing #4871.
Author
Owner

@jeremystretch commented on GitHub (Nov 16, 2020):

I've addressed this issue for IP addresses and prefixes for now, though we may want to take another look at how we enforce ordering as part of #4865.

@jeremystretch commented on GitHub (Nov 16, 2020): I've addressed this issue for IP addresses and prefixes for now, though we may want to take another look at how we enforce ordering as part of #4865.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4273