Bug 1353749 - ActiveRecord::StatementInvalid in dashboard
Summary: ActiveRecord::StatementInvalid in dashboard
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Dashboard
Version: 6.2.0
Hardware: All
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Tomer Brisker
QA Contact: Peter Ondrejka
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1413361 1417133
TreeView+ depends on / blocked
 
Reported: 2016-07-07 22:25 UTC by Kim Borup
Modified: 2020-08-13 08:31 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:49:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Trace from sat error.. (27.91 KB, text/plain)
2016-07-07 22:25 UTC, Kim Borup
no flags Details
Filter description. (5.08 KB, text/plain)
2016-07-09 00:08 UTC, Kim Borup
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16044 0 Normal Closed Errors in individual dashboard widgets fail entire page 2020-07-06 13:36:18 UTC

Description Kim Borup 2016-07-07 22:25:44 UTC
Created attachment 1177472 [details]
Trace from sat error..

Description of problem:
when using filters for Dashboard in Satellite 6.2 an sql error occurs. 


Version-Release number of selected component (if applicable):


How reproducible:

Always
Steps to Reproduce:
1.Create filters for users. 
2.login as user and press dashboard.
3.

Actual results:
Oops, we're sorry but something went wrong PG::Error: ERROR: missing FROM-clause entry for table "katello_host_collections" LINE 1: ...id" IN (1) AND "hosts"."location_id" IN (2) AND (("katello_h... ^ : SELECT COUNT(DISTINCT count_column) FROM (SELECT DISTINCT "katello_errata"."id" AS count_column FROM "katello_errata" INNER JOIN "katello_content_facet_errata" ON "katello_content_facet_errata"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facet_errata" "content_facet_errata_katello_errata_join" ON "content_facet_errata_katello_errata_join"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facets" ON "katello_content_facets"."id" = "content_facet_errata_katello_errata_join"."content_facet_id" WHERE "katello_content_facets"."host_id" IN (SELECT "hosts"."id" FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."organization_id" IN (1) AND "hosts"."location_id" IN (2) AND (("katello_host_collections"."name" ILIKE 'oss%'))) LIMIT 6) subquery_for_count


Expected results:
Seeing the dashboard. 

Additional info:

Comment 3 Brad Buckingham 2016-07-08 19:38:37 UTC
Hi Kim,  can you provide more details on the user?  For example, what roles/filters were associated with the user?

Did the Satellite have any host collections?

Comment 4 Kim Borup 2016-07-09 00:08:58 UTC
Created attachment 1177805 [details]
Filter description.

This is the filters for the user, however in this text you dont see the Dashboard filter, this were added at the time of the bug, however removed here, in order to temporary work arround it.

Comment 5 Brad Buckingham 2016-07-11 20:49:42 UTC
Can you attach the foreman-debug for your Satellite?
Was this error observed on an internal Satellite 6.2 build ?  Or on the official Beta or Beta2 builds?

Comment 6 Kim Borup 2016-07-13 02:30:00 UTC
The official beta 2 build. i will make a debug now.

Comment 8 Kim Borup 2016-07-13 02:33:54 UTC
have added the debug, the last output from the debug were 016-07-13 04:30:55 [app] [W] Action failed
 | ActiveRecord::StatementInvalid: PG::Error: ERROR:  missing FROM-clause entry for table "katello_host_collections"
 | LINE 1: ...id" IN (1) AND "hosts"."location_id" IN (2) AND (("katello_h...
 |                                                              ^
 | : SELECT COUNT(DISTINCT count_column) FROM (SELECT  DISTINCT "katello_errata"."id" AS count_column FROM "katello_errata" INNER JOIN "katello_content_facet_errata" ON "katello_content_facet_errata"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facet_errata" "content_facet_errata_katello_errata_join" ON "content_facet_errata_katello_errata_join"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facets" ON "katello_content_facets"."id" = "content_facet_errata_katello_errata_join"."content_facet_id" WHERE "katello_content_facets"."host_id" IN (SELECT "hosts"."id" FROM "hosts"  WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."organization_id" IN (1) AND "hosts"."location_id" IN (2) AND (("katello_host_collections"."name" ILIKE 'oss%'))) LIMIT 6) subquery_for_count

Comment 9 Daniel Lobato Garcia 2016-08-10 10:51:38 UTC
Created redmine issue http://projects.theforeman.org/issues/16044 from this bug

Comment 10 Bryan Kearney 2016-08-10 12:16:47 UTC
Upstream bug assigned to tbrisker

Comment 11 Bryan Kearney 2016-08-10 12:16:49 UTC
Upstream bug assigned to tbrisker

Comment 12 Bryan Kearney 2016-08-23 16:17:09 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/16044 has been closed

Comment 15 Peter Ondrejka 2016-11-28 15:41:40 UTC
Verified in Satellite 6.3 snap 6, user with filters mentioned in comment #4 (+ access_dashboard) can now view the dashboard without complications.

Comment 20 Satellite Program 2018-02-21 16:49:54 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.