Bug #4563

ruby193-rubygem-scoped_search-2.6.3-1.el6.noarch breaks searching via the api with foreman-1.4.1

Added by Nathan Grennan over 8 years ago. Updated almost 4 years ago.

Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


I upgraded to foreman-1.4.1 via yum update, and in the process it installed ruby193-rubygem-scoped_search-2.6.3-1.el6.noarch from the foreman yum repo. In the process my api calls to search broke.

I think it is doing something like transposing column names. It does = hosts.host_id, and I think it should be something like fact_values.host_id =

I worked around the issue with "yum downgrade ruby193-rubygem-scoped_search".

mmoll told me this relates to issue 4293
Curl call for testing:
curl -k -u 'user:pass' ''

Curl error: {"error":{"message":"PGError: ERROR: column hosts.host_id does not exist\nLINE 3: ON = hosts.host_id \n ^\n: SELECT DISTINCT \"fact_values\".id, \"fact_values\".\"value\" AS alias_0 FROM \"fact_values\" LEFT OUTER JOIN \"fact_names\" ON \"fact_names\".\"id\" = \"fact_values\".\"fact_name_id\" LEFT OUTER JOIN \"hosts\" ON \"hosts\".\"id\" = \"fact_values\".\"host_id\" AND \"hosts\".\"type\" IN ('Host::Managed') LEFT OUTER JOIN \"hostgroups\" ON \"hostgroups\".\"id\" = \"hosts\".\"hostgroup_id\" LEFT OUTER JOIN \"hosts\" \"hosts_fact_values\" ON \"hosts_fact_values\".\"id\" = \"fact_values\".\"host_id\" AND \"hosts_fact_values\".\"type\" IN ('Host::Managed') WHERE ( <> '_timestamp') AND (((\"fact_names\".\"name\" = 'internal_ipaddress') AND ( IN (SELECT host_id FROM fact_values\n INNER JOIN hosts\n ON = hosts.host_id \n INNER JOIN hostgroups\n ON hosts.hostgroup_id = \n WHERE \"hostgroups\".\"name\" = 'lb.stage' )))) ORDER BY \"fact_values\".\"value\" ASC NULLS FIRST LIMIT 20 OFFSET 0"}}

Curl good output with older scoped_search: {"":{"ipaddress":""},"":{"ipaddress":""},"":{"ipaddress":""},"":{"ipaddress":""}}

Related issues

Related to Foreman - Bug #4293: Scoped search breaks on some relationsClosed2014-02-07


#1 Updated by Anonymous over 8 years ago

  • Related to Bug #4293: Scoped search breaks on some relations added

#2 Updated by Dominic Cleal over 8 years ago

  • Project changed from Packaging to Foreman
  • Category set to Search
  • Assignee set to Amos Benari

#3 Updated by Amos Benari over 8 years ago

  • Status changed from New to Ready For Testing

a new version of scoped search (2.6.5) that fixes the issue is available.

#4 Updated by Dominic Cleal over 8 years ago

  • Status changed from Ready For Testing to Closed
  • Target version set to 1.9.0
  • % Done changed from 0 to 100
  • Legacy Backlogs Release (now unused) set to 7

Built 2.6.5 into RPM nightly, will push with 1.4.2 if all is good there. if you want to test it.

Also available in: Atom PDF