Issue with prefix filters in 3.0 #5245

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

Originally created by @trrunde on GitHub (Aug 30, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.0

Python version

3.8

Steps to Reproduce

Click prefixes, select filters and apply the following filters:
status: Container
Role: some prefix role you have, I used openvpn
mask-length: 23

Apply filter and you will get a TypeError, python is expecting a string but getting an integer

Expected Behavior

Filter to be applied

Observed Behavior

The complete exception is provided below:

<class 'TypeError'>

sequence item 1: expected str instance, int found

Python version: 3.8.6
NetBox version: 3.0.0
Screenshot-20210830214313-655x496

Originally created by @trrunde on GitHub (Aug 30, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.0 ### Python version 3.8 ### Steps to Reproduce Click prefixes, select filters and apply the following filters: status: Container Role: some prefix role you have, I used openvpn mask-length: 23 Apply filter and you will get a TypeError, python is expecting a string but getting an integer ### Expected Behavior Filter to be applied ### Observed Behavior The complete exception is provided below: <class 'TypeError'> sequence item 1: expected str instance, int found Python version: 3.8.6 NetBox version: 3.0.0 ![Screenshot-20210830214313-655x496](https://user-images.githubusercontent.com/1595396/131395829-d8a951e6-da5a-460e-a6ee-d8fa1321d45f.png)
adam added the type: bugstatus: accepted labels 2025-12-29 19:25:51 +01:00
adam closed this issue 2025-12-29 19:25:51 +01:00
Author
Owner

@trrunde commented on GitHub (Aug 30, 2021):

I also tried to apply a filter where I only filters on Status: Container OR role: openvpn
it gives same TypeError with only one filter applied to.

@trrunde commented on GitHub (Aug 30, 2021): I also tried to apply a filter where I only filters on Status: Container OR role: openvpn it gives same TypeError with only one filter applied to.
Author
Owner

@rodvand commented on GitHub (Aug 30, 2021):

It seems to be the "mask length" causing the issue. Can reproduce with only selecting a mask length as filter on my test instance, as well as the beta NetBox site (https://beta-demo.netbox.dev/ipam/prefixes/?mask_length__lte=&q=&within_include=&family=&mask_length=4&is_pool=&mark_utilized=&present_in_vrf_id=)

@rodvand commented on GitHub (Aug 30, 2021): It seems to be the "mask length" causing the issue. Can reproduce with only selecting a mask length as filter on my test instance, as well as the beta NetBox site (https://beta-demo.netbox.dev/ipam/prefixes/?mask_length__lte=&q=&within_include=&family=&mask_length=4&is_pool=&mark_utilized=&present_in_vrf_id=)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5245