Closed pboatone closed 3 years ago
This issue is pending closure as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Updated post on top
Could you include the backtrace (should have been emailed hopefully if you configured that)?
not the original poster, but have the same (I reckon) problem.
Environment:
Request Method: GET
Request URL: https://netbox.company.name/ipam/ip-addresses/2384/edit/
Django Version: 3.1
Python Version: 3.7.9
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'cacheops',
'corsheaders',
'debug_toolbar',
'django_filters',
'django_tables2',
'django_prometheus',
'mptt',
'rest_framework',
'taggit',
'timezone_field',
'circuits',
'dcim',
'ipam',
'extras',
'secrets',
'tenancy',
'users',
'utilities',
'virtualization',
'django_rq',
'drf_yasg']
Installed Middleware:
['debug_toolbar.middleware.DebugToolbarMiddleware',
'django_prometheus.middleware.PrometheusBeforeMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'utilities.middleware.ExceptionHandlingMiddleware',
'utilities.middleware.RemoteUserMiddleware',
'utilities.middleware.LoginRequiredMiddleware',
'utilities.middleware.APIVersionMiddleware',
'extras.middleware.ObjectChangeMiddleware',
'django_prometheus.middleware.PrometheusAfterMiddleware']
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 73, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 392, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 123, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 101, in dispatch
return handler(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 398, in get
form = self.model_form(instance=obj, initial=initial_data)
File "/opt/netbox/netbox/ipam/forms.py", line 623, in __init__
initial['nat_rack'] = nat_inside_parent.device.rack.pk
Exception Type: AttributeError at /ipam/ip-addresses/165/edit/
Exception Value: 'NoneType' object has no attribute 'pk'
Netbox 2.9.7 from official docker image. the IP in question has NAT, and was created in a previous Netbox version (2.9.4, probably). other IPs do not trigger this error.
I'm not able to reproduce this behavior on v2.9.7 using the information provided.
I have the same problem
Python version: 3.6.9 NetBox version: 2.9.8
Steps to Reproduce :
Expected Behavior : User should be presented with the IP edit form
Observed Behavior : An AttributeError exception is raised:
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/netbox/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 73, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 392, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 123, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/netbox/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 101, in dispatch
return handler(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 398, in get
form = self.model_form(instance=obj, initial=initial_data)
File "/opt/netbox/netbox/ipam/forms.py", line 623, in __init__
initial['nat_rack'] = nat_inside_parent.device.rack.pk
Exception Type: AttributeError at /ipam/ip-addresses/3547/edit/
Exception Value: 'NoneType' object has no attribute 'pk'
I guess it's related to https://github.com/netbox-community/netbox/issues/5022 and to nat_inside_parent.device.rack wich can be None
Environment
Steps to Reproduce
Expected Behavior
Expekted is that we want to edit this ip agein.
Observed Behavior
Originally posted by @pboatone in https://github.com/netbox-community/netbox/issues/5198#issuecomment-707121822