Skip to content

fix(backend): exit non-zero from prestart.sh when any init step fails - #7

Open
kpool-std-tideline-pilot[bot] wants to merge 2 commits into
codex/user-live-f3e3eca09f6afrom
kpool/changes/7aaa82cb080aa3ca22dc847b43435d8f5ed8e2544d1932e397fcbd82eff5436f
Open

kpool-std-tideline-pilot[bot] wants to merge 2 commits into
codex/user-live-f3e3eca09f6afrom
kpool/changes/7aaa82cb080aa3ca22dc847b43435d8f5ed8e2544d1932e397fcbd82eff5436f

Conversation

@kpool-std-tideline-pilot

Copy link
Copy Markdown

Problem

backend/prestart.sh runs three sequential initialization steps with no failure guard, so a failing step (DB availability check, alembic upgrade head, or initial_data.py) is ignored and the remaining steps still execute. The container can then start against an un-migrated/unseeded database.

Fix (minimal)

Add set -e immediately after the shebang, before the first step. After the change:

  • any non-zero exit from backend_pre_start.py, alembic upgrade head, or initial_data.py aborts the script right away with a non-zero status;
  • the step order on the success path is unchanged (DB wait → migrations → initial data) and a fully successful run still exits 0.

Only backend/prestart.sh is touched. No other file, the default branch, or any production environment is changed, and this PR is not to be merged by the agent.

Verification

Relies on the repository CI workflow (.github/workflows/kpool-user-live.yml, job test) triggered by this change branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants