Incubator-superset: Firefox Error while fetching Database list

Created on 24 Apr 2019  路  9Comments  路  Source: apache/incubator-superset

After upgrading from version 0.29.0rc1 to 0.999.0dev.
Firefox doesn't load the welcome screen and gives errors when opening SQL Lab editor or any dashboard
"Error while fetching database list "
"Error while fetching schema list "

SQL lab queries are executed as expected
Single charts do render. but not when included in a dashboard.

Chrome and Safari work correctly

Expected results

After logging in my dashboard renders, and sql lab editor has a database and shema dropdown lists filled. No errors are displayed.

Actual results

Welcome and Dashboard screens keeps loading.

SQL Lab editor dorpdown list aren't filled. auto completion doesn't work

No errors are written to the logs

Screenshots

The welcome screen that keeps loading
image

Initial load of the SQL Lab editor
image

How to reproduce the bug

  1. Log in
  2. Wait until you give up

  3. go to SQL Lab Editor

  4. try to select a database in the dropdown

Environment

(please complete the following information):

  • superset version: master/ 0.999.0dev.
  • python version: Python 3.6.8
  • node.js version: v10.15.3
  • npm version: 6.4.1

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • [x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x ] I have reproduced the issue with at least the latest released version of superset.
  • [x ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Watching network trafic in the browser, it doesn't seem like firefox does any of the data requests that I am getting in Chrome.

#bug firefox help-wanted

Most helpful comment

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 9 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Faced the same issue.

Works fine in Chrome but I get error in Firefox

Same issue with Edge and Firefox.

I've identified the following problems:

  • On the dashboard panel in a popup at the bottom:

    • There was an issue fetching the favorite status of this dashboard

    • An error occurred while fetching available CSS template

  • Clicking edit on the dashboard panel in a popup at the bottom (this prevents adding charts to the dashboard):

    • Sorry there was an error fetching saved charts: An error occured

  • When saving a chart in a blue pop-up (this prevents inserting into an existing dashboard):

    • fetching dashboards failed for 1

For all of these errors do appear in the console, but I haven't been able to determine if they are related to the above issues.

+1

Same here. Console says:

Error initializing SupersetClient DOMException: "The operation is insecure."

with a stack apparently pointing to a call to SupersetClientClass::init(). This is an excerpt from the location in the minified file the stack points to:

a.a.configure({protocol:window.location&&window.location.protocol||"",host:window.location&&window.location.host||"",csrfToken:O}).init().catch(function(e){console.warn("Error initializing SupersetClient",e)})

The request for the CSRF token never gets sent. The site is on http (no TLS), but in chrome requests do actually get sent to http anyway, so I cannot see how it could be mixed content problem. I cannot really spot what's going wrong there; a hand-crafted copy of the request that should be used there executes just fine within the context of the page:

fetch(`http://myserver/superset/csrf_token/`, {
    method: 'GET',
    mode: 'same-origin',
    headers: { 'X-CSRFToken': '0' },
    credentials: 'same-origin',
    cache:'default',
    redirect: 'follow',
    body: undefined,
    signal: undefined,
  })
    .then(res => console.log(res))
    .catch(e => console.error('ERROR',e));

Am I missing anything there?

OK, so the problem is not fetch, but it is HTTP indeed:

callApi in @superset-ui/connection will try to find an existing version of the data in the cache if the window.caches object exists. Unfortunately, as MDN states:

CacheStorage always rejects with a SecurityError on untrusted origins (i.e. those that aren't using HTTPS [...])

At that point, the CacheStorage API throws and the request for the CSRF token as well as the real request are never made.

I believe the correct solution to this problem would probably be to change the constant CACHE_AVAILABLE in superset-ui-connection/src/constants.ts to something like:

export const CACHE_AVAILABLE = 'caches' in self && (self.location && self.location.protocol) === 'https:';

I can make pull request to this respect sometime next week only as I am currently travelling, but anybody may feel free to steal the suggestion for their own pull requests.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

I wonder if it's possible to reopen this one,
I'm facing a similar issue, but on Chrome too. (with 0.35.2 or 0.36.0)

Closing this issue - the bug is not browser-specific. @squalou if you're still experiencing this problem, please open a new issue with server-side application logs related to the error.

Was this page helpful?
0 / 5 - 0 ratings