Query Always Timing Out

Hello! I have a query that always times out. When I run it locally on postgres it executes in less than half a second, but in retool it times out. It reaches the max timeout time all the time (15 seconds). I know it's not a resource issue, since other queries using the same resource in the same retool work fine.

The response as a CSV is about 500kb and 15000 rows.

Any help would be appreciated!

Have you changed the timeout value in the query?
Screenshot 2023-03-31 at 12.38.40 PM

Hey all! Has this query worked before? Or is it your first time setting it up?

It’s always timing out even if the timeout is 5 or 15 seconds. A week ago the query wouldn’t time out but as of approximately yesterday it started timing out.

It was working for months with no issue!

Got it, it looks like this may be related to an incident that's being investigated on our end. The dev team will be rolling back the latest update as a temporary fix while they take a deeper look into it. Once that's done and we're back on 2.115 can you confirm whether or not the query is running properly?

Edit: The rollback has been completed!

Hey Kabirdas - sure! Let me know when the changes are rolled back and I can test.

I am running into the same thing here.

Standard connection to Azure Flexible Server to Postgres.

Simple queries that take less than 100ms to run, will fail to load for awhile, until suddenly it connects and works.
If I preview the query, it works, if I "save and run" it takes upwards of 10-20 executions for it to run.
I was able to sort of get it to work by setting "Cache to 1 day" and then periodically run the query every second.

Obviously this isn't the correct solution, but it did allow me to get it demo'able.

Hey @JT_BNB!

Sorry for not updating this thread - cause of the issue we were investigating here was rolled back which seemed to fix things. I imagine you might be running into something different :thinking:

Is there any pattern to the timeouts that you're seeing? Did they just start recently? Do they happen when there's higher traffic on your app?

Figured it out, our IT guy (yours truly) :smiley: only put the CIDR IP addresses in, not all of them.

What was happening is that it was rotating through and only the CIDR addresses were responding.

1 Like

Facing a similar issue. My snowflake query times out after 64 secs. Has the timeout issue been fixed yet? Timeout after is disabled for me.

Hey @prashanthi!

What version of Retool are you currently on? Snowflake queries have a fixed timeout cap of 60s on versions before 2.116.13, after which they should respect the DBCONNECTOR_QUERY_TIMEOUT_MS environment variable.

There are a couple different timeout issues that have been resolved in this thread, but it sounds like you may be running into something different. I'll go ahead and close this once your issue has been resolved to avoid further confusion!

If it's not supposed to be a long-running query or you're on 2.116.13 or higher, would you mind sharing more information about the query itself? And when you started running into the issue?

Knowing whether or not you're self-hosted would also help for debugging potential IP address issues as was JT_BNB's case.