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 2069666 - Passing invalid value to infrasturcture_facet search key leads to PG::InvalidTextRepresentation error
Summary: Passing invalid value to infrasturcture_facet search key leads to PG::Invalid...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.14.0
Assignee: Adam Ruzicka
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-29 12:28 UTC by Peter Ondrejka
Modified: 2023-11-08 14:18 UTC (History)
4 users (show)

Fixed In Version: foreman-3.7.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36394 0 Normal New Passing invalid value to infrasturcture_facet search key leads to PG::InvalidTextRepresentation error 2023-05-15 10:20:13 UTC
Red Hat Issue Tracker SAT-17706 0 None None None 2023-05-15 10:25:55 UTC
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:17:59 UTC

Description Peter Ondrejka 2022-03-29 12:28:26 UTC
Description of problem:

Host search can error out on infrasturcture_facet related queries

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

Satellite 6.11 snap 14

How reproducible:
always

Steps to Reproduce:
1. in satellite UI, go to the hosts page
2. in the search field put "infrastructure_facet.foreman=test" or "infrastructure_facet.smart_proxy_id=test"

Actual results:
Error screen with:

Oops, we're sorry but something went wrong PG::InvalidTextRepresentation: ERROR: invalid input syntax for type boolean: "test" LINE 1: ...acets_infrastructure_facets"."foreman_instance" = 'test')) O... ^

(same happens when searching through hammer CLI)

Expected results:
no error, host page with no results (as it is when passing wrong values to other search keys"

Additional info:

Comment 1 Brad Buckingham 2022-03-31 14:32:49 UTC
Does this error occur with any search field or is this specific to the infrastructure_facet?

Comment 2 Peter Ondrejka 2022-04-01 08:45:26 UTC
Hello, only infrastructure_facet

Comment 5 Brad Buckingham 2023-05-08 10:49:04 UTC
Based upon further review from the engineering team, this bugzilla will not be closed at this time.

Comment 6 Bryan Kearney 2023-05-16 16:02:20 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36394 has been resolved.

Comment 7 Adam Ruzicka 2023-06-22 12:00:22 UTC
This is present in foreman-3.7.0. The fix seems to be already present in last snap, so this is effectively ON_QA, but moving to ON_DEV to not mess up the automation in the hope that it will properly transition to ON_QA with the release on next snap.

Comment 8 Lukáš Hellebrandt 2023-08-04 12:03:46 UTC
Verified with Sat 6.14.0 snap 10.0.

Using reproducer in OP, I get:
* `infrastructure_facet.foreman=test` => `Error 'foreman_instance' should be one of 'true, false', but the query was 'test'`
foreman_instance is the field's name in the DB - the error could have shown the key that the user actually entered but I think this is ok.
* `infrastructure_facet.foreman=true` => Correct result with foreman hosts
* `infrastructure_facet.smart_proxy_id=test` => `Value 'test' is not valid for field 'smart_proxy_id'`
* `infrastructure_facet.smart_proxy_id=1` => Correct result with the satellite capsule itself

No tracebacks anywhere.

Using CLI:
# hammer host list --search 'infrastructure_facet.foreman=test'
400 Bad Request
  'foreman_instance' should be one of 'true, false', but the query was 'test'
# hammer host list --search 'infrastructure_facet.foreman=true'
---|---------|------------------|------------|-------------|-------------------|---------------|--------------|----------------------
ID | NAME    | OPERATING SYSTEM | HOST GROUP | IP          | MAC               | GLOBAL STATUS | CONTENT VIEW | LIFECYCLE ENVIRONMENT
---|---------|------------------|------------|-------------|-------------------|---------------|--------------|----------------------
1  | <FQDN>  | RHEL 8.8         |            | 10.0.167.80 | fa:16:3e:88:20:36 | Warning       |              |                      
---|---------|------------------|------------|-------------|-------------------|---------------|--------------|----------------------
# hammer host list --search 'infrastructure_facet.smart_proxy_id=test'
400 Bad Request
  Value 'test' is not valid for field 'smart_proxy_id'
# hammer host list --search 'infrastructure_facet.smart_proxy_id=1'
[correct result]

Comment 11 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


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