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

IPAM prefixes list view throwing AttributeError #3944

Closed
ktims opened this issue Jan 17, 2020 · 3 comments
Closed

IPAM prefixes list view throwing AttributeError #3944

ktims opened this issue Jan 17, 2020 · 3 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ktims
Copy link

ktims commented Jan 17, 2020

Environment

  • Python version: 3.6.7
  • NetBox version: 2.7.0

Steps to Reproduce

  1. Visit /ipam/prefixes

Template to be rendered normally.

<class 'AttributeError'>

'IPAddress' object has no attribute 'ip'

The full backtrace from the log is here.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels Jan 17, 2020
@jeremystretch
Copy link
Member

This is a regression introduced by changes to BaseIPField in #3525. Working on a fix.

@jeremystretch jeremystretch self-assigned this Jan 17, 2020
@jeremystretch
Copy link
Member

Also need to extend our tests to catch errors like this.

@ktims
Copy link
Author

ktims commented Jan 17, 2020

Another instance found on /ipam/ip-addresses/

Traceback (most recent call last):
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/contrib/auth/mixins.py", line 85, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/srv/netbox/.env/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/srv/netbox/netbox/ipam/views.py", line 661, in get
    vrf=ipaddress.vrf, prefix__net_contains=str(ipaddress.address.ip)
AttributeError: 'IPAddress' object has no attribute 'ip'

I was about to submit a PR for these two, but it's trivial and looks like you're on it.

@jeremystretch jeremystretch changed the title IPAM prefixes list view throwing AttributeError - 2.7.0 regression IPAM prefixes list view throwing AttributeError Jan 17, 2020
@jeremystretch jeremystretch pinned this issue Jan 17, 2020
This was referenced Jan 17, 2020
@jeremystretch jeremystretch unpinned this issue Jan 17, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants