Project

General

Profile

Bug #9409

Update from 1.6 to 1.7 user role problem in view Report and Dashboard

Added by Sergio Traldi over 7 years ago. Updated over 7 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Hi,
I updated foreman form 1.6 to 1.7. I have mysql as DB to store foreman data.
In my foreman I created one Role (allow the users to create only host in one hostgroup and look anly thier hosts).
I associated that Role to some users.
All worked fine with 1.6.
Now after update if one of those users click on Monitor -> Dashboard or Monitor -> Reports this error occur:

ActiveRecord::StatementInvalid
Mysql2::Error: Unknown column 'hostgroups.title' in 'where clause': SELECT COUNT FROM (SELECT `reports`.`id` AS count_column FROM `reports` LEFT OUTER JOIN `hosts` ON `hosts`.`id` = `reports`.`host_id` AND `hosts`.`type` IN ('Host::Managed') WHERE `reports`.`host_id` IN (SELECT `hosts`.`id` FROM `hosts` WHERE `hosts`.`type` IN ('Host::Managed') AND (((`hostgroups`.`title` = BINARY 'hosts_all/hosts_unipd') OR (`hostgroups`.`title` LIKE 'hosts_all/hosts_unipd/%'))) ORDER BY `hosts`.`name` ASC) AND (status <> 0) AND ((`reports`.`reported_at` >= '2015-02-11')) LIMIT 6) subquery_for_count
app/views/dashboard/_reports_widget.html.erb:3:in `_app_views_dashboard__reports_widget_html_erb__1817694052916996980_68465200'
app/views/dashboard/index.html.erb:9:in `block in app_views_dashboard_index_html_erb_4253806925134727522_68119800'
app/views/dashboard/index.html.erb:8:in `map'
app/views/dashboard/index.html.erb:8:in `_app_views_dashboard_index_html_erb__4253806925134727522_68119800'
app/controllers/dashboard_controller.rb:6:in `index'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

I try to do:
foreman-rake db:migrate
foreman-rake db:seed
foreman-rake tmp:cache:clear
foreman-rake tmp:sessions:clear

service httpd restart

I also try to comment line:
remove_foreign_key 'user_roles', :name => 'user_roles_user_id_fk'
in file
20131114084718_extend_user_role.rb

And execute again:
foreman-rake db:migrate
foreman-rake db:seed

service httpd restart

But the problem is still there.

Cheers
Sergio


Related issues

Is duplicate of Foreman - Bug #8817: PGError: ERROR: missing FROM-clause entry for table "hostgroups"Closed2014-12-31

History

#1 Updated by Dominic Cleal over 7 years ago

  • Is duplicate of Bug #8817: PGError: ERROR: missing FROM-clause entry for table "hostgroups" added

#2 Updated by Dominic Cleal over 7 years ago

  • Status changed from New to Duplicate

Thanks for the report, this looks like the issue we're tracking in #8817.

Also available in: Atom PDF