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

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

Closed
rafaelcortesdepaiva opened this issue Sep 10, 2024 · 1 comment · Fixed by #17470
Closed
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@rafaelcortesdepaiva
Copy link

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

@rafaelcortesdepaiva rafaelcortesdepaiva added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Sep 10, 2024
@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels Sep 10, 2024
@arthanson
Copy link
Collaborator

  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.

@DanSheps DanSheps removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Sep 12, 2024
@DanSheps DanSheps self-assigned this Sep 12, 2024
@DanSheps DanSheps added status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed severity: low Does not significantly disrupt application functionality, or a workaround is available labels Sep 12, 2024
jeremystretch added a commit that referenced this issue Sep 12, 2024
jeremystretch added a commit that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
3 participants