- My goal: Get our Retool apps to reliably load their queries without random 60-second timeouts.
- Issue: When an app fires multiple queries in parallel on page load, a random subset of them hangs and returns HTTP 504 at exactly 60 seconds. Number of failures per load is random. Sometimes 0, sometimes up to 4 out of 6. And the failing query names shuffle each time. Refresh sometimes fixes it, sometimes not. Only affects one Postgres resource, which is the only resource that uses the built-in SSH tunnel.
- Retool version & hosting setup (Docker, K8s, cloud provider, etc.): Self-hosted via docker-compose on a single Ubuntu EC2 host. Retool v3.284.0.
- Error message(s) or screenshots: The 504 response body is the bare nginx page, not a Retool error
- What I’ve tried so far:
-
Ran the exact same query via
psqlthrough the same SSH tunnel: returns in ~40 ms every time -
During a failure, the SSH bastion sees no connection attempts for the failed queries. They never leave the Retool host
-
Other Postgres resources in the same VPC as the Retool instance (no SSH tunnel) never show this problem
-
Audited the VPC setup in both AWS accounts. It's a simple one-VPC/one-NAT-per-account layout, nothing per-AZ that would cause intermittent partial failures. Route tables, NACLs, and security groups all check out.