Error when making an interface bridge on an intarface template of module type #10217

Closed
opened 2025-12-29 21:28:30 +01:00 by adam · 1 comment
Owner

Originally created by @rafaelcortesdepaiva on GitHub (Sep 10, 2024).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.1.0

Python Version

3.12

Steps to Reproduce

  1. On {host}/dcim/interface-templates/{id}/edit/?return_url=/dcim/module-types/{module_type_id}/interfaces/ the bridge interface is not filtering the interfaces of the {module_type_id} module type.
  2. And when you select the correct interface, you get an error after clicking on save button.

Expected Behavior

To filter the interfaces of the correct module type and to save without any error.

Observed Behavior

There is the reported error.

<class 'django.core.exceptions.ImproperlyConfigured'>

Could not resolve URL for hyperlinked relationship using view name "". You may have failed to include the related model in your API, or incorrectly configured the lookup_field attribute on this field.

Python version: 3.12.3
NetBox version: 4.1.0
Plugins: None installed

Originally created by @rafaelcortesdepaiva on GitHub (Sep 10, 2024). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.1.0 ### Python Version 3.12 ### Steps to Reproduce 1. On {host}/dcim/interface-templates/{id}/edit/?return_url=/dcim/module-types/{module_type_id}/interfaces/ the bridge interface is not filtering the interfaces of the {module_type_id} module type. 2. And when you select the correct interface, you get an error after clicking on save button. ### Expected Behavior To filter the interfaces of the correct module type and to save without any error. ### Observed Behavior There is the reported error. <class 'django.core.exceptions.ImproperlyConfigured'> Could not resolve URL for hyperlinked relationship using view name "". You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field. Python version: 3.12.3 NetBox version: 4.1.0 Plugins: None installed
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:28:30 +01:00
adam closed this issue 2025-12-29 21:28:30 +01:00
Author
Owner

@arthanson commented on GitHub (Sep 11, 2024):

  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/object_views.py", line 180, in dispatch
    return super().dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch
    return super().dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/utilities/views.py", line 125, in dispatch
    return super().dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/utilities/views.py", line 39, in dispatch
    return super().dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/object_views.py", line 276, in post
    obj = form.save()
          ^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/forms/models.py", line 552, in save
    self.instance.save()
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/db/models/base.py", line 822, in save
    self.save_base(
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/db/models/base.py", line 924, in save_base
    post_save.send(
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/core/signals.py", line 102, in handle_changed_object
    enqueue_event(queue, instance, request.user, request.id, event_type)
  File "/Users/arthurhanson/dev/work/netbox/netbox/extras/events.py", line 77, in enqueue_event
    'data': serialize_for_event(instance),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/extras/events.py", line 35, in serialize_for_event
    return serializer.data
           ^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 571, in data
    ret = super().data
          ^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 249, in data
    self._data = self.to_representation(self.instance)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 538, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 538, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/relations.py", line 411, in to_representation
    raise ImproperlyConfigured(msg % self.view_name)
django.core.exceptions.ImproperlyConfigured: Could not resolve URL for hyperlinked relationship using view name "". You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field.
@arthanson commented on GitHub (Sep 11, 2024): ``` File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/object_views.py", line 180, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/utilities/views.py", line 125, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/utilities/views.py", line 39, in dispatch return super().dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/netbox/views/generic/object_views.py", line 276, in post obj = form.save() ^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/forms/models.py", line 552, in save self.instance.save() File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/db/models/base.py", line 822, in save self.save_base( File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/db/models/base.py", line 924, in save_base post_save.send( File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 189, in send response = receiver(signal=self, sender=sender, **named) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/core/signals.py", line 102, in handle_changed_object enqueue_event(queue, instance, request.user, request.id, event_type) File "/Users/arthurhanson/dev/work/netbox/netbox/extras/events.py", line 77, in enqueue_event 'data': serialize_for_event(instance), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/extras/events.py", line 35, in serialize_for_event return serializer.data ^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 571, in data ret = super().data ^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 249, in data self._data = self.to_representation(self.instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 538, in to_representation ret[field.field_name] = field.to_representation(attribute) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 538, in to_representation ret[field.field_name] = field.to_representation(attribute) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/rest_framework/relations.py", line 411, in to_representation raise ImproperlyConfigured(msg % self.view_name) django.core.exceptions.ImproperlyConfigured: Could not resolve URL for hyperlinked relationship using view name "". You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field. ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10217