mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-11 21:10:29 +01:00
Empty search result for interfaces, power-ports, power-outlets #11805
Open
opened 2025-12-29 21:50:03 +01:00 by adam
·
10 comments
No Branch/Tag Specified
main
update-changelog-comments-docs
feature-removal-issue-type
20911-dropdown
20239-plugin-menu-classes-mutable-state
21097-graphql-id-lookups
feature
fix_module_substitution
20923-dcim-templates
20044-elevation-stuck-lightmode
feature-ip-prefix-link
v4.5-beta1-release
20068-import-moduletype-attrs
20766-fix-german-translation-code-literals
20378-del-script
7604-filter-modifiers-v3
circuit-swap
12318-case-insensitive-uniqueness
20637-improve-device-q-filter
20660-script-load
19724-graphql
20614-update-ruff
14884-script
02496-max-page
19720-macaddress-interface-generic-relation
19408-circuit-terminations-export-templates
20203-openapi-check
fix-19669-api-image-download
7604-filter-modifiers
19275-fixes-interface-bulk-edit
fix-17794-get_field_value_return_list
11507-show-aggregate-and-rir-on-api
9583-add_column_specific_search_field_to_tables
v4.5.0
v4.4.10
v4.4.9
v4.5.0-beta1
v4.4.8
v4.4.7
v4.4.6
v4.4.5
v4.4.4
v4.4.3
v4.4.2
v4.4.1
v4.4.0
v4.3.7
v4.4.0-beta1
v4.3.6
v4.3.5
v4.3.4
v4.3.3
v4.3.2
v4.3.1
v4.3.0
v4.2.9
v4.3.0-beta2
v4.2.8
v4.3.0-beta1
v4.2.7
v4.2.6
v4.2.5
v4.2.4
v4.2.3
v4.2.2
v4.2.1
v4.2.0
v4.1.11
v4.1.10
v4.1.9
v4.1.8
v4.2-beta1
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.11
v4.0.10
v4.0.9
v4.1-beta1
v4.0.8
v4.0.7
v4.0.6
v4.0.5
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.7.8
v3.7.7
v4.0-beta2
v3.7.6
v3.7.5
v4.0-beta1
v3.7.4
v3.7.3
v3.7.2
v3.7.1
v3.7.0
v3.6.9
v3.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r1
v1.0.3
1.0.0
Labels
Clear labels
beta
breaking change
complexity: high
complexity: low
complexity: medium
needs milestone
netbox
pending closure
plugin candidate
pull-request
severity: high
severity: low
severity: medium
status: accepted
status: backlog
status: blocked
status: duplicate
status: needs owner
status: needs triage
status: revisions needed
status: under review
topic: GraphQL
topic: Internationalization
topic: OpenAPI
topic: UI/UX
topic: cabling
topic: event rules
topic: htmx navigation
topic: industrialization
topic: migrations
topic: plugins
topic: scripts
topic: templating
topic: testing
type: bug
type: deprecation
type: documentation
type: feature
type: housekeeping
type: translation
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/netbox#11805
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @simonzsay on GitHub (Nov 3, 2025).
NetBox Edition
NetBox Community
NetBox Version
v4.4.1-Docker-3.4.0
Python Version
3.12
Steps to Reproduce
/dcim/interfaces/?site_id=35&location_id=50&rack_id=82&device_role=node&device_role=singlenode
/dcim/power-outlets/?site_id=11&location_id=7&rack_id=5&connected=false
/dcim/power-ports/?site_id=11&location_id=7&rack_id=5
or i can edit device from UI and save it without changes, which i guess will make dev.save() as well, but from UI.
Expected Behavior
I expect to see records in "power-ports, power-outlets, interfaces" tabs without filters and especially according to filters ive set - "site,location,rack, etc..."
Observed Behavior
Search result is empty until the moment i re-save device (or it`s power-port\interface btw) or make nbshell commands.
@bctiemann commented on GitHub (Nov 3, 2025):
Thanks @simonzsay , it sounds like something may have changed the behavior of reindexing
SearchIndexobjects after populating a device with templated components.To properly reproduce this, could you please provide specifics of how your device type template is set up so that someone working on this can be sure to catch all the details?
Also, could you please try running
manage.py reindexand see if that causes the search results to be refreshed properly? (That would confirm the theory above.)@simonzsay commented on GitHub (Nov 4, 2025):
Dear @bctiemann thank you for very fast reply. I`ll provide more details as requested. Please give me some time)
@simonzsay commented on GitHub (Nov 4, 2025):
@bctiemann First of all manage.py reindex result. Unfortunately, didn`t help me to fix problem.
After this command goto /dcim/power-ports/?site_id=35&location_id=50&rack_id=82 and expect to see all power ports in rack, but search is empty.
And now about specifics. I will try to explain methods how i tested\reproduce the issue.
Let`s say i work with the following devices: PDU, Multinode server.
PDU device-type has:
-> Take a look at screenshot with PDU please.
Miltinode server device-type has:
This means that Netbox also has:
-> Take a look at screenshot with Multinode server please.
-> Take a look at screenshot with Motherboard for Multinode server please.
-> Take a look at screenshot with PSU for Multinode server please.
In this case i don`t use prefixes aka {module} in types.
How we add device\module types and real devices:
Methods we use depend on situation. Smth tells that testing via UI here will be the most correct way.
I created new PDU from template (same as above) via UI and run /dcim/power-outlets/?site_id=22&location_id=70&rack_id=13&connected=false
I created new device-type for PDU (clone as above) via UI and crated new PDU from new template and run /dcim/power-outlets/?site_id=22&location_id=70&rack_id=13&connected=false
Both times - empty search result. The problem is general, with all types of devices (not only with PDU and some servers).
Please let me know if i should add more info in future comments.
@jnovinger commented on GitHub (Nov 20, 2025):
@simonzsay, thanks for the extra details. The first thing I want to do is make sure that we're all on the same page with respect to concepts here. In particular, the issue indicates this is a bug with search, however that is a very vague term in NetBox context. There are a couple of things at play:
global search (
/search/), which is available as the very top input field in pretty much every page in NetBox.list view "quick search", the left-most input field above tables in object list views, immediately to the left of of the Saved Filters field. This is actually implemented as a filter (described next) and is usually defined to search pertinent text fields on objects (or sometimes related objects) in the table immediately below the field. This often searches against the
namefield, for instance, and almost always uses the "contains" lookup, which finds sub-strings within the text fields to be searched.filters, which are found on the "Filters" tab in object list views, but not (usually?) found on child list views (the Interfaces tab of a Device). These allow picking fields to filter the object list against, including things like sites, locations, racks, device role, etc.
While the first two items (global search and quick search) above provide some amount of "free text search", while filters generally provide very specific filtering, currently using pretty strict equality (at least from the filter forms, you can do not exact lookups by manually modifying the URL yourself). I'm trying to be precise here, because each of these things works differently, so it's very important to make sure we're talking about the same things.
I think the early history of this issue confused these items. For instance, the title of the issue just says "empty search results", which clearly led Brian to believe this was a global search issue, as evidenced by his suggestion to run
./manage.py reindexand why it didn't work for you. Then, the steps to reproduce provide URL fragments which are clearly attempting to invoke filters. The provided URL fragments are also referencing other object IDs, which are incredibly NetBox instance specific. You'resite_idof 35 is almost surely not the samesite_idin my instance. You can see how this is very confusing to someone trying to triage a bug report like this with only the information provided.All of this to say, I am not able to reproduce your issue. In order for us to make any further progress on this bug report we need exhaustive and explicit and detailed steps to reproduce the bug. That doesn't mean screenshots. It doesn't mean summaries. It doesn't mean abbreviations or vague terms. For instance, "device-type template" is not a thing and using that term leaves the maintainers that have to try to understand the bug guessing as to what you are trying to communicate. For a moment, I wondered if you meant the Device Type Library repo.
When a step, in your "steps to reproduce", says "create a ", you need to include all of the non-default values you used and in what fields you used them. When a steps says "add MDB", you need to specify exactly what "MDB" is (it took me 5+ minutes of reading to figure out you meant "motherboard"), what steps you took to create it, and exactly how you used it. Every step needs to include all of the details we need to reproduce your exact issue, at a minimum.
@simonzsay commented on GitHub (Nov 21, 2025):
Dear @jnovinger, thanks, i've got you. Also, thanks for the instructions how to report an issues i hope i can improve my language and terms next time.
Regarding the current case, i will try to construct discussed minimum details next week. Apologize that i can`t do it faster.
@simonzsay commented on GitHub (Nov 24, 2025):
Dear @jnovinger my comments below.
https://example.nb.net/dcim/power-outlets/?site_id=74&location_id=89&rack_id=179&connected=false
At the very beginning, months ago I went to the "Filters" tab, selected filters via the UI, and watched how NetBox constructed the URL, just to understand the logic. So this issue is specifically about Filters (URL-based filtering), not global search or the list view quick search.
Also, the issue title has words "interfaces, power-ports, power-outlets", but for testing purposes i would like to concentrate only at power-ports. This is the shortest way for making tests and i hope it will save your time a bit. I think (maybe i am wrong) all problems have one nature and if i can fix an issue with power-port i can fix other sources same way later. So, everything below about testing power-port filters.
This weekend i had to update Netbox to the new version and install "custom objects plugin". Changes in docker containers versions (this is just text from playbooks, not anything Netbox related):
From:
netbox_version: "v4.4.1-3.4.0"
postgres_version: "17-alpine"
netbox_custom_objects: null
Changed to:
netbox_version: "v4.4.6-3.4.2"
postgres_version: "17-alpine"
netbox_custom_objects: "v0.4.1"
Inside extra.py ive added the following configs:
For Sites, i have to create custom field choices and custom field linked to this choice set. I don` t know if i have to list them all. Currently i have 9 choices, but i changed names. Names might have uppercase,lowercase, dots,quotes symbols and non-English words.
and
Also, i have to create tenant group "MyCompanyGroup"
and tenant "MyCompany" (you could see here a lot of other custom fields, but they appeared after i first time saw the bug, however if needed i can list them in my next comments)
Create Region (will be top level parent) "North America"
Create Region (will be child for top level parent) "United States"
Create Region (will be child for child of top level parent) "Los Angeles"
Create Site "MyTestSite" (represent Data Center)
Create Location "MytestLocation"
Create Manufacturer for rack "Generic", Rack Roles "Mixed", Rack Types "Rack 42U (Narrow)", Rack "MyTestRack", Power feeds ( i show only rack, but inside you can see related objects - type, role, etc, please tell if i have to list them all, but it will be rather huge list...)
Create manufacturer "APC" and device type ""AP7922B" ( i show only device type, but inside you can see related objects - manufacturer, please tell if i have to list them all, but it will be rather huge list as well)
In addition to device type i created inside:
Create device "MyPDU1" and "MyPDU2" (only name,id,slug, position are different)
Crate custom link "Show all power ports"
Click on custom link from Rack page:
Click on "Fast actions" tab
Click on "Show free PDU outlets MyTestRack"
I expect to see 32 available ports (16 from each PDU AP7922B - MyPDU1 and MyPDU2), but list is empty.

Click edit button at myPDU1 page and save without changes. I see outlets now in UI for MyPDU1
This comment took me about four hours to write, so I understand it's still too difficult for an external specialist to fully understand all the details of our design. Maybe smth else affects my setup that i didn`t mentioned here, well, anyway this is why a here... to try find a way to fix it. However, I'm willing to provide as much information as possible further if needed.
@github-actions[bot] commented on GitHub (Dec 2, 2025):
This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.
@arthanson commented on GitHub (Dec 9, 2025):
@simonzsay What you have provided is something of a data-dump of your system, which is way too much information for us to try and go through and figure out the relevant parts and hopefully try and reproduce your issue. For example - I think it's very unlikely that 15 custom validators are required to reproduce this issue.
What we would need you to do is come up with a minimal data that will reproduce the problem, something like:
Just the minimum steps that you can find that helps to reproduce the issue. As Jason stated previously: "When a step, in your "steps to reproduce", says "create a ", you need to include all of the non-default values you used and in what fields you used them. When a steps says "add MDB", you need to specify exactly what "MDB" is (it took me 5+ minutes of reading to figure out you meant "motherboard"), what steps you took to create it, and exactly how you used it. Every step needs to include all of the details we need to reproduce your exact issue, at a minimum."
It is very important that it is narrowed down to the minimum steps needed to reproduce.
@simonzsay commented on GitHub (Dec 10, 2025):
Dear @arthanson, to be honest, I understand what you and your colleagues mean. I’m trying to provide as much information as possible about my custom changes because netbox is incredibly customizable — fortunately — and I don’t know whether any of these changes might have broken something or affected my setup. In netbox demo i cant reproduce an issue. I just had feeling that this is because of custom FIELD_CHOICES (i sent them before here ) I removed them from extra.py, didn`t help, same issue.
Nevertheless, I’m very grateful that netbox team still not giving up on this issue.
I’ve changed my approach. I deployed a fresh, empty netbox instance and tried to follow the steps to reproduce the problem. Comment is big because of json with all data, but it took around 10 minutes for me to make this test. Will be two parts - short and extended (extended i think you can skip).
Short:
Group Name - "FAST ACTIONS"
Link text - "Show free PDU outlets {{ object }}"
Link URL -"{{ '/dcim/power-outlets/?site_id=' ~ object.site.id ~ (object.location and '&location_id=' ~ object.location.id or '') ~ '&rack_id=' ~ object.id ~ '&connected=false' }}"
Extended:
@simonzsay commented on GitHub (Dec 10, 2025):
Started from scratch, but in demo netbox. Made same steps as above. I am feeling crazy, but see the same issue only at my PDU. Some PDUs made by other users shows free outlets correctly, but maybe they re-saved them as well. Ive added to some rack exiting device-type PDU (made by someone) and issue appeared for this new PDU in rack.
after re-save device...