ASN Ranges are not searchable by name #10262

Closed
opened 2025-12-29 21:29:05 +01:00 by adam · 5 comments
Owner

Originally created by @dmulyalin on GitHub (Sep 19, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.1.1

Python Version

3.10

Steps to Reproduce

  1. Go to IPAM -> ASN Ranges
  2. Add new range, give it a name
  3. Try to search range by name either using global search or by using quick search or by using search

Expected Behavior

Searching ranges by name works

Observed Behavior

Ranges are not searchable by name, I remember that was working in 3.7.8 version

Originally created by @dmulyalin on GitHub (Sep 19, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.1.1 ### Python Version 3.10 ### Steps to Reproduce 1. Go to IPAM -> ASN Ranges 2. Add new range, give it a name 3. Try to search range by name either using global search or by using quick search or by using search ### Expected Behavior Searching ranges by name works ### Observed Behavior Ranges are not searchable by name, I remember that was working in 3.7.8 version
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:29:05 +01:00
adam closed this issue 2025-12-29 21:29:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 19, 2024):

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.

@jeremystretch commented on GitHub (Sep 19, 2024): 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.
Author
Owner

@dmulyalin commented on GitHub (Sep 20, 2024):

Updated steps to reproduce @jeremystretch

@dmulyalin commented on GitHub (Sep 20, 2024): Updated steps to reproduce @jeremystretch
Author
Owner

@dmulyalin commented on GitHub (Sep 20, 2024):

Tested it on Netbox 3.7.8, 4.0.10 and 4.1.1 - all having same behavior, ASN Ranges are not searchable by their name, should this search index have added name field to get it working - 2dd5c82845/netbox/ipam/search.py (L29)

The way how I came across the issue was running custom script to pull ASN ranges using this query for dropdown menu form, but it is not returning all ASN ranges, only some of them, it is working fine on 3.7.8 but not on 4.x - all existing asn ranges were available in drop down on 3.7.8 while only some on 4.0.10/4.1.1.:

from ipam.models import ASNRange, ASN, RIR
from extras.scripts import *

class test_asn_ranges(Script):
   
    asn_range = ObjectVar(
        label="ASN Range",
        description="Name of the ASN Range",
        model=ASNRange,
    ) 

    def run(self, data, commit):
        pass
@dmulyalin commented on GitHub (Sep 20, 2024): Tested it on Netbox 3.7.8, 4.0.10 and 4.1.1 - all having same behavior, ASN Ranges are not searchable by their name, should this search index have added name field to get it working - https://github.com/netbox-community/netbox/blob/2dd5c82845a1eab2a746cbeec33a350ac4e4a1dc/netbox/ipam/search.py#L29 The way how I came across the issue was running custom script to pull ASN ranges using this query for dropdown menu form, but it is not returning all ASN ranges, only some of them, it is working fine on 3.7.8 but not on 4.x - all existing asn ranges were available in drop down on 3.7.8 while only some on 4.0.10/4.1.1.: ``` from ipam.models import ASNRange, ASN, RIR from extras.scripts import * class test_asn_ranges(Script): asn_range = ObjectVar( label="ASN Range", description="Name of the ASN Range", model=ASNRange, ) def run(self, data, commit): pass ```
Author
Owner

@dmulyalin commented on GitHub (Sep 20, 2024):

Oh, actually I know why it was working for some asn ranges and for some not on version 4.0.10/4.1.1, cause ASNRangeIndex uses description to search for asn range:
2dd5c82845/netbox/ipam/search.py (L34)

and I did populate description field with value equal to range name for some of them but not for all.

@dmulyalin commented on GitHub (Sep 20, 2024): Oh, actually I know why it was working for some asn ranges and for some not on version 4.0.10/4.1.1, cause ASNRangeIndex uses description to search for asn range: https://github.com/netbox-community/netbox/blob/2dd5c82845a1eab2a746cbeec33a350ac4e4a1dc/netbox/ipam/search.py#L34 and I did populate description field with value equal to range name for some of them but not for all.
Author
Owner

@dmulyalin commented on GitHub (Sep 23, 2024):

If possible, could ASN range search index be updated to include ASN Range's name field please.

@dmulyalin commented on GitHub (Sep 23, 2024): If possible, could ASN range search index be updated to include ASN Range's name field please.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10262