The export to csv/xls works fine unless I am exporting a very large file which produces a 502 error. I am assuming that it is just timing out. Is there an env variable that I need to change? I can’t find anything on this forum about this issue.

Thanks.

It also happens to me when I tried to export very large file to XLS. But it always works fine if I export to CSV. I am using hosted Redash.

My guess is that we have the same issue just that your csv file that is successfully downloading is small enough to download.

Hi, @dribble

Did you check Gunicorn’s configurations?
I guess it’s one of the reason why you stuck by 502 error.

Here is the my blog entry.
(But it’s written in Japanese but I guess you can understand with Google Translate :wink:

http://ariarijp.hatenablog.com/entry/2019/06/07/234851

2 Likes

Very nice!

ありがとうございました

1 Like

Thank you so much @ariarijp!

This solved our 502 issue regarding large xlsx files!

1 Like

Changing the environment variables in docker-compose.yml file can only change the limit up to 60 seconds. It is also limited by nginx. So if you want to export a file that take more than 60 seconds to generate, you also need to rebuild the nginx image (change the proxy_read_timeout parameter)

upstream redash {
  server redash:5000;
}

server {
  listen   80 default;

  gzip on;
  gzip_types *;
  gzip_proxied any;

  location / {
    proxy_read_timeout 300;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;

    proxy_pass       http://redash;
  }
}