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 when trying to sort services list by parent #4644

Closed
hoalex opened this issue May 14, 2020 · 0 comments
Closed

Server error when trying to sort services list by parent #4644

hoalex opened this issue May 14, 2020 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@hoalex
Copy link

hoalex commented May 14, 2020

Environment

  • Python version: 3.6.8
  • NetBox version: 2.8.4

Steps to Reproduce

  1. Disable any installed plugins by commenting out the PLUGINS setting in
    configuration.py.
  2. Navigate to IPAM -> Services
  3. Click on the column header Parent

Expected Behavior

The service list is sorted by parent.

Observed Behavior

The following server error appears:
grafik

Trace:


Traceback (most recent call last):
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/contrib/auth/mixins.py", line 85, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 182, in get
    RequestConfig(request, paginate).configure(table)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django_tables2/config.py", line 61, in configure
    table.paginate(**kwargs)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django_tables2/tables.py", line 584, in paginate
    self.page = self.paginator.page(page)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/paginator.py", line 70, in page
    number = self.validate_number(number)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/paginator.py", line 48, in validate_number
    if number > self.num_pages:
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/paginator.py", line 97, in num_pages
    if self.count == 0 and not self.allow_empty_first_page:
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/core/paginator.py", line 92, in count
    return len(self.object_list)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django_tables2/rows.py", line 330, in __len__
    length = len(self.data)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django_tables2/data.py", line 153, in __len__
    self._length = self.data.count()
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/cacheops/query.py", line 331, in count
    return cached_as(self)(lambda: self._no_monkey.count(self))()
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/cacheops/query.py", line 95, in cached_as
    key_extra = [qs._cache_key(prefix=False) for qs in querysets]
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/cacheops/query.py", line 95, in <listcomp>
    key_extra = [qs._cache_key(prefix=False) for qs in querysets]
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/cacheops/query.py", line 175, in _cache_key
    sql, params = self.query.get_compiler(self.db).as_sql()
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 490, in as_sql
    extra_select, order_by, group_by = self.pre_sql_setup()
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 52, in pre_sql_setup
    order_by = self.get_order_by()
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 342, in get_order_by
    field, self.query.get_meta(), default_order=asc))
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 720, in find_ordering_name
    field, targets, alias, joins, path, opts, transform_function = self._setup_joins(pieces, opts, alias)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 755, in _setup_joins
    field, targets, opts, joins, path, transform_function = self.query.setup_joins(pieces, opts, alias)
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1568, in setup_joins
    names[:pivot], opts, allow_many, fail_on_missing=True,
  File "/opt/netbox-2.8.4/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1484, in names_to_path
    "Choices are: %s" % (name, ", ".join(available)))

Exception Type: FieldError at /ipam/services/
Exception Value: Cannot resolve keyword 'parent' into field. Choices are: created, custom_field_values, description, device, device_id, id, ipaddresses, last_updated, name, port, protocol, tagged_items, tags, virtual_machine, virtual_machine_id
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels May 15, 2020
@jeremystretch jeremystretch self-assigned this May 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants