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

'NoneType' object has no attribute 'pk' #11006

Closed
aiv opened this issue Nov 23, 2022 · 1 comment
Closed

'NoneType' object has no attribute 'pk' #11006

aiv opened this issue Nov 23, 2022 · 1 comment
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@aiv
Copy link

aiv commented Nov 23, 2022

NetBox version

v3.3.5

Python version

3.8

Steps to Reproduce

  1. Try to edit ip address assigned to virtual machine with nat on that ip

Expected Behavior

Edit form

Observed Behavior

<class 'AttributeError'>

'NoneType' object has no attribute 'pk'

Python version: 3.8.10
NetBox version: 3.3.5

and in logs:

Internal Server Error: /ipam/ip-addresses/2567/edit/
Traceback (most recent call last):
  File "/opt/netbox-3.3.5/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/netbox-3.3.5/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-3.3.5/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 84, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 302, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 90, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox-3.3.5/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 119, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 353, in get
    form = self.form(instance=obj, initial=initial_data)
  File "/opt/netbox/netbox/ipam/forms/models.py", line 420, in __init__
    initial['nat_cluster'] = nat_inside_parent.virtual_machine.cluster.pk
AttributeError: 'NoneType' object has no attribute 'pk'
@aiv aiv added the type: bug A confirmed report of unexpected behavior in the application label Nov 23, 2022
@kkthxbye-code
Copy link
Contributor

Duplicate of #10997

@kkthxbye-code kkthxbye-code marked this as a duplicate of #10997 Nov 23, 2022
@kkthxbye-code kkthxbye-code closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants