Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2002202

Summary: Search box in the Partition Tables page throws an Rails error
Product: Red Hat Satellite Reporter: Ondrej Gajdusek <ogajduse>
Component: SearchAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: afeferku, apatel, aruzicka, kgaikwad, lhellebr, mhulan, pcreech, rlavi
Target Milestone: 6.14.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-scoped_search-4.1.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:17:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
foreman-rake errors:fetch_log none

Description Ondrej Gajdusek 2021-09-08 08:51:32 UTC
Created attachment 1821429 [details]
foreman-rake errors:fetch_log

Description of problem:
Search on the Partition Tables throws an error in some cases.

Version-Release number of selected component (if applicable):
Satellite 6.10

How reproducible:
always

Steps to Reproduce:
1. Navigate to Hosts -> Partition Tables
2. Enter "Atomic Kickstart default" into the search bar and submit it.

Actual results:
The following error is shown to the user:
Oops, we're sorry but something went wrong wrong number of bind variables (8 for 9) in: (("templates"."name" ILIKE ? OR "templates"."template" ILIKE ? OR "templates"."template" ILIKE ? OR "templates"."os_family" ILIKE ?) AND ("templates"."name" ILIKE ? OR "templates"."template" ILIKE ? OR "templates"."template" ILIKE ? OR "templates"."os_family" ILIKE ?) AND (["(\"templates\".\"default\" <> ?)", false]))

Expected results:
No error should be thrown and no results should be shown as "Atomic Kickstart default" is a name of the Provisioning Template (assuming default Satellite instance)

Additional info:
Tested on both 6.10 and 6.9. This is not a regression.
Attached logs come from 6.9.

Comment 1 Marek Hulan 2021-09-09 08:18:46 UTC
A quick workaround - wrap the whole string in quotes, "Atomic Kickstart default". Or don't use the wide searching through all attributes, in this case it seems the customer wants to search by partition table name, so use the search term 

> name ~ "Atomic Kickstart default"

The issue is likely in the word default, which seems to have some special meaning in the scoped search syntax.

Comment 2 Adam Ruzicka 2022-05-31 12:37:02 UTC
> which seems to have some special meaning in the scoped search syntax

It has no special meaning in scoped search itself, it is caused by us defining "default" as a searchable field of type set. This will need to be fixed in scoped_search itself.

In the mean time, if you want to search for multiple words, use quotes.

Comment 5 Lukáš Hellebrandt 2023-07-17 15:47:54 UTC
Verified with Sat 6.14.0 snap 7.0.

Searching for "Atomic Kickstart default" without quotes in Provisioning templates finds a template.
Searching for "Atomic Kickstart default" without quotes in Partition tables doesn't find anything.
Searching for "Preseed default" without quotes in Partition tables finds the Preseed default table.
Searching for 'name = "Preseed default"' without single quotes in Partition tables finds the Preseed default table.
Searching for "default = true" without quotes in Partition tables finds all tables marked as default.

# hammer partition-table list --search='name = "Preseed default"'
----|-----------------|----------
ID  | NAME            | OS FAMILY
----|-----------------|----------
146 | Preseed default | Debian   
----|-----------------|----------
# hammer partition-table list --search='"Preseed default"'
----|-----------------------------|----------
ID  | NAME                        | OS FAMILY
----|-----------------------------|----------
146 | Preseed default             | Debian   
147 | Preseed default autoinstall | Debian   
148 | Preseed default LVM         | Debian   
----|-----------------------------|----------
# hammer partition-table list --search='Preseed default'
----|-----------------------------|----------
ID  | NAME                        | OS FAMILY
----|-----------------------------|----------
146 | Preseed default             | Debian   
147 | Preseed default autoinstall | Debian   
148 | Preseed default LVM         | Debian   
----|-----------------------------|----------

Comment 8 errata-xmlrpc 2023-11-08 14:17:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6818