Skip to content

Supavisor error: 'Circuit breaker open' after password rotation

Last edited: 8/12/2026

如果你看到带有以下错误信息之一的FATAL: Circuit breaker open

🌐 If you are seeing FATAL: Circuit breaker open with one of the error messages:

  • failed to retrieve database credentials after multiple attempts, new connections are temporarily blocked
  • too many failed attempts to connect to the database, new connections are temporarily blocked
  • too many authentication failures, new connections are temporarily blocked

这表示连接池已阻止了原始 IP,以保护数据库。

🌐 it indicates that the connection pooler has blocked the origin IP to protect the database.

这种情况通常发生在客户端在密码轮换后尝试使用过时的密码连接到连接池(端口 5432 或 6543)时。

🌐 This typically happens when clients attempt to connect to the pooler (ports 5432 or 6543) using an outdated password after a rotation.

这是为什么会发生?

  • 为了防止因为认证失败尝试过多而导致数据库超载,Supavisor 会触发断路器。
  • 一旦触发,源 IP 最多会被封锁 2 分钟。
  • 如果客户在这段时间内继续尝试使用无效凭证连接,断路器将重新启动,实际上会延长锁定时间。

如何解决这个问题:

  • 停止客户端: 关闭当前尝试使用错误凭据连接到池化器的应用实例或服务。
  • 更新凭证: 确保所有连接字符串和环境变量都更新为新的数据库密码。
  • 重启服务: 恢复应用流量,客户端在锁定期结束后将能够重新连接。

预防措施: 为了避免将来出现 IP 锁定问题,在更换数据库密码之前先停止应用实例。只有在新凭据成功应用到配置后,才重新启动你的服务。