mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Upgrade/repair: a down database must never block the pipeline.
scripts/upgrade.sh ran `main.py db upgrade` under set -e before repair.sh, so a broken Postgres bricked the very upgrade carrying the fix for it (seen live: the bootstrap bind-mount fix could not be delivered because the binds had already killed the cluster). repair.sh had the same problem with initialize_api_db.sh and the superuser psql. Warn and continue instead: the migration is retried by initialize_api_db.sh during repair, and if the database is still down afterwards the API reports it loudly while the system-level work (configs, services, bootstrap refresh) still completes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
9d778d25a5
commit
756c063d15
2 changed files with 11 additions and 5 deletions
|
|
@ -96,8 +96,11 @@ find /opt/wrolpi/venv -name "*.pyc" -delete 2>/dev/null || :
|
|||
|
||||
# Install any new Python requirements.
|
||||
/opt/wrolpi/venv/bin/pip3 install --upgrade -r /opt/wrolpi/requirements.txt
|
||||
# Upgrade the WROLPi database.
|
||||
(cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 /opt/wrolpi/main.py db upgrade)
|
||||
# Upgrade the WROLPi database. Never fatal: the database may be down and
|
||||
# repair.sh (which runs at the end of this upgrade) may be exactly what fixes
|
||||
# it; initialize_api_db.sh re-runs this migration there.
|
||||
(cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 /opt/wrolpi/main.py db upgrade) || \
|
||||
echo "WARNING: db upgrade failed (database down?); it will be retried during repair."
|
||||
|
||||
# Upgrade WROLPi Help.
|
||||
/opt/wrolpi/scripts/install_help_service.sh || echo "Help install failed."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue