From af88dd250673900ceb562ecd135e0c3cc6c62f68 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Tue, 14 Apr 2026 04:03:14 -0300 Subject: [PATCH] Fix DATABASE_URL not exported before migrate_db in start.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docker/startup_scripts/start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/startup_scripts/start.sh b/docker/startup_scripts/start.sh index d1ecdb804..fa068a42f 100755 --- a/docker/startup_scripts/start.sh +++ b/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" }