Project

General

Profile

Actions

Bug #1838

closed

User filtering based on facts is broken

Added by Rami Vaknin over 11 years ago. Updated almost 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 #1

Updated by Ohad Levy over 11 years 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 Users, Roles and Permissions
  • Priority changed from Urgent to Normal
Actions #2

Updated by Dominic Cleal about 10 years ago

  • Status changed from New to Feedback
  • Assignee deleted (Ohad Levy)

The fact-based user authorisation filtering has been rewritten in Foreman 1.5, so I believe this bug report is likely to have been fixed in the process. We're starting a test period right now, so if you have time to re-test, that'd be appreciated. More information at Auth_testing_for_Foreman_15.

Actions #3

Updated by Anonymous almost 7 years ago

  • Status changed from Feedback to Resolved

should be fixed with 1.5+

Actions

Also available in: Atom PDF