Project

Profile

Help

Issue #9496

closed

calling /pulp/api/v3/uploads/?ordering=completed yields a 500 internal server error

Added by thm about 1 year ago. Updated 12 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 110
Quarter:

Description

Backtrace:

api_1      | pulp [fbc67c5bcf5e4d0084bcb6a4ea9b6a35]: django.request:ERROR: Internal Server Error: /pulp/api/v3/uploads/
api_1      | Traceback (most recent call last):
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
api_1      |     response = get_response(request)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
api_1      |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
api_1      |     return view_func(*args, **kwargs)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
api_1      |     return self.dispatch(request, *args, **kwargs)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
api_1      |     response = self.handle_exception(exc)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
api_1      |     self.raise_uncaught_exception(exc)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
api_1      |     raise exc
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
api_1      |     response = handler(request, *args, **kwargs)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/mixins.py", line 38, in list
api_1      |     queryset = self.filter_queryset(self.get_queryset())
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/generics.py", line 150, in filter_queryset
api_1      |     queryset = backend().filter_queryset(self.request, queryset, self)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/rest_framework/filters.py", line 283, in filter_queryset
api_1      |     return queryset.order_by(*ordering)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/db/models/query.py", line 1149, in order_by
api_1      |     obj.query.add_ordering(*field_names)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1993, in add_ordering
api_1      |     self.names_to_path(item.split(LOOKUP_SEP), self.model._meta)
api_1      |   File "/opt/pulp/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1539, in names_to_path
api_1      |     raise FieldError("Cannot resolve keyword '%s' into field. "
api_1      | django.core.exceptions.FieldError: Cannot resolve keyword 'completed' into field. Choices are: chunks, pulp_created, pulp_id, pulp_labels, pulp_last_updated, size, upload

This is with pulpcore 3.16.0, pulp-rpm 3.15.0.

There are more examples like this, e.g. /pulp/api/v3/content/rpm/packages/?ordering=md5.

The ordering parameters are not invented, but chosen by clicking on the "Filters" button in the HTML view in the browser.

So, imho, there are two issues here:

  • It shouldn't generate a 500 for unknown/invalid values of the ordering parameter.
  • The "Filters" dialogue should only present valid parameters.
Actions #1

Updated by gerrod about 1 year ago

  • Assignee set to gerrod
Actions #2

Updated by gerrod about 1 year ago

  • Related to Task #9501: Mention upload objects are only for in progress uploads added
Actions #3

Updated by gerrod about 1 year ago

  • Related to deleted (Task #9501: Mention upload objects are only for in progress uploads)
Actions #4

Updated by pulpbot about 1 year ago

  • Status changed from NEW to POST
Actions #5

Updated by ggainey about 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 107
Actions #6

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 107 to Sprint 108
Actions #7

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 108 to Sprint 109
Actions #8

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 109 to Sprint 110

Added by gerrod about 1 year ago

Revision 4f6d7c61

Fix erroneous order fields for StableOrderingFilter backend

fixes: #9496

Actions #9

Updated by gerrod about 1 year ago

  • Status changed from POST to MODIFIED
Actions #10

Updated by pulpbot 12 months ago

  • Sprint/Milestone set to 3.17.0
Actions #11

Updated by pulpbot 12 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF