You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entered "39/KFFN/111376/TWCS" (no quotes) in the search field and received the error message below.
It seems that it interpreted a number and slash as an IP/prefix and it doesn't allow that. I'd think the simplest solution would be to check for alpha characters and if present assume it's not an IP.
Internal Server Error: /search/
ValueError at /search/
IPAddress() does not support netmasks or subnet prefixes! See documentation for details.
File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/site-packages/django/views/generic/base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "/opt/netbox/netbox/netbox/views.py" in get
191. filtered_queryset = filter_cls({'q': form.cleaned_data['q']}, queryset=queryset).qs
File "/usr/lib/python2.7/site-packages/django_filters/filterset.py" in qs
214. qs = filter_.filter(qs, value)
File "/usr/lib/python2.7/site-packages/django_filters/filters.py" in call
687. return self.method(qs, self.f.name, value)
File "/opt/netbox/netbox/ipam/filters.py" in search
86. prefix = str(IPNetwork(value.strip()).cidr)
File "/usr/lib/python2.7/site-packages/netaddr/ip/init.py" in init
923. implicit_prefix, flags)
File "/usr/lib/python2.7/site-packages/netaddr/ip/init.py" in parse_ip_network
805. mask = IPAddress(val2, module.version, flags=INET_PTON)
File "/usr/lib/python2.7/site-packages/netaddr/ip/init.py" in init
280. % self.class.name)
Exception Type: ValueError at /search/
Exception Value: IPAddress() does not support netmasks or subnet prefixes! See documentation for details.
Request information:
USER: gozer
Issue type:
Bug Report
Python version: 2.7.5
NetBox version: v2.0.4
Entered "39/KFFN/111376/TWCS" (no quotes) in the search field and received the error message below.
It seems that it interpreted a number and slash as an IP/prefix and it doesn't allow that. I'd think the simplest solution would be to check for alpha characters and if present assume it's not an IP.
The text was updated successfully, but these errors were encountered: