Errors / checked October 9, 2026
Timeout of 2000 ms reached. Total time: 2001.2 ms
The error
The error_msg column of net._http_response, for an HTTP call made with pg_net, often from a Supabase Cron job (net.http_post or net.http_get).
Quick fix
- Pass a bigger timeout on the call: net.http_post(url := ..., body := ..., timeout_milliseconds := 30000). The pg_net function signature in Supabase's docs defaults it to 2000.
- Make the endpoint answer fast: return 202 right away and do the slow work after responding (for an Edge Function, in a background task).
- Read the response table soon: pg_net keeps responses for 6 hours, so check net._http_response for timed_out = true before the rows are gone.
Why this happens
pg_net sends the request without waiting and gives up after timeout_milliseconds. The message breaks down where the time went (DNS, TCP/TLS handshake, request and response), which tells you whether the endpoint was slow or never reached. pg_net does not retry a timed-out request.
Source: Supabase: pg_net (timeout_milliseconds, response retention)
Other solutions
- Newer pg_net releases default to 5000 ms and cap timeouts with pg_net.max_timeout_ms; Supabase's docs still show 2000 for the hosted version.
- If the job is calling a URL on a schedule, a scheduler outside the database avoids the short default and the 6-hour history. RunLater waits up to 5 minutes for a response, retries failures with backoff and keeps each response 7 to 90 days.
Check a schedule before you deploy it: the cron expression explainer shows the next 10 run times.
Frequently asked questions
Where do I see pg_net errors?
In the net._http_response table: status_code, timed_out and error_msg for each request id. Rows are kept for 6 hours.
Does pg_net retry a failed request?
No. A timed-out or failed request stays failed; retrying means writing your own SQL that reads net._http_response and calls again.
What does "Total time" in the message mean?
How long pg_net waited in all, split into DNS lookup, TCP/TLS handshake and the request/response itself. A long handshake points at the network; a long request/response time means the endpoint was slow to answer.
Have the URL called on schedule, with retries
RunLater calls your URL on a cron schedule or at an exact time, in your timezone, retries failed calls with backoff and logs each response, so a timeout or a 5xx shows up in a log instead of disappearing.