Project

General

Profile

Actions

Bug #21525

closed

ISE on Errata API list call when using invalid sort by name

Added by Partha Aji over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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"]}
Actions #1

Updated by Partha Aji over 6 years ago

  • Bugzilla link set to 1507519
Actions #2

Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7046 added
Actions #3

Updated by Justin Sherrill over 6 years ago

  • translation missing: en.field_release set to 284
Actions #4

Updated by Justin Sherrill over 6 years ago

  • translation missing: en.field_release changed from 284 to 250
Actions #5

Updated by Partha Aji over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF