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

Cannot view device with primary IP assigned - AttributeError: 'NoneType' object has no attribute 'napalm_driver' #10946

Closed
kkthxbye-code opened this issue Nov 17, 2022 · 0 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@kkthxbye-code
Copy link
Contributor

kkthxbye-code commented Nov 17, 2022

NetBox version

v3.4-beta1

Python version

3.10

Steps to Reproduce

  1. Create a device testdevice (make sure it has no platform assigned)
  2. Create an IP 10.0.0.1/32
  3. Assign the IP as primary ipv4 address
  4. View the device

Expected Behavior

Device is shown

Observed Behavior

Traceback (most recent call last):
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/main/devel/repos/netbox/netbox/netbox/views/generic/base.py", line 13, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/home/main/devel/repos/netbox/netbox/utilities/views.py", line 99, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/main/devel/repos/netbox/netbox/netbox/views/generic/object_views.py", line 70, in get
    return render(request, self.get_template_name(), {
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/backends/django.py", line 62, in render
    return self.template.render(context)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/base.py", line 175, in render
    return self._render(context)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/test/utils.py", line 111, in instrumented_test_render
    return self.nodelist.render(context)
 ...
    return self.render(context)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/loader_tags.py", line 63, in render
    result = block.nodelist.render(context)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "/home/main/devel/repos/netbox/venv/lib/python3.10/site-packages/django/template/library.py", line 258, in render
    _dict = self.func(*resolved_args, **resolved_kwargs)
  File "/home/main/devel/repos/netbox/netbox/utilities/templatetags/tabs.py", line 35, in model_view_tabs
    if attrs := tab.render(instance):
  File "/home/main/devel/repos/netbox/netbox/dcim/views.py", line 2075, in render
    instance.platform.napalm_driver
AttributeError: 'NoneType' object has no attribute 'napalm_driver'
@kkthxbye-code kkthxbye-code added the type: bug A confirmed report of unexpected behavior in the application label Nov 17, 2022
@kkthxbye-code kkthxbye-code added status: accepted This issue has been accepted for implementation beta Concerns a bug/feature in a beta release labels Nov 17, 2022
@kkthxbye-code kkthxbye-code self-assigned this Nov 17, 2022
jeremystretch added a commit that referenced this issue Nov 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release 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