Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: Troubleshooting "Failed to run sql query: connection terminated due to connection timeout" (#40336)

Timothy Lim1e0f7b38bf03
diff --git a/apps/docs/content/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.mdx b/apps/docs/content/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.mdx
new file mode 100644
index 00000000000..95075fbfe7a
--- /dev/null
+++ b/apps/docs/content/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.mdx
@@ -0,0 +1,25 @@
+---
+title = "Error: Failed to run sql query: Connection terminated due to connection timeout"
+topics = [ "database", "studio" ]
+
+[[errors]]
+http_status_code = 500
+message = "Error: Failed to run sql query: Connection terminated due to connection timeout"
+---
+
+![Failed to run sql query: Connection terminated due to connection timeout](/docs/img/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.jpg)
+
+This error typically happens when the database is overloaded and causing an outage. As the database does not respond in a timely manner there can be a variety of symptoms such as tables not loading, error messages related to retrieving data and the dashboard seems to be unresponsive.
+
+- Check your database health in [Database reports](/dashboard/project/_/reports/database).
+- If needed, increase resources in [Compute and Disk](/dashboard/project/_/settings/compute-and-disk).
+
+Review the appropriate guides based on your scenario:
+
+- [High CPU usage](/docs/guides/troubleshooting/high-cpu-usage)
+- [High RAM usage](/docs/guides/troubleshooting/exhaust-ram)
+- [High Swap usage](/docs/guides/troubleshooting/exhaust-swap)
+- [High Disk I/O](/docs/guides/troubleshooting/exhaust-disk-io)
+- [Query optimization](/docs/guides/database/query-optimization)
+
+You can also set up alerts using a [Prometheus endpoint / Grafana charts](/docs/guides/telemetry/metrics) to monitor vital resources.
diff --git a/apps/docs/public/img/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.jpg b/apps/docs/public/img/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.jpg
new file mode 100644
index 00000000000..05ac0011045
Binary files /dev/null and b/apps/docs/public/img/troubleshooting/failed-to-run-sql-query-connection-terminated-due-to-connection-timeout.jpg differ