Browse Source

Fix DATABASE_URL not exported before migrate_db in start.sh

wait_for_pg() set DATABASE_URL via := default syntax but never exported it,
so Python child processes (manage.py migrate, waffle_switch) could not read
it from the environment. The .env file does not exist yet at that point —
write_env_file runs later — so decouple raised UndefinedValueError.

Add 'export DATABASE_URL' immediately after the default is resolved in
wait_for_pg(), which is the earliest point in the startup sequence where
the value is known and already used by configure_pg_timezone right after.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rate-limiter-2026
Edward Ribeiro 3 weeks ago
parent
commit
af88dd2506
  1. 1
      docker/startup_scripts/start.sh

1
docker/startup_scripts/start.sh

@ -141,6 +141,7 @@ write_env_file() {
wait_for_pg() {
: "${DATABASE_URL:=postgresql://sapl:sapl@sapldb:5432/sapl}"
export DATABASE_URL
log "Waiting for Postgres..."
/bin/bash wait-for-pg.sh "$DATABASE_URL"
}

Loading…
Cancel
Save