Error Codes
SQLSTATE error codes returned by PgBeam, what causes them, and how to resolve each one.
PgBeam returns standard PostgreSQL SQLSTATE error codes. This reference covers every PgBeam-specific error, what triggers it, and how to fix it.
Quick reference
| SQLSTATE | Situation | Message |
|---|---|---|
08004 | Unknown project | project not found for hostname ... |
08004 | Organization suspended | organization suspended — update payment at dash.pgbeam.com |
08004 | Auth rate limited | too many authentication attempts |
08006 | Upstream auth failure | Forwarded from upstream |
08006 | Circuit breaker open | upstream unavailable (circuit breaker open) |
53300 | Connection limit exceeded | too many connections for project |
53400 | Query rate limit exceeded | query rate limit exceeded |
08004 — Connection rejected
SQLSTATE 08004 means PgBeam rejected the connection before it reached the
upstream database. The three causes are distinct:
Project not found
FATAL: project not found for hostname "xyz.aws.pgbeam.app"Cause: The hostname in the connection string does not match any project. This usually means a typo in the hostname or a deleted project.
Fix:
- Verify the hostname in your
DATABASE_URLmatches the project hostname shown in the dashboard - Check that the project has not been deleted
- If using a custom domain, confirm the domain is verified — see Custom Domains
Organization suspended
FATAL: organization suspended — update payment at dash.pgbeam.comCause: The organization's billing is inactive. This happens when a payment fails, the trial expires without a payment method on file, or an owner manually cancels the subscription.
Fix:
- Log in to dash.pgbeam.com and go to Settings > Billing
- Update the payment method or reactivate the subscription
- Connections resume immediately after billing is restored
Auth rate limited
FATAL: too many authentication attemptsCause: Too many failed authentication attempts from the same IP address in a short period. PgBeam rate-limits auth attempts per IP to protect the upstream database from brute-force attacks.
Fix:
- Verify your credentials are correct by connecting directly to the origin database
- Wait for the rate limit window to expire (typically a few minutes)
- If the issue persists, check for misconfigured clients that are retrying with wrong credentials in a loop
08006 — Connection failure
SQLSTATE 08006 means PgBeam accepted the connection but could not complete the
upstream handshake.
Upstream auth failure
FATAL: password authentication failed for user "myuser"Cause: The credentials were forwarded to the origin database and it rejected them. PgBeam passes this error through as-is.
Fix:
- Connect directly to the origin database with the same username and password to confirm they work
- Verify the database name in the PgBeam project configuration matches the actual database
- Check that the user has
CONNECTpermission on the database - If the origin uses
pg_hba.confrules, confirm the PgBeam IP range is allowed
Circuit breaker open
FATAL: upstream unavailable (circuit breaker open)Cause: The origin database failed 3 consecutive connection attempts. PgBeam opens a circuit breaker to stop sending traffic to an unhealthy upstream. The breaker probes for recovery every 5 seconds, backing off exponentially up to 60 seconds.
Fix:
- Check the health of your origin database — can you connect to it directly?
- Verify network connectivity between PgBeam and the origin (firewall rules, security groups, IP allowlists)
- Check if the origin has hit its own connection limit (
max_connectionsin PostgreSQL) - Wait for the circuit breaker to probe and recover automatically, or restart the origin database if it is down
See Resilience for details on circuit breaker behavior.
53300 — Too many connections
FATAL: too many connections for projectCause: The project has reached its concurrent connection limit. Each plan tier has a maximum number of simultaneous connections:
| Plan | Connection limit |
|---|---|
| Starter | 20 |
| Pro | 100 |
| Scale | 500 |
Fix:
- Reduce client-side pool size. If you are running multiple application instances, each with a pool of 20 connections, they add up quickly. With PgBeam handling upstream pooling, a client-side pool of 3-5 per instance is usually sufficient.
- Switch to transaction pool mode. Session mode (the default) holds an upstream connection for the entire client session. Transaction mode releases it after each transaction, dramatically improving connection reuse. See Connection Pooling.
- Close idle connections. Check for long-lived idle connections from monitoring tools, migration scripts, or dev environments that hold connections open unnecessarily.
- Upgrade your plan if the workload has genuinely outgrown the current tier.
53400 — Query rate limit exceeded
FATAL: query rate limit exceededCause: The project exceeded its queries-per-second (QPS) limit:
| Plan | QPS limit |
|---|---|
| Starter | 20 |
| Pro | 100 |
| Scale | 1,000 |
Fix:
- Enable caching for frequently repeated reads. Cached queries do not count against the QPS limit at the upstream. See Caching.
- Reduce query frequency. Batch reads where possible, or add application-level deduplication for concurrent identical queries.
- Upgrade your plan for a higher QPS allowance.
Handling errors in application code
Most PostgreSQL drivers expose the SQLSTATE code programmatically. Use it to distinguish PgBeam-specific errors from upstream database errors:
try {
await pool.query("SELECT 1");
} catch (err) {
if (err.code === "53400") {
// Rate limited — back off and retry
} else if (err.code === "53300") {
// Too many connections — reduce pool size
}
}import psycopg
try:
cur.execute("SELECT 1")
except psycopg.errors.TooManyConnections:
# SQLSTATE 53300
pass
except psycopg.errors.ConfigurationLimitExceeded:
# SQLSTATE 53400
pass_, err := pool.Exec(ctx, "SELECT 1")
if err != nil {
var pgErr *pgconn.PgError
if errors.As(err, &pgErr) {
switch pgErr.Code {
case "53400":
// Rate limited
case "53300":
// Connection limit
}
}
}try {
stmt.execute("SELECT 1");
} catch (SQLException e) {
if ("53400".equals(e.getSQLState())) {
// Rate limited
} else if ("53300".equals(e.getSQLState())) {
// Connection limit
}
}Further reading
- Troubleshooting — Step-by-step debug workflows for common failures
- Resilience — Circuit breaker states, scale-to-zero, and recovery behavior
- Plans & Limits — Connection, QPS, and query quotas per plan tier