From 2c25fabd428e8463af03066da0b7d2a46e2b3289 Mon Sep 17 00:00:00 2001 From: ang3l12 Date: Mon, 13 Jul 2026 13:45:27 -0600 Subject: [PATCH] Fix MySQL init script: executable bit + scope shell options in subshell Without the exec bit the MySQL entrypoint sources the script instead of executing it, leaking set -euo pipefail into MySQL's own startup shell and aborting first-time initialization (container exits -> unhealthy -> compose dependency failure). Co-Authored-By: Claude Fable 5 --- db/init/01-powerbi-user.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) mode change 100644 => 100755 db/init/01-powerbi-user.sh diff --git a/db/init/01-powerbi-user.sh b/db/init/01-powerbi-user.sh old mode 100644 new mode 100755 index e226175..61f3f4b --- a/db/init/01-powerbi-user.sh +++ b/db/init/01-powerbi-user.sh @@ -6,19 +6,24 @@ # grants below take effect as soon as Alembic creates the reporting views. # For an already-initialized database, run scripts/powerbi_grants.sql instead # (see README → "Power BI"). -set -euo pipefail +# +# NOTE: this file must stay executable (git mode 100755). The MySQL image +# *sources* non-executable init scripts into its own entrypoint shell, where +# stray `set` options can break MySQL's startup. The subshell below keeps +# everything scoped even if that happens. +( + set -e -if [ -z "${POWERBI_RO_PASSWORD:-}" ]; then - echo "[init] POWERBI_RO_PASSWORD not set - skipping powerbi_ro user creation." - exit 0 -fi - -mysql -u root -p"${MYSQL_ROOT_PASSWORD}" <