/dcim/sites throws error after upgrade to 4.3.1 #11268

Closed
opened 2025-12-29 21:42:41 +01:00 by adam · 2 comments
Owner

Originally created by @shunkirc on GitHub (Jun 6, 2025).

Deployment Type

Self-hosted

NetBox Version

4.3.1

Python Version

3.12

Steps to Reproduce

Upgrade to latest version went smoothly, since then the /dcim/sites does not work and throws the following error

Expected Behavior

Working and displayed configured 'sites

Observed Behavior

2025-06-06 13:54:20,128 django.request ERROR: Internal Server Error: /dcim/sites/add/
Traceback (most recent call last):
File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 185, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/utilities/views.py", line 125, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/utilities/views.py", line 39, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 236, in get
form = self.form(instance=obj, initial=initial_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/netbox/forms/mixins.py", line 31, in init
self._append_customfield_fields()
File "/opt/netbox/netbox/netbox/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 47, in _get_form_field
return customfield.to_form_field()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/extras/models/customfields.py", line 544, in to_form_field
'queryset': model.objects.all(),
^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'objects'

Originally created by @shunkirc on GitHub (Jun 6, 2025). ### Deployment Type Self-hosted ### NetBox Version 4.3.1 ### Python Version 3.12 ### Steps to Reproduce Upgrade to latest version went smoothly, since then the /dcim/sites does not work and throws the following error ### Expected Behavior Working and displayed configured 'sites ### Observed Behavior 2025-06-06 13:54:20,128 django.request ERROR: Internal Server Error: /dcim/sites/add/ Traceback (most recent call last): File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 185, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/utilities/views.py", line 125, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/utilities/views.py", line 39, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.1/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 236, in get form = self.form(instance=obj, initial=initial_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/forms/mixins.py", line 31, in __init__ self._append_customfield_fields() File "/opt/netbox/netbox/netbox/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 47, in _get_form_field return customfield.to_form_field() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/extras/models/customfields.py", line 544, in to_form_field 'queryset': model.objects.all(), ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'objects'
adam added the type: bugstatus: revisions needed labels 2025-12-29 21:42:41 +01:00
adam closed this issue 2025-12-29 21:42:41 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 6, 2025):

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.

The stack trace seems to indicate the issue might be related to custom fields. What custom fields do you have defined for sites?

@jeremystretch commented on GitHub (Jun 6, 2025): 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. The stack trace seems to indicate the issue might be related to custom fields. What custom fields do you have defined for sites?
Author
Owner

@shunkirc commented on GitHub (Jun 10, 2025):

Thanks for the hind Jeremy. I deleted the objects iptables and the webpage works again. Maybe something with the upgrade as we have not used the addon yet. Happy to close this one down.

@shunkirc commented on GitHub (Jun 10, 2025): Thanks for the hind Jeremy. I deleted the objects iptables and the webpage works again. Maybe something with the upgrade as we have not used the addon yet. Happy to close this one down.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11268