Retool - timeout stuck at 60sec

Hello everyone,

I'm using your tool to create easy test environments for our AI tools. It works very well but I'm facing a big problem. After 60sec the call to my API automatically runs into Timeout and returns Error 504 (which also doesn't make too much sense to me). I've extended the timeout in Timeout -> Timeout after (ms) to 120000 and I think it's the max we can do, but it doesn't seem to work.
Retool is self-hosted, but I checked and I can guarantee that there are no constraints in the Pod or in the load balancer, I've set the env variable DBCONNECTOR_QUERY_TIMEOUT_MS to 120000, none of these changes has effect.
I'm also confident that the problem is not on the server side, because if I call the REST using other tools (postman or our software frontend), the error doesn't appear, and moreover I coded the server and it has all the timeout settings at 600s. Is it a bug or am I doing something wrong? Can you help me solve this?

Thank you
Simon

Hello @Simone_Grassi!

That is very odd, I haven't heard of any other users getting a 504 error using the AI tools.

Could you give me more details on the API call you are making? A screen shot of the request/query might help me better trouble shoot what the bug may be.

Is the server getting any type of error, or are you able to see the in the server logs that the request being made is coming in and reaching the server from the Retool Query?

Hello Jack,
thanks for your reply. I can give you all the details of an endpoint I created just to test this error, the endpoint just waits for 70 secs and then returns. It doesn't cause any problem, so from the backend/log I can see it properly running and terminating returning the value. So the timeout must be only from Retool side. I also underline, that if I use Postman or FastAPI docs from the same host as Retool, I don't get any timeout error.

@app.post("/test_timeout")
def _test_timeout() -> dict:
    t = 70 #sec
    logger.info(f"Waiting for {t} sec...")
    import time
    time.sleep(t)
    logger.info("I waited.")
    
    api_response = {
        "message": HTTPStatus.OK.phrase,
        "status-code": HTTPStatus.OK,
        "data": {"Iwaited ": t},
    }
    return api_response

Here instead you can see the query I'm running in Retool and the timeout after 60 secs.

I hope you can help me because we were planning to intensively use Retool in my company, but this problem is currently blocking.
Thanks
Simone

Thank you for the screen shots and the additional details!

We would love to help get to the bottom of this and to figure it out.

Could you provide more details on how you are self hosting?

Also you can increase the time for the variable DBCONNECTOR_QUERY_TIMEOUT_MS higher as outlined on our docs here.

Retool is hosted in a Kubernetes Pod to have access to the data inside the VPN and then is exposed outside. The backend is in the same VPN as any other resource. I've already set the env variable and tried to follow that guide, but it seems to not have effects. I can tell you that from the Pod where Retool is hosted, I can use curl to interrogate the test endpoint I mentioned above, and it works. So the problem is present only and uniquely when the query is sent from the Retool UI. That's why I was thinking about a bug in the software.

@Simone_Grassi Thank you for the details!

You have done all the right steps in trouble shooting this issue, that is very odd that the curl works fine for the test endpoint but not the Retool query.

My hunch is that there must be another location in the flow that has a time limiter on it still that we can toggle to get things working.

Are you using Helm for your Kubernetes deployment as outlined in our docs here?

Or are you using manifests for your Kubernetes deployment as outlined in our docs here?

Hello Jack,
Yes we used the first method with Helm, using the official helm chart without any special configuration. We also tried to set the env variable you suggested above in different ways, but still nothing changed.

Ok thank you, can you share with me a screenshot of your values.yaml file?

Can you also show me where and how you are setting up that env var?