Bug 2002202
| Summary: | Search box in the Partition Tables page throws an Rails error | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Ondrej Gajdusek <ogajduse> | ||||
| Component: | Search | Assignee: | Adam Ruzicka <aruzicka> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.10.0 | CC: | afeferku, apatel, aruzicka, kgaikwad, lhellebr, mhulan, pcreech, rlavi | ||||
| Target Milestone: | 6.14.0 | Keywords: | 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: |
|
||||||
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.
> 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.
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 ----|-----------------------------|---------- 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 |
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.