CSV export 504 gateway time-out


I’m getting 504 gateway time-out when i’m trying to export raw data with around 10-20k rows. It is nowhere near the 1 million limit, and it is very frustrating to be limited by such a small export limit. This should not be happening, so can someone help me to figure what may be causing this, and how to get around this problem? Thanks!

Hi @yuhao
You need to check the logs to see what is causing the timeout.
Which version of Metabase? Are you using Docker or JAR-file or …? Are you using a custom reverse proxy like Apache or Nginx?

i’m using matabase v0.31.2 on the browser. I’m not aware if i’m using any Docker or JAR-file, but i don’t think so.

The timeout shows “nginx/1.13.8”, so i’m guessing i have a Nginx reverse proxy on the network. If this is the problem, is there a way for me to get around it?

It sounds like you’re not administrator of the system, so you need to contact whoever is running everything.
For reference: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout

And what should i ask the administrator to do?

Increase the proxy timeout limit on nginx?

Look at the logs to figure out which service is closing the connection, then increase the timeout of that service. It sounds Nginx would be first step.

I’m having this very same issue with 0.32.10, but in the logs it happens to show

ago 30 13:36:34 INFO metabase.middleware.exceptions :: Requisição cancelada antes de finalizar
ago 30 13:36:34 ERROR metabase.middleware.log :: Error logging API request

Translating, “Requisição cancelada antes de finalizar” means “request canceled before finishing”, or something like that, and tha’s about it, no additional info on the matter.

I’m running metabase with a jar file on a Amazon EC2, and accessing it via a load balancer. Any remote ideas of what could be the cause? Maybe the AWS configs? Is it sure (so to speak, of course) that this can only be caused by external stuff, and not metabase misbehaviour?

EDIT: the problem seems only to happen with filtered results. When I export raw results (around the same amount, 2k rows), it will download just fine. The problem is such that even the data visualization is more buggy (rows will take a while to show while scrolling, making the screen to look blank for brief moments) with filtered results (and, potenciall, fields with a join - too many possbilities to evaluate at once).


PR 10756, which was merged yesterday, might fix something for ELB, but it sounds like multiple different problems.

For the API error. There’s two issues with similar error and looks like they’re are using a LB: #9533 and #10108

As for the visualization being blank for a while. Check your browser, since data is downloaded on page load, but the visualization is loaded when it comes into view by your browser.

Update: I really don’t get what is happening. The issues happens with a question, but, when I do the same thing with another one, the export works normally. Seems to be related to joined fields, but I can’t tell for sure.

The visualization being blank for a while is really brief, not a real problem, not even bothering about that. It is like half a second, so, no problems - I just said that to highlight that the behaviour was a bit different, but not a real concern to me, actually.

I’m gonna take a look at those issues. Thanks.

Which database are you querying? Can you see anything in the database log, which causes an error, which Metabase is doing something wrong to?

Not really, because the query runs finely. The problems occurs only in the frontend, essentially. I’m querying a MySQL database, anyway. Even weirder is the fact that, if I convert the question to SQL, I can download the results instantly, like usual. I can’t really understand what is going on, nor provide additional details, given the fact that the logs are somewhat silent about it :frowning:

Do you see anything in the browser console, since you say it’s a frontend issue?
It seems like the problem is difficult to reproduce, which means it will be difficult/impossible to fix, so if you have any way of reproducing, then please write it and I’ll try :+1: