Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 745245 - Filter on provider page fails with postgres error
Summary: Filter on provider page fails with postgres error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Amos Benari
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-10-11 18:47 UTC by Jeff Weiss
Modified: 2023-01-10 08:21 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:00:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeff Weiss 2011-10-11 18:47:16 UTC
Description of problem:


Version-Release number of selected component (if applicable):
katello-0.1.92-1.git.0.657d7d5.fc14.noarch

How reproducible:


Steps to Reproduce:
1. Go to custom provider page
2. In filter box, type "blah", press Enter
3. 
  
Actual results:
Error:

    PGError: ERROR: column reference "name" is ambiguous LINE 1: ...ECT DISTINCT ON ("providers".id) "providers".id, name AS al... ^ : SELECT * FROM (SELECT DISTINCT ON ("providers".id) "providers".id, name AS alias_0 FROM "providers" LEFT OUTER JOIN "products" ON "products"."provider_id" = "providers"."id" WHERE "providers"."organization_id" = 1 AND "providers"."provider_type" = 'Custom' AND (("providers"."name" ILIKE '%blah%' OR "providers"."description" ILIKE '%blah%' OR "products"."name" ILIKE '%blah%' OR "products"."description" ILIKE '%blah%'))) AS id_list ORDER BY id_list.alias_0 LIMIT 25



Expected results:
results are filtered, no results shown (unless you have a provider named blah).


Additional info:

Comment 1 Brad Buckingham 2011-10-12 14:44:01 UTC
This appears to be an issue in the scoped_search gem generating invalid SQL.  We had a similar issue with auto-complete which was addressed in scoped_search 2.3.4; however, looks like a similar issues exists on a search queries also.

Another example that will generate this type of error is:
  provider.name = "spacewalk"

generates the following error:

SQLite3::SQLException: ambiguous column name: name: SELECT DISTINCT "providers".id FROM "providers" LEFT OUTER JOIN "products" ON "products"."provider_id" = "providers"."id" WHERE "providers"."organization_id" = 1 AND "providers"."provider_type" = 'Custom' AND (("products"."name" = 'spacewalk')) ORDER BY name LIMIT 25

Comment 2 Amos Benari 2011-10-16 16:14:04 UTC
Problem seemed to be the order statement not the scoped_search.
fixed by commit #08385944d35e24d7f29dba4675cc5d7fbf606904

Comment 3 Brad Buckingham 2011-10-18 18:40:31 UTC
Unfortunately, I still see the same problem with the change committed.  Example scenario:

1. create a provider : spacewalk
2. create a product under that provider : spacewalk_product
3. perform a provider search using : 
   product.name  =  spacewalk_product 

generates the following exception: 

SQLite3::SQLException: ambiguous column name: name: SELECT DISTINCT "products".name FROM "products" INNER JOIN "providers" ON "providers"."id" = "products"."provider_id" WHERE "providers"."organization_id" = 1 AND (name LIKE 'spacewalk_product%') LIMIT 20 

rather than "(name LIKE 'spacewalk_product%')", the query should contain something like "('products'.name LIKE 'spacewalk_product%')"

Comment 4 Jeff Weiss 2011-10-24 14:23:00 UTC
Brad's repro scenario still fails.  The original "plain" search term now works though.

katello-0.1.95-1.git.56.344ea38.el6.x86_64

Comment 5 Brad Buckingham 2011-11-14 21:05:24 UTC
verified that the issues raised in the initial description and my repro scenario are no longer observable with scoped_search 2.3.6... that version of scoped_search gem has been pushed in to the git repos and should be available in an upcoming build.

Comment 6 Jeff Weiss 2011-11-29 15:13:36 UTC
Verified, katello-0.1.116-1.git.0.ed4d8a9.el6.x86_64

Comment 10 Mike McCune 2013-08-16 17:53:05 UTC
getting rid of 6.0.0 version since that doesn't exist

Comment 11 Gilbert 2023-01-10 08:21:58 UTC Comment hidden (spam)

Note You need to log in before you can comment on or make changes to this bug.