Unable to edit individual interface #7375

Closed
opened 2025-12-29 20:22:36 +01:00 by adam · 8 comments
Owner

Originally created by @balpoint on GitHub (Dec 17, 2022).

NetBox version

v3.4.1

Python version

3.8

Steps to Reproduce

  1. Upgraded from 3.3.7 -> 3.4.0 (same issue with 3.4.1)
  2. Cannot get to the interface overview page under devices
  3. Cannot get into edit mode of a interface via a device page.

Expected Behavior

The edit page for that interface should be presented

Observed Behavior

<class 'AttributeError'>

'NoneType' object has no attribute 'objects'

Python version: 3.8.10
NetBox version: 3.4.1

Debug Info

`
Environment:

Request Method: GET
Request URL: https://netbox-acc.triple-it.nl/dcim/interfaces/

Django Version: 4.1.4
Python Version: 3.8.10
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'corsheaders',
'debug_toolbar',
'graphiql_debug_toolbar',
'django_filters',
'django_tables2',
'django_prometheus',
'graphene_django',
'mptt',
'rest_framework',
'social_django',
'taggit',
'timezone_field',
'circuits',
'dcim',
'ipam',
'extras',
'tenancy',
'users',
'utilities',
'virtualization',
'wireless',
'django_rq',
'drf_yasg',
'netbox_qrcode.QRCodeConfig',
'netbox_topology_views.TopologyViewsConfig']
Installed Middleware:
['graphiql_debug_toolbar.middleware.DebugToolbarMiddleware',
'django_prometheus.middleware.PrometheusBeforeMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'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',
'netbox.middleware.ExceptionHandlingMiddleware',
'netbox.middleware.RemoteUserMiddleware',
'netbox.middleware.LoginRequiredMiddleware',
'netbox.middleware.DynamicConfigMiddleware',
'netbox.middleware.APIVersionMiddleware',
'netbox.middleware.ObjectChangeMiddleware',
'django_prometheus.middleware.PrometheusAfterMiddleware']

Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/opt/netbox/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/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/netbox/views/generic/base.py", line 77, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/netbox/netbox/utilities/views.py", line 99, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 142, in dispatch
return handler(request, *args, **kwargs)
File "/opt/netbox/netbox/netbox/views/generic/bulk_views.py", line 172, in get
'filter_form': self.filterset_form(request.GET, label_suffix='') if self.filterset_form else None,
File "/opt/netbox/netbox/netbox/forms/base.py", line 155, in init
super().init(*args, **kwargs)
File "/opt/netbox/netbox/utilities/forms/forms.py", line 37, in init
super().init(*args, **kwargs)
File "/opt/netbox/netbox/extras/forms/mixins.py", line 30, in init
self._append_customfield_fields()
File "/opt/netbox/netbox/extras/forms/mixins.py", line 57, in _append_customfield_fields
self.fields[field_name] = self._get_form_field(customfield)
File "/opt/netbox/netbox/netbox/forms/base.py", line 170, in _get_form_field
return customfield.to_form_field(set_initial=False, enforce_required=False, enforce_visibility=False)
File "/opt/netbox/netbox/extras/models/customfields.py", line 414, in to_form_field
queryset=model.objects.all(),

Exception Type: AttributeError at /dcim/interfaces/
Exception Value: 'NoneType' object has no attribute 'objects'

`

Originally created by @balpoint on GitHub (Dec 17, 2022). ### NetBox version v3.4.1 ### Python version 3.8 ### Steps to Reproduce 1. Upgraded from 3.3.7 -> 3.4.0 (same issue with 3.4.1) 2. Cannot get to the interface overview page under devices 3. Cannot get into edit mode of a interface via a device page. ### Expected Behavior The edit page for that interface should be presented ### Observed Behavior <class 'AttributeError'> 'NoneType' object has no attribute 'objects' Python version: 3.8.10 NetBox version: 3.4.1 ### Debug Info ` Environment: Request Method: GET Request URL: https://netbox-acc.triple-it.nl/dcim/interfaces/ Django Version: 4.1.4 Python Version: 3.8.10 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'corsheaders', 'debug_toolbar', 'graphiql_debug_toolbar', 'django_filters', 'django_tables2', 'django_prometheus', 'graphene_django', 'mptt', 'rest_framework', 'social_django', 'taggit', 'timezone_field', 'circuits', 'dcim', 'ipam', 'extras', 'tenancy', 'users', 'utilities', 'virtualization', 'wireless', 'django_rq', 'drf_yasg', 'netbox_qrcode.QRCodeConfig', 'netbox_topology_views.TopologyViewsConfig'] Installed Middleware: ['graphiql_debug_toolbar.middleware.DebugToolbarMiddleware', 'django_prometheus.middleware.PrometheusBeforeMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', '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', 'netbox.middleware.ExceptionHandlingMiddleware', 'netbox.middleware.RemoteUserMiddleware', 'netbox.middleware.LoginRequiredMiddleware', 'netbox.middleware.DynamicConfigMiddleware', 'netbox.middleware.APIVersionMiddleware', 'netbox.middleware.ObjectChangeMiddleware', 'django_prometheus.middleware.PrometheusAfterMiddleware'] Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox/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/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/base.py", line 77, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 99, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 142, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/bulk_views.py", line 172, in get 'filter_form': self.filterset_form(request.GET, label_suffix='') if self.filterset_form else None, File "/opt/netbox/netbox/netbox/forms/base.py", line 155, in __init__ super().__init__(*args, **kwargs) File "/opt/netbox/netbox/utilities/forms/forms.py", line 37, in __init__ super().__init__(*args, **kwargs) File "/opt/netbox/netbox/extras/forms/mixins.py", line 30, in __init__ self._append_customfield_fields() File "/opt/netbox/netbox/extras/forms/mixins.py", line 57, in _append_customfield_fields self.fields[field_name] = self._get_form_field(customfield) File "/opt/netbox/netbox/netbox/forms/base.py", line 170, in _get_form_field return customfield.to_form_field(set_initial=False, enforce_required=False, enforce_visibility=False) File "/opt/netbox/netbox/extras/models/customfields.py", line 414, in to_form_field queryset=model.objects.all(), Exception Type: AttributeError at /dcim/interfaces/ Exception Value: 'NoneType' object has no attribute 'objects' `
adam added the type: bugstatus: revisions needed labels 2025-12-29 20:22:36 +01:00
adam closed this issue 2025-12-29 20:22:36 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Dec 17, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@kkthxbye-code commented on GitHub (Dec 17, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@balpoint commented on GitHub (Dec 17, 2022):

Well thats the thing... i've upgraded to 3.4.0 & then 3.4.1 and after this upgrade the interface overview page gives this error aswell as when i try to go and edit a specific interface from a device view.

I've rewrote the issue under steps to reproduce but thats the only info i can provide because i've gone from a working install to a non working install

@balpoint commented on GitHub (Dec 17, 2022): Well thats the thing... i've upgraded to 3.4.0 & then 3.4.1 and after this upgrade the interface overview page gives this error aswell as when i try to go and edit a specific interface from a device view. I've rewrote the issue under steps to reproduce but thats the only info i can provide because i've gone from a working install to a non working install
Author
Owner

@kkthxbye-code commented on GitHub (Dec 17, 2022):

thats the only info i can provide

No, you can provide a stack trace.

@kkthxbye-code commented on GitHub (Dec 17, 2022): > thats the only info i can provide No, you can provide a stack trace.
Author
Owner

@balpoint commented on GitHub (Dec 17, 2022):

thats the only info i can provide

No, you can provide a stack trace.

Could you elaborate on what you mean by that / how to do that ? ( my first real issue that i can't solve myself :) )

@balpoint commented on GitHub (Dec 17, 2022): > > thats the only info i can provide > > No, you can provide a stack trace. Could you elaborate on what you mean by that / how to do that ? ( my first real issue that i can't solve myself :) )
Author
Owner

@kkthxbye-code commented on GitHub (Dec 17, 2022):

@balpoint - Either check the logs for the entire stack trace or enable the DEBUG setting, then the stack trace will be shown in the browser.

@kkthxbye-code commented on GitHub (Dec 17, 2022): @balpoint - Either check the logs for the entire stack trace or enable the DEBUG setting, then the stack trace will be shown in the browser.
Author
Owner

@balpoint commented on GitHub (Dec 17, 2022):

@balpoint - Either check the logs for the entire stack trace or enable the DEBUG setting, then the stack trace will be shown in the browser.

i've added the debug traceback,

@balpoint commented on GitHub (Dec 17, 2022): > @balpoint - Either check the logs for the entire stack trace or enable the DEBUG setting, then the stack trace will be shown in the browser. i've added the debug traceback,
Author
Owner

@kkthxbye-code commented on GitHub (Dec 17, 2022):

@balpoint - It seems like you have an Object type custom field referencing a model that doesn't exist. Can you show what custom fields you have for the Interface model?

@kkthxbye-code commented on GitHub (Dec 17, 2022): @balpoint - It seems like you have an `Object` type custom field referencing a model that doesn't exist. Can you show what custom fields you have for the Interface model?
Author
Owner

@balpoint commented on GitHub (Dec 17, 2022):

found the issue, there was a custom field referecing a model from a plugin that was removed, i think the model from the plugin was still in the database but with upgrading the install and making migrations the model was also deleted thus the custom field was not able to bind to that object model anymore.

thanks for guiding me towards the debug setting , totally forgot that it existed

@balpoint commented on GitHub (Dec 17, 2022): found the issue, there was a custom field referecing a model from a plugin that was removed, i think the model from the plugin was still in the database but with upgrading the install and making migrations the model was also deleted thus the custom field was not able to bind to that object model anymore. thanks for guiding me towards the debug setting , totally forgot that it existed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7375