Bug 1341858

Summary: Dashboard takes a long time to load when the admin user has no default org
Product: Red Hat Satellite Reporter: Bruno Rocha <rochacbruno>
Component: DashboardAssignee: Chris Duryee <cduryee>
Status: CLOSED ERRATA QA Contact: Renzo Nuccitelli <rnuccite>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney, cwelton, rnuccite, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 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:
Bug Depends On:    
Bug Blocks: 1339766    

Description Bruno Rocha 2016-06-01 22:13:36 UTC
Description of problem:

After login dashboard is the homepage, if the user is admin and has no default_organization set it takes long time to load (up to 2 minutes).

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

Sattelite 6.2 snap 13

How reproducible:

When system has more than 10 organizations

Steps to Reproduce:
1. Create a lot of organizations 10+ 
2. Create a new admin user without default_organization set
3. Login with this new user to dashboard
4. Note that login takes a long time comparing to users with default_organization

Actual results:

When user has no default_organization and log in, it will load in "Any Context" which will cause the dashboard to aggregate values form all organization.

According to *beav* and watching server logs I notice there is a call to candlepin for each organization.

Expected results:

User log in to dashboard using "Any Context" showing data from all the organizations, but only a single call to candlepin to get the data in bulk would avoid the long time to load.

Additional info:

Comment 2 Chris Duryee 2016-06-02 16:38:08 UTC
The recommended fix is to display "please select an organization to view subscription information" for the subscription widget if no org is selected.

It is possible to fix this by adding multi-org API calls to candlepin and katello, but I do not think it's worth it for this use case. Most users drill down into an org before examining subscription data.

Comment 4 Bryan Kearney 2016-09-28 18:17:55 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16713 has been resolved.

Comment 7 Renzo Nuccitelli 2016-11-15 12:04:53 UTC
Verified on 6.3.0 snap 6. Subscription widget shows "Please select an organization to view subscription totals." msg. Even after creating 11 orgs the load time for the page seems to be the same. So I am changing status to verified

Comment 8 Satellite Program 2018-02-21 16:51:07 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