Actions
Bug #21525
closedISE on Errata API list call when using invalid sort by name
Description
Requesting Errata List Via API causes an ISE if an invalid sort column name is used.
Steps to Reproduce:
1. you might need to have som repos providing some errata synced.
2. curl -sku admin:changeme "https://<fqdn>/katello/api/v2/errata?order=cve%20DESC"
(or name)
Actual results:
PG::Error: ERROR: column katello_errata.name does not exist
Expected results:
Listing works with the correct ordering or atleast uses the Default Sort By when sorting similar to the way invalid sort order is handled.
$ curl -sku admin:changeme "https://<FQDN>/katello/api/v2/errata?order=name%20ASC" {"displayMessage":"PG::Error: ERROR: column katello_errata.name does not exist\nLINE 1: ....\"id\" FROM \"katello_content_views\"))))) ORDER BY \"katello_e...\n ^\n: SELECT \"katello_errata\".* FROM \"katello_errata\" WHERE \"katello_errata\".\"id\" IN (SELECT \"katello_repository_errata\".\"erratum_id\" FROM \"katello_repository_errata\" WHERE \"katello_repository_errata\".\"repository_id\" IN (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" WHERE (katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" WHERE \"katello_repositories\".\"product_id\" IN (SELECT \"katello_products\".\"id\" FROM \"katello_products\")) or katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" INNER JOIN \"katello_content_view_repositories\" ON \"katello_content_view_repositories\".\"repository_id\" = \"katello_repositories\".\"id\" WHERE \"katello_content_view_repositories\".\"content_view_id\" IN (SELECT \"katello_content_views\".\"id\" FROM \"katello_content_views\")) or katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" INNER JOIN \"katello_content_view_versions\" ON \"katello_content_view_versions\".\"id\" = \"katello_repositories\".\"content_view_version_id\" WHERE \"katello_content_view_versions\".\"content_view_id\" IN (SELECT \"katello_content_views\".\"id\" FROM \"katello_content_views\"))))) ORDER BY \"katello_errata\".\"name\" ASC, katello_errata.id DESC LIMIT 20 OFFSET 0","errors":["PG::Error: ERROR: column katello_errata.name does not exist\nLINE 1: ....\"id\" FROM \"katello_content_views\"))))) ORDER BY \"katello_e...\n ^\n: SELECT \"katello_errata\".* FROM \"katello_errata\" WHERE \"katello_errata\".\"id\" IN (SELECT \"katello_repository_errata\".\"erratum_id\" FROM \"katello_repository_errata\" WHERE \"katello_repository_errata\".\"repository_id\" IN (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" WHERE (katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" WHERE \"katello_repositories\".\"product_id\" IN (SELECT \"katello_products\".\"id\" FROM \"katello_products\")) or katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" INNER JOIN \"katello_content_view_repositories\" ON \"katello_content_view_repositories\".\"repository_id\" = \"katello_repositories\".\"id\" WHERE \"katello_content_view_repositories\".\"content_view_id\" IN (SELECT \"katello_content_views\".\"id\" FROM \"katello_content_views\")) or katello_repositories.id in (SELECT \"katello_repositories\".\"id\" FROM \"katello_repositories\" INNER JOIN \"katello_content_view_versions\" ON \"katello_content_view_versions\".\"id\" = \"katello_repositories\".\"content_view_version_id\" WHERE \"katello_content_view_versions\".\"content_view_id\" IN (SELECT \"katello_content_views\".\"id\" FROM \"katello_content_views\"))))) ORDER BY \"katello_errata\".\"name\" ASC, katello_errata.id DESC LIMIT 20 OFFSET 0"]}
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/7046 added
Updated by Justin Sherrill over 7 years ago
- Translation missing: en.field_release set to 284
Updated by Justin Sherrill over 7 years ago
- Translation missing: en.field_release changed from 284 to 250
Updated by Partha Aji over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|2e39affb47849ebd42f6974892e7618ed6c5dbd5.
Actions