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

Server error after updated object #18032

Open
JeanKean-art opened this issue Nov 16, 2024 · 3 comments
Open

Server error after updated object #18032

JeanKean-art opened this issue Nov 16, 2024 · 3 comments
Labels
status: revisions needed This issue requires additional information to be actionable type: bug A confirmed report of unexpected behavior in the application

Comments

@JeanKean-art
Copy link

Deployment Type

Self-hosted

Triage priority

I volunteer to perform this work (if approved)

NetBox Version

v4.0.7

Python Version

3.11

Steps to Reproduce

I've an issue when I try to access to Virtual Device Contexts main page :

Server Error
There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

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

Cannot resolve keyword '_name' into field. Choices are: bookmarks, comments, created, custom_field_data, description, device, device_id, id, identifier, interface_count, interfaces, journal_entries, last_updated, name, primary_ip4, primary_ip4_id, primary_ip6, primary_ip6_id, status, tagged_items, tags, tenant, tenant_id

Python version: 3.11.6
NetBox version: 4.0.7
Plugins: None installed

I can list VDC using to api call /api/dcim/virtual-device-contexts/
I can access to a specific VDC ID using GUI and API

Expected Behavior

I'm supposed to display the list of all VDC on GUI

Observed Behavior

Server Error
There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

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

Cannot resolve keyword '_name' into field. Choices are: bookmarks, comments, created, custom_field_data, description, device, device_id, id, identifier, interface_count, interfaces, journal_entries, last_updated, name, primary_ip4, primary_ip4_id, primary_ip6, primary_ip6_id, status, tagged_items, tags, tenant, tenant_id

Python version: 3.11.6
NetBox version: 4.0.7
Plugins: None installed

@JeanKean-art JeanKean-art added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Nov 16, 2024
@jeremystretch
Copy link
Member

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.

@jeremystretch jeremystretch added status: revisions needed This issue requires additional information to be actionable and removed status: needs triage This issue is awaiting triage by a maintainer labels Nov 18, 2024
@bctiemann
Copy link
Contributor

@JeanKean-art Specifically could you provide the full traceback including line numbers? I can't reproduce this either, but with a complete (and formatted) traceback from the terminal/console it would be easier to identify where in the code this is occurring. Please use the three backticks (```) notation. Thanks!

@JeanKean-art
Copy link
Author

@bctiemann thx for your answer, here is the debug traceback



Request Method: GET
Request URL: https://x.x.x.x/dcim/virtual-device-contexts/

Django Version: 5.0.7
Python Version: 3.11.6
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'django.forms',
 'corsheaders',
 'debug_toolbar',
 'django_filters',
 'django_htmx',
 'django_tables2',
 'django_prometheus',
 'strawberry_django',
 'mptt',
 'rest_framework',
 'social_django',
 'taggit',
 'timezone_field',
 'core',
 'account',
 'circuits',
 'dcim',
 'ipam',
 'extras',
 'tenancy',
 'users',
 'utilities',
 'virtualization',
 'vpn',
 'wireless',
 'django_rq',
 'drf_spectacular',
 'drf_spectacular_sidecar']
Installed Middleware:
['strawberry_django.middlewares.debug_toolbar.DebugToolbarMiddleware',
 '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',
 'django_htmx.middleware.HtmxMiddleware',
 'netbox.middleware.RemoteUserMiddleware',
 'netbox.middleware.CoreMiddleware',
 'netbox.middleware.MaintenanceModeMiddleware']



Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/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 "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, 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 113, in dispatch
    return super().dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/netbox/views/generic/bulk_views.py", line 162, in get
    table = self.get_table(self.queryset, request, has_bulk_actions)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/netbox/views/generic/mixins.py", line 53, in get_table
    table.configure(request)
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/netbox/tables/tables.py", line 164, in configure
    self.order_by = ordering
    ^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_tables2/tables.py", line 542, in order_by
    self.data.order_by(self._order_by)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_tables2/data.py", line 224, in order_by
    self.data = self.data.order_by(*order_by_accessors)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 1701, in order_by
    obj.query.add_ordering(*field_names)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 2253, in add_ordering
    self.names_to_path(item.split(LOOKUP_SEP), self.model._meta)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1772, in names_to_path
    raise FieldError(
    ^

Exception Type: FieldError at /dcim/virtual-device-contexts/
Exception Value: Cannot resolve keyword '_name' into field. Choices are: bookmarks, comments, created, custom_field_data, description, device, device_id, id, identifier, interface_count, interfaces, journal_entries, last_updated, name, primary_ip4, primary_ip4_id, primary_ip6, primary_ip6_id, status, tagged_items, tags, tenant, tenant_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: revisions needed This issue requires additional information to be actionable type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants