服務資訊:
專案 ID: 697ab9faf2339c9e766cc7e2
服務 ID: 697abcff06505fdd547f876a
環境 ID: 697ab9fa86311f632dc238cb
PostgreSQL 備份工具版本: zeabur/postgresql-backup:0.3.1
服務狀態: RUNNING
錯誤日誌:
備份容器嘗試連接時出現以下認證錯誤:
[Zeabur] Pod/postgresql-backup-699a7a8f0c86e0ea4caaf2b5-9sv62 - Started: Started container postgresql-backup
[Zeabur] Pod/postgresql-backup-699a7a8f0c86e0ea4caaf2b5-9sv62 - Created: Created container: postgresql-backup
10.42.0.6 2026-02-22 03:40:01.235 UTC [70955] root@postgres FATAL: password authentication failed for user "root"
10.42.0.6 2026-02-22 03:40:01.247 UTC [70956] root@template1 FATAL: password authentication failed for user "root"
Role "root" does not exist.
問題描述:
備份工具試圖用不存在的使用者 "root" 連接到 PostgreSQL,導致認證失敗。PostgreSQL 中只存在 "postgres" 超級使用者。
已嘗試的解決方案:
✅ 添加環境變數 BACKUP_DATABASE_USER=postgres 和 BACKUP_DATABASE_PASSWORD - 無效
✅ 添加環境變數 PGUSER=postgres 和 PGHOST=localhost - 等待測試
✅ 檢查 PostgreSQL 認證配置 (pg_hba.conf) - 配置正確,使用 scram-sha-256 認證
✅ 驗證 PostgreSQL 服務狀態 - 服務正常運行
PostgreSQL 配置:
DATABASE_USER: postgres
DATABASE_PASSWORD: [已設定]
DATABASE_PORT: 5432
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
PGPASSWORD: ${DATABASE_PASSWORD}
pg_hba.conf 認證規則:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all all scram-sha-256
問題根源推測:
備份工具版本 0.3.1 可能有 bug,硬編碼了 "root" 使用者
備份容器無法正確讀取環境變數
備份容器與主 PostgreSQL 容器之間的通訊配置問題
期望的結果:
備份工具應該能夠使用正確的 PostgreSQL 認證資訊成功執行 pg_dumpall 命令。
附加資訊:
這是一個 Supabase PostgreSQL 實例
備份失敗時間: 2026-02-22 03:40:01 UTC
錯誤持續發生,每個備份週期都會失敗