scribase
SQLSTATE 57P01admin_shutdownHTTP 500

Postgres error 57P01: admin shutdown

terminating connection due to administrator command

The server terminated this session, usually during a restart, a failover, scaling, or pg_terminate_backend.

Common causes

  • Planned maintenance, a restart after a configuration change, or a serverless database scaling down.
  • An administrator or a watchdog ended long idle sessions.

How to fix it

  • Reconnect and retry. Make sure your pool discards broken connections and opens new ones.

Through a REST API

PostgREST, the REST layer behind supabase-js and Scribase, answers HTTP 500 for this error and returns the SQLSTATE in the code field of the JSON error body.

Questions

What does Postgres error 57P01 mean?

57P01 is admin_shutdown in class 57 (Operator Intervention). The server terminated this session, usually during a restart, a failover, scaling, or pg_terminate_backend.

How do I fix 57P01?

Reconnect and retry. Make sure your pool discards broken connections and opens new ones.

What HTTP status does a REST API return for 57P01?

PostgREST, the REST layer behind supabase-js, answers 500.

Other class 57 errors

  • 57014 canceling statement due to statement timeout