Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: returns too many interfaces for VC member when filtering for device_id #13534

Closed
cs-1 opened this issue Aug 23, 2023 · 6 comments
Closed

Comments

@cs-1
Copy link

cs-1 commented Aug 23, 2023

NetBox version

v3.5.8

Python version

3.10

Steps to Reproduce

  1. Create a device a with x interfaces.
  2. Create a device b with y interfaces.
  3. Create virtual chassis and add both devices a and b.
  4. Make an API call at /api/dcim/interfaces and filter for device_id of device a.

Expected Behavior

Only interfaces for device "a" are returned.

Observed Behavior

Interfaces for device a and device b are returned.

This behaviour was different in NetBox v3.5.6, only interfaces of device "a" were returned when filtering for the according device_id.

When using the device name of device "a" as a filter criterium, only interfaces of device "a" are returned as expected.

@cs-1 cs-1 added the type: bug A confirmed report of unexpected behavior in the application label Aug 23, 2023
@jeremystretch
Copy link
Member

@DanSheps please have a look at this and see how it's impacted (if at all) by your PR #13296.

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Aug 23, 2023
@kkthxbye-code
Copy link
Contributor

kkthxbye-code commented Aug 23, 2023

This behaviour was different in NetBox v3.5.6, only interfaces of device "a" were returned when filtering for the according device_id.

I was unaware of any changes regarding this in 3.5.7 or 3.5.8, so I tested it locally and I cannot replicate it at all. Both 3.5.6 and 3.5.8 returns all interfaces in the chassis. This also bizarely bizarrely seems like a duplicate of your very own issue:

#11478

Please revise your replication steps to ensure that something actually changed in the two last patch versions. Maybe you made local changes to your netbox install that were removed when upgrading?

As to your questions @jeremystretch - I just tested #13296 and it does solve the issue here. However the issue was introduced in v3.3.6, so I'm assuming local modifications were made to @cs-1's netbox or something.

@kkthxbye-code kkthxbye-code added the status: revisions needed This issue requires additional information to be actionable label Aug 23, 2023
@DanSheps
Copy link
Member

I think @kkthxbye-code is right on the money in that this has for the most part been consistent behaviour from the 2.x days.

That said, #13296 will resolve this as it will make the device filters only return relevant device interfaces and virtual_chassis_member will now return interfaces for the VC unless filtered further.

@cs-1
Copy link
Author

cs-1 commented Aug 25, 2023

We didn't make any local changes to our code, it's the release code from the NetBox's git repo. The issue can be reproduced in the Swagger interface too, see the two screenshots. Note the "count" attribute of the returned JSON and also note that the device ID is "870" in both cases. If #13296 resolves this issue as @DanSheps says it's perfectly fine for me. I did not assume that this was a dupe of #11478 because the API used to return only the interfaces of a specific chassis before when querying for the device_id and it struck me as odd that I don't get the same results when querying the same device by ID and by name.

Query using device ID
Query using device ID

Query using device name
Query using device name

Anyhow, if #13296 resolves this, all is fine.

@kkthxbye-code
Copy link
Contributor

kkthxbye-code commented Aug 25, 2023

This behaviour was different in NetBox v3.5.6, only interfaces of device "a" were returned when filtering for the according device_id.
because the API used to return only the interfaces of a specific chassis before when querying for the device_id and it struck me as odd that I don't get the same results when querying the same device by ID and by name.

I think you are missing the point again.

Here's where we're at:

Before v3.3.6:

  • Filtering by device id returned only the devices interfaces.
  • Filtering by device name returned only the devices interfaces.

After v3.3.6:

  • Filtering by device id returns all vc interfaces..
  • Filtering by device name returned only the devices interfaces.

Nothing has changed regarding this between v3.5.6 and v3.5.8 as you claim it has. Also the above is exactly what is covered by your own issue #11478.

I'll close this out as a duplicate, but in the future please make sure there's actually been a change in the version you suggest. It wastes a lot of time for everyone.

@kkthxbye-code kkthxbye-code closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@kkthxbye-code kkthxbye-code removed type: bug A confirmed report of unexpected behavior in the application status: revisions needed This issue requires additional information to be actionable status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Aug 25, 2023
@cs-1
Copy link
Author

cs-1 commented Aug 28, 2023

I'll close this out as a duplicate, but in the future please make sure there's actually been a change in the version you suggest. It wastes a lot of time for everyone.

I'm sorry, it was an honest mistake, I accidentally checked v3.5.6 against a non-VC chassis.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants