Incubator-superset: unable to export dashboards - page just reloads

Created on 23 Apr 2019  路  8Comments  路  Source: apache/incubator-superset

After selecting the dashboards to export, clicking export and confirming the action reloads the dashboards page instead of downloading the json file.

Expected results

A json file is downloaded with the data for the selected dashboards.

Actual results

The page simply reloads but no file is downloaded.

How to reproduce the bug

  1. Go to 'Dashboards'
  2. Select the dashboards to download
  3. Click on 'actions' then 'export'
  4. Click 'Ok' on the Confirmation alert.

Environment

  • superset version: v0.28.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.
#bug

Most helpful comment

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

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

All 8 comments

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

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

As part of the research on the issue, the submitted data needs to have a query string parameter named "action" with value "go". This is not submitted. Manually appending that to the URL is a suitable workaround as shown in the attached image.
image

maybe you need to disable pop-up blocker in your browser ,it works for me

Are you on the latest deployed version: 0.28.1? Anyways I don't have a pop-up or ad-blocker in my browser.

yes i use version 0.28.1 , change another browser maybe will work

@mmutiso I have found the same thing in release--0.31 at b3aa5633. This code is returned by the request to export at /dashboard/export_dashboards_form?id=1:

<script>
    window.onload = function() {
        window.open(window.location += '&action=go', '_blank');
        window.location = '/dashboard/list';
    };
</script>

This code adds the action=go query parameter and opens a new window at /dashboard/export_dashboards_form?id=1&action=go which serves the download JSON. But for some reason it fails. Something goes wrong and a new window does not open. Instead the page goes directly to /dashboard/list and nothing happens.

This happened once before in #3773.

I played with this for over an hour. It actually does work 10-20% of the time. The only fix I came up with was this:

<script>
    window.onload = function() {

        // See issue #7353
        var a = document.createElement('a');
        a.href = window.location + '&action=go';
        a.download = 'dashboards.json';
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);

        window.location = '{{ dashboards_url }}';    

    };
</script>

It does work. I'll submit a pull and see if this passes inspection.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eliab picture eliab  路  3Comments

sashank picture sashank  路  3Comments

amien90 picture amien90  路  3Comments

kalimuthu123 picture kalimuthu123  路  3Comments

john-bodley picture john-bodley  路  3Comments