Actions
Issue #9496
closedcalling /pulp/api/v3/uploads/?ordering=completed yields a 500 internal server error
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.
Updated by gerrod almost 3 years ago
- Related to Task #9501: Mention upload objects are only for in progress uploads added
Updated by gerrod almost 3 years ago
- Related to deleted (Task #9501: Mention upload objects are only for in progress uploads)
Updated by pulpbot almost 3 years ago
- Status changed from NEW to POST
Updated by ggainey almost 3 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 107
Updated by rchan almost 3 years ago
- Sprint changed from Sprint 107 to Sprint 108
Updated by rchan almost 3 years ago
- Sprint changed from Sprint 108 to Sprint 109
Added by gerrod over 2 years ago
Updated by gerrod over 2 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|4f6d7c6137c837a9a3ce85ebcbaeaa374497b907.
Updated by pulpbot over 2 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Fix erroneous order fields for
StableOrderingFilter
backendfixes: #9496