Bug #1838

User filtering based on facts is broken

Added by Rami Vaknin 9 months ago. Updated 9 months ago.

Status:New Start:08/25/2012
Priority:Normal Due date:
Assigned to:Ohad Levy % Done:

0%

Category:Authorization
Target version:-
Backlog:No Difficulity:
Votes: 0

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>, 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/>

History

Updated by Ohad Levy 9 months ago

  • Subject changed from Edit host or browse most of GUI tabs of a specific user end with exception of "Unknown column 'fact_values.host_id'" to User filtering based on facts is broken
  • Category changed from Web Interface to Authorization
  • Priority changed from Urgent to Normal

Also available in: Atom PDF