Bug 1866114 - Error saving API schema to localStorage in Safari
Summary: Error saving API schema to localStorage in Safari
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.6.0
Assignee: Samuel Padgett
QA Contact: Yadan Pei
Depends On:
TreeView+ depends on / blocked
Reported: 2020-08-04 22:06 UTC by Andrew Ballantyne
Modified: 2020-10-27 16:23 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-10-27 16:23:15 UTC
Target Upstream Version:

Attachments (Terms of Use)
Safari (147.68 KB, image/png)
2020-08-04 22:06 UTC, Andrew Ballantyne
no flags Details
DevTools Console Error (45.37 KB, image/png)
2020-08-04 22:07 UTC, Andrew Ballantyne
no flags Details
DevTools Console Errors (518.84 KB, image/png)
2020-08-19 10:11 UTC, Yadan Pei
no flags Details

System ID Private Priority Status Summary Last Updated
Github openshift console pull 6227 0 None closed Bug 1866114: Don't store OpenAPI definitions in localStorage 2020-11-05 09:42:48 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:23:33 UTC

Description Andrew Ballantyne 2020-08-04 22:06:29 UTC
Created attachment 1710431 [details]

Description of problem:
When trying to load an OpenShift Console cluster using the OSX Safari browser, the console only renders the masthead and a white screen under it.

Version-Release number of selected component (if applicable):
Safari Version 13.1.2 (15609.

How reproducible:

Steps to Reproduce:
1. Using Safari, load up any 4.6 cluster

Actual results:
See attached image "Safari", main masthead and a white-screen body.

Expected results:
To load the console UI.

Additional info:
It appears to be local storage setting that saves the available API models that exceeds the max available space Safari allows and thus crashes.
Related line: https://github.com/openshift/console/blob/master/frontend/public/module/k8s/swagger.ts#L47

Comment 1 Andrew Ballantyne 2020-08-04 22:07:59 UTC
Created attachment 1710433 [details]
DevTools Console Error

Comment 2 Yadan Pei 2020-08-05 08:23:01 UTC
We can reproduce with Safari 13.1 on 4.6.0-0.nightly-2020-08-04-210224

Comment 3 Jakub Hadvig 2020-08-05 12:14:24 UTC
The issue is with storing the swagger definitions into localStorage.
Definition size (5.65 MB) exceeds the default size of the localStorage for the Safari on MacOS (5 MB).
Ideally Safari should ask for more space for the localStorage but it's not.
We could potentially:
- compress the swagger definitions that we put into the localStorage ?
- put the definitions into redux ?

Comment 4 Samuel Padgett 2020-08-05 13:09:19 UTC
Hi, Jakub. I am already working on a fix. I don't think we need to use localStorage at all since we can rely on browser caching. The OpenAPI doc has an Etag.

Comment 5 Samuel Padgett 2020-08-05 16:53:08 UTC
Note that Safari shows no content aside for the masthead and navigation due to Bug 1859258. That regression was introduced when we added the quick starts sidebar. This bug *only* tracks the runtime error saving the OpenAPI document to `localStorage`. We'll fix the other display problem for Safari under Bug 1859258.

Comment 8 XiaochuanWang 2020-08-17 03:16:14 UTC
This still reproduces on 4.6.0-0.nightly-2020-08-16-072105
Checked on Safari 13.1.1 (15609.

Comment 9 Samuel Padgett 2020-08-17 12:27:06 UTC
Hi, did you see comment #5? This doesn't fix all display issues on Safari, only the specific localStorage error reported in the description. If that error is not present in the JS console, the bug is fixed. The other display issues are tracked by Bug 1859258.

If this does reproduce, can you include a stack trace or screenshot to help us troubleshoot?

Comment 10 Samuel Padgett 2020-08-17 12:30:50 UTC
Note that we must track these two bugs separately so we can backport the localStorage fix. The other display issues do not apply to older resources.

Comment 11 Yadan Pei 2020-08-19 10:11:39 UTC
Created attachment 1711851 [details]
DevTools Console Errors

"Could not get openAPI definitions and QuotaExceededError" disappears

I can see some other errors like:

Fetch API cannot load https://console-openshift-console.apps.qe-yapei46osp.qe.devcluster.openshift.com/api/prometheus/api/v1/query?query=%28sum%28up%7Bjob%3D%22apiserver%22%7D+%3D%3D+1%29+%2F+count%28up%7Bjob%3D%22apiserver%22%7D%29%29+*+100 due to access control checks.

Fetch API cannot load https://console-openshift-console.apps.qe-yapei46osp.qe.devcluster.openshift.com/api/prometheus/api/v1/query?query=%28sum%28up%7Bjob%3D%22scheduler%22%7D+%3D%3D+1%29+%2F+count%28up%7Bjob%3D%22scheduler%22%7D%29%29+*+100 due

It looks like these errors are expected, could you help confirm?

Comment 12 Samuel Padgett 2020-08-19 15:11:49 UTC
Hi, Yadan. It depends on the logged-in user's permissions. Is this the Home -> Overview page? Either way, that would be a separate bug if there is a problem.

Note that https://github.com/openshift/console/pull/6252 does fix the other Safari display issue. I'll add a note to Bug 1859258.

Comment 13 Yadan Pei 2020-08-20 01:54:30 UTC
Yeah, agree that is different issue.

Moving this bug to verified according to comment 11 and comment 12

Comment 14 Yadan Pei 2020-08-20 01:56:55 UTC
Will check if there is other error message after bug 1859258 is fixed and open bugs if needed

Comment 16 errata-xmlrpc 2020-10-27 16:23:15 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 (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

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


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