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

[2.1.3] TypeError in certain app list views #5254

Closed
glennmatthews opened this issue Feb 8, 2024 · 0 comments · Fixed by #5256
Closed

[2.1.3] TypeError in certain app list views #5254

glennmatthews opened this issue Feb 8, 2024 · 0 comments · Fixed by #5256
Assignees
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Nautobot version (Docker tag too if applicable): 2.1.3

Seen with at least DLM and GC apps, example traceback:

nautobot-1  | 15:46:41.534 ERROR   django.request :
nautobot-1  |   Internal Server Error: /plugins/nautobot-device-lifecycle-mgmt/validated-software-device-report/
nautobot-1  | Traceback (most recent call last):
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner
nautobot-1  |     response = get_response(request)
nautobot-1  |                ^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response
nautobot-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
nautobot-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view
nautobot-1  |     return self.dispatch(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/views/mixins.py", line 165, in dispatch
nautobot-1  |     return super().dispatch(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 98, in dispatch
nautobot-1  |     return handler(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/views/generic.py", line 272, in get
nautobot-1  |     table = self.table(self.queryset, user=request.user, order_by=order_by)
nautobot-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/tables.py", line 149, in __init__
nautobot-1  |     self.data.data = self.data.data.select_related(*select_fields).prefetch_related(*prefetch_fields)
nautobot-1  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 1051, in select_related
nautobot-1  |     raise TypeError("Cannot call select_related() after .values() or .values_list()")
nautobot-1  | TypeError: Cannot call select_related() after .values() or .values_list()
nautobot-1  | ERROR:django.request:Internal Server Error: /plugins/nautobot-device-lifecycle-mgmt/validated-software-device-report/
nautobot-1  | Traceback (most recent call last):
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner
nautobot-1  |     response = get_response(request)
nautobot-1  |                ^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response
nautobot-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
nautobot-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view
nautobot-1  |     return self.dispatch(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/views/mixins.py", line 165, in dispatch
nautobot-1  |     return super().dispatch(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 98, in dispatch
nautobot-1  |     return handler(request, *args, **kwargs)
nautobot-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/views/generic.py", line 272, in get
nautobot-1  |     table = self.table(self.queryset, user=request.user, order_by=order_by)
nautobot-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/nautobot/core/tables.py", line 149, in __init__
nautobot-1  |     self.data.data = self.data.data.select_related(*select_fields).prefetch_related(*prefetch_fields)
nautobot-1  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 1051, in select_related
nautobot-1  |     raise TypeError("Cannot call select_related() after .values() or .values_list()")
nautobot-1  | TypeError: Cannot call select_related() after .values() or .values_list()

Appears to have been introduced by #5215.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Feb 8, 2024
@glennmatthews glennmatthews self-assigned this Feb 8, 2024
@glennmatthews glennmatthews added the emergent Unplanned work that is brought into a sprint after it's started. label Feb 8, 2024
@glennmatthews glennmatthews pinned this issue Feb 8, 2024
@glennmatthews glennmatthews changed the title TypeError in certain app list views [2.1.3] TypeError in certain app list views Feb 8, 2024
glennmatthews added a commit that referenced this issue Feb 8, 2024
glennmatthews added a commit that referenced this issue Feb 8, 2024
@DistantVoyager DistantVoyager unpinned this issue Feb 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant