Bug 1481138
Summary: | PG::Error: missing FROM-clause entry from items in Dashboard for Filtered role | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Anand Agrawal <aagrawal> | ||||||||
Component: | Users & Roles | Assignee: | Andrew Kofink <akofink> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Sanket Jagtap <sjagtap> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 6.2.10 | CC: | akofink, bbuckingham, bkearney, dhlavacd, egolov, ehelms, jcallaha, mhulan, sjagtap, zhunting | ||||||||
Target Milestone: | Unspecified | Keywords: | Triaged | ||||||||
Target Release: | Unused | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2018-02-21 17:04:04 UTC | Type: | Bug | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Created attachment 1312991 [details]
PG Error 2
Seems like a duplicate of BZ #1232877 which was meant to be fixed in 6.2.8. It could be also fixed by BZ #1391365 so we should verify on 6.3. Created redmine issue http://projects.theforeman.org/issues/21253 from this bug Note: both upstream issues are required to fix the dashboard. this still needs the katello cherry pick. Created attachment 1344275 [details]
Filters on the user
Build : Satellite 6.3 snap 21
Created custom role and attached it to the user. Created 2 host collections with hosts in them
Logged in with custom user , accessed dashboard.
No errors were seen on the dashboard
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 |
Created attachment 1312990 [details] PG Error Description of problem: PG error on items in Dashboard such as latest Errata and latest events. When creating a custom role with the following filters 1. Resource Miscellaneous => access_dashboard 2. Host => view_hosts, edit_hosts, destroy_hosts with unlimited unselected and search "host_collection = HostCollection1 or host_collection = HostCollection2" And assign this role to the user. Version-Release number of selected component (if applicable): 6.2.10 How reproducible: Always Steps to Reproduce: 1. Create a custom role 'Custom role' 2. Assign above mentioned filters to the above created Custom role 3. Assign this custom role to the user. 4. Try to login with this user. 5. Hit the dashboard menu Actual results: Failure: PG::Error: ERROR: subquery in FROM must have an alias LINE 1: SELECT COUNT(count_column) FROM (SELECT 1 AS count_column F... ^ HINT: For example, FROM (SELECT ...) [AS] foo. : SELECT COUNT(count_column) FROM (SELECT 1 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_facets" ON "katello_content_facets"."id" = "katello_content_facet_errata"."content_facet_id" WHERE (katello_content_facets.host_id IN (SELECT "hosts"."id" FROM "hosts" INNER JOIN "katello_host_collection_hosts" ON "hosts"."id" = "katello_host_collection_hosts"."host_id" INNER JOIN "katello_host_collections" ON "katello_host_collection_hosts"."host_collection_id" = "katello_host_collections"."id" WHERE "katello_host_collections"."name" = 'HostCollection1' )) OR ("hosts"."id" IN (SELECT "hosts"."id" FROM "hosts" INNER JOIN "katello_host_collection_hosts" ON "hosts"."id" = "katello_host_collection_hosts"."host_id" INNER JOIN "katello_host_collections" ON "katello_host_collection_hosts"."host_collection_id" = "katello_host_collections"."id" WHERE "katello_host_collections"."name" = 'HostCollection2' )))))) LIMIT 6) subquery_for_count Expected results: User should be able to view the items latest Errata and latest events on dashboard Additional info: when changing the search filter with '~' in place of '=' it works host_collection ~ HostCollection1 or host_collection ~ HostCollection2