Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to export Dashboards #23349

Open
kashifjavedaddo opened this issue Mar 13, 2023 · 7 comments
Open

Unable to export Dashboards #23349

kashifjavedaddo opened this issue Mar 13, 2023 · 7 comments
Labels
#bug Bug report

Comments

@kashifjavedaddo
Copy link

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to Dashboards.
  2. Click on Export in front of any dashboard
  3. See error

Expected results

A file dialog box should open allowing to select the path where to save the exported zip file.

Actual results

The file dialog box is not show. Rather a busy cursor animation in form of superset logo keeps showing in middle of screen as shown in screen shot

Screenshots

If applicable, add screenshots to help explain your problem.

image

Environment

(please complete the following information):

  • browser type and version: Google Chrome Version 110.0.5481.178 (Official Build) (64-bit)
  • superset version: Superset 2.0.1
  • python version: Python 3.10.6
  • node.js version: v16.19.1
  • any feature flags active: "ALERT_REPORTS": True,
    "VERSIONED_EXPORT": True

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ Y ] I have checked the superset logs for python stacktraces and included it here as text if there are any.

2023-03-13 18:01:51,088:ERROR:root:send_file() got an unexpected keyword argument 'attachment_filename'
Traceback (most recent call last):
File "/home/addo/superset/lib/python3.8/site-packages/flask_appbuilder/api/init.py", line 109, in wraps
return f(self, *args, **kwargs)
File "/home/addo/superset/lib/python3.8/site-packages/superset/views/base_api.py", line 113, in wraps
raise ex
File "/home/addo/superset/lib/python3.8/site-packages/superset/views/base_api.py", line 110, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/home/addo/superset/lib/python3.8/site-packages/superset/utils/core.py", line 1524, in time_function
response = func(*args, **kwargs)
File "/home/addo/superset/lib/python3.8/site-packages/flask_appbuilder/api/init.py", line 181, in wraps
return f(self, *args, **kwargs)
File "/home/addo/superset/lib/python3.8/site-packages/superset/utils/log.py", line 245, in wrapper
value = f(*args, **kwargs)
File "/home/addo/superset/lib/python3.8/site-packages/superset/dashboards/api.py", line 783, in export
response = send_file(
TypeError: send_file() got an unexpected keyword argument 'attachment_filename'
2023-03-13 18:01:51,106:INFO:werkzeug:192.168.1.120 - - [13/Mar/2023 18:01:51] "GET /api/v1/dashboard/export/?q=!(17)&token=QKK3jmi-C HTTP/1.1" 500 -

  • [Y ] I have reproduced the issue with at least the latest released version of superset.
  • [Y ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

@kashifjavedaddo kashifjavedaddo added the #bug Bug report label Mar 13, 2023
@kashifjavedaddo
Copy link
Author

Hi everyone,
We are facing above issue in apache superset installed from scratch on ubuntu.
Looking forward to hearing from experts about possible resolution.
Have a nice day.
Regards,
Kashif Javed Rana

@santoshmallah
Copy link

I am also getting the same error I have resolved this by modifying the code in the dashboard API here is the steps.
Go to this location
/home/addo/superset/lib/python3.8/site-packages/superset/dashboards/api.py", line 783

change this code

response = send_file(
                buf,
                mimetype="application/zip",
                as_attachment=True,
                download_name=filename,
                # attachment_filename=filename,
            )

I hope this will work for you.

@kashifjavedaddo
Copy link
Author

Thank you so much Santosh Mallah.

It worked like a charm.

I did the same for charts as well and am able to export both now.

Thanks once again.

Regards,

Kashif Javed Rana

@nairsmalu
Copy link

@santoshmallah when I do this, I get the following error:
TypeError: No name provided for attachment. Either set 'download_name' or pass a path instead of a file.

@toransahu
Copy link

I'm also facing the exact issue. I think this issue should be kept open.

The fix mentioned here is just a workaround, it needs to be fixed in the repo.

I am also getting the same error I have resolved this by modifying the code in the dashboard API here is the steps. Go to this location /home/addo/superset/lib/python3.8/site-packages/superset/dashboards/api.py", line 783

change this code

response = send_file(
                buf,
                mimetype="application/zip",
                as_attachment=True,
                download_name=filename,
                # attachment_filename=filename,
            )

I hope this will work for you.

@toransahu
Copy link

toransahu commented Sep 14, 2023

Seems like the fix /pull/24033 has already merged into the master. superset > 2.1.0 should have the fix.

PS: It got introduced because of a deprecating change pallets/flask@15a3e82 in Flask

@kashifjavedaddo
Copy link
Author

Hi,

We are facing the same issue on two superset instances after upgrading to Version 3.1.1 on both instances. After clicking on Export icon, busy cursor keeps running and export file is not downloaded.

I have checked the code in python3.9/site-packages/superset/dashboards/api.py:

It is as it should be as shown below:

    response = send_file(
            buf,
            mimetype="application/zip",
            as_attachment=True,
            download_name=filename,
        )

Please reopen this issue and assist in solving the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants