Skip to content

upgrade-preflight.sh: migration-delta check fails on prod (psql auth) #623

Description

@Detair

Check 5/6 in infra/scripts/upgrade-preflight.sh runs

docker exec canis-postgres psql -U voicechat -d voicechat -tAc "SELECT count(*) FROM _sqlx_migrations"

On the beta VPS this fails with fe_sendauth: no password supplied (socket auth requires a password there, and the hardcoded voicechat role/db may not match the prod container's configuration), so preflight reports PREFLIGHT FAILED even when everything is actually healthy. Seen during the 2026-07-05 deploy; the other 5 checks passed and deploy proceeded (backup was 1h old and intact).

Also cosmetic in check 6: "Current server image" printed empty ("unknown") — the image-inspect command needs a look too.

Fix idea: derive credentials from the container's own environment inside the exec (sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" ...') with a fallback, or make role/db/password configurable via env like the rest of the script, and make sure it works against the real prod container setup.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions