Project

General

Profile

Actions

Bug #1838

closed

User filtering based on facts is broken

Added by Rami Vaknin almost 12 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Users, Roles and Permissions
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

A specific user in our Foreman deployment gets exception for almost any operation it does, while other users in the same env don't get errors on the same operations.
We have non-privileged users and administrator users that react ok while that specific "partially-privileged" user gets these errors.

The below error arouse when I click on Edit Host, it happens on every host that I choose.
Quite similar error I get when I browse between the different tabs (Dashboard, Reports, Statistics, Facts - getting error but I can see the facts).

Oops, we're sorry but something went wrong

x
<https://blahblah.redhat.com/hosts/blabla.redhat.com#>
Mysql::Error: Unknown column 'fact_values.host_id' in 'where clause':
SELECT `hosts`.* FROM `hosts` WHERE (((hosts.owner_id in (NULL) AND
hosts.owner_type = 'Usergroup') OR (hosts.owner_id = 3 AND
hosts.owner_type = 'User')) or (hosts.domain_id in (4,1)) or
(hosts.compute_resource_id in (1)) or (hosts.hostgroup_id in
(3,7,13,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)) or
((hosts.id = fact_values.host_id and fact_values.fact_name_id = 56 and
fact_values.value = 'qe_scale') or (hosts.id = fact_values.host_id and
fact_values.fact_name_id = 56 and fact_values.value = 'qe_common') or
(hosts.id = fact_values.host_id and fact_values.fact_name_id = 56 and
fact_values.value = 'qe_jenkins')) )

If you feel this is an error with Foreman itself, please open a new
issue with Foreman ticketing system
<http://theforeman.org/projects/foreman/issues&gt;, You would probably need
to attach the Full trace
<https://blahblah.redhat.com/hosts/blabla.redhat.com#>
and relevant log entries.

/ActiveRecord::StatementInvalid/
Mysql::Error: Unknown column 'fact_values.host_id' in 'where clause':
SELECT `hosts`.
FROM `hosts` WHERE (((hosts.owner_id in (NULL) AND
hosts.owner_type = 'Usergroup') OR (hosts.owner_id = 3 AND
hosts.owner_type = 'User')) or (hosts.domain_id in (4,1)) or
(hosts.compute_resource_id in (1)) or (hosts.hostgroup_id in
(3,7,13,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)) or
((hosts.id = fact_values.host_id and fact_values.fact_name_id = 56 and
fact_values.value = 'qe_scale') or (hosts.id = fact_values.host_id and
fact_values.fact_name_id = 56 and fact_values.value = 'qe_common') or
(hosts.id = fact_values.host_id and fact_values.fact_name_id = 56 and
fact_values.value = 'qe_jenkins')) )*
app/controllers/hosts_controller.rb:462:in `find_by_name'

Back <https://blahblah.redhat.com/>

Actions

Also available in: Atom PDF