Project

General

Profile

Actions

Bug #5906

closed

Can't search facts give error / facts search for a particular word does not work

Added by Aleksei Yamschikov over 10 years ago. Updated over 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

when i want filtered facts by some word i get an error

Full trace:

ActiveRecord::StatementInvalid
PGError: ERROR: syntax error at or near "OR" LINE 1: ...%' OR "fact_names"."name" ILIKE '%ipaddress%' OR OR "hostgr... ^ : 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') INNER JOIN "fact_names" fact_names_205432 ON (fact_names_205432.id = fact_values.fact_name_id) WHERE (fact_names.name <> '_timestamp') AND ((fact_names_205432."name" = '') AND ("fact_values"."value" ILIKE '%ipaddress%' OR "fact_values"."value" ILIKE '%ipaddress%' OR "fact_names"."name" ILIKE '%ipaddress%' OR OR "hostgroups"."name" ILIKE '%ipaddress%' OR "fact_names"."short_name" ILIKE '%ipaddress%')) ORDER BY "fact_values"."value" ASC NULLS FIRST LIMIT 50 OFFSET 0
app/views/fact_values/index.html.erb:15:in `_app_views_fact_values_index_html_erb__1346882099241040208_70175712824020'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

When I fill completely, I get the desired result. But I need all the facts such as the type ipaddress. Not one particular. And it does not work.


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #5566: Fact Values Query Produces ErrorClosedJoseph Magen05/05/2014Actions
Actions #1

Updated by Aleksei Yamschikov over 10 years ago

forgot to specify the version: foreman 1.5.0-RC2

Actions #2

Updated by Dominic Cleal over 10 years ago

  • Is duplicate of Bug #5566: Fact Values Query Produces Error added
Actions #3

Updated by Dominic Cleal over 10 years ago

  • Status changed from New to Duplicate

Thanks for the report, we're tracking this under #5566.

Actions

Also available in: Atom PDF