From 0700aaf6d747dbadfddcaf3cd35e22b6b6a5c432 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 18 May 2026 07:51:23 +0200 Subject: [PATCH] fix(web-app-bookwyrm): use explicit /venv/bin paths and drop bash -l `bash -lc` triggers a login shell that sources /etc/profile, which resets PATH to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin and strips the Dockerfile's `ENV PATH=/venv/bin:$PATH`. The bookwyrm app then crashes with `ModuleNotFoundError: No module named 'environs'` and the celery worker dies with `celery: command not found`, both containers restart-loop, the bookwyrm vhost returns 502 and the deploy times out on the playwright readiness probe (CI run 26005522256 / job 76437356563 reproduces the same symptom). Switch the app command to `bash -c` (non-login) and address `python` and `celery` via their absolute /venv/bin/ paths so the venv is used regardless of PATH state. The worker now invokes celery directly, skipping the bash wrapper entirely. Empirically verified inside the running infinito stack by patching the rendered compose.yml + compose.ca.override.yml in place and recreating bookwyrm + bookwyrm-worker via `compose up -d --force-recreate`: - migrations run cleanly (oauth2_provider, sessions, ...) - gunicorn boots on 0.0.0.0:8000 - bookwyrm reports healthy via the curl healthcheck - worker stays Up (previously stuck Restarting (127)) Co-Authored-By: Claude Opus 4.7 (1M context) --- roles/web-app-bookwyrm/templates/compose.yml.j2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/web-app-bookwyrm/templates/compose.yml.j2 b/roles/web-app-bookwyrm/templates/compose.yml.j2 index a5135912e2..81318d0613 100644 --- a/roles/web-app-bookwyrm/templates/compose.yml.j2 +++ b/roles/web-app-bookwyrm/templates/compose.yml.j2 @@ -3,11 +3,11 @@ application: {% include 'roles/sys-svc-container/templates/base.yml.j2' %} command: >- - bash -lc ' - python manage.py migrate --noinput && - python manage.py collectstatic --noinput && - (python manage.py initdb || true) && - python -m gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:{{ container_port }} + bash -c ' + /venv/bin/python manage.py migrate --noinput && + /venv/bin/python manage.py collectstatic --noinput && + (/venv/bin/python manage.py initdb || true) && + /venv/bin/python -m gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:{{ container_port }} ' {{ lookup('template', 'roles/sys-svc-container/templates/build.yml.j2') | indent(4) }} args: @@ -31,7 +31,7 @@ {% include 'roles/sys-svc-container/templates/base.yml.j2' %} image: "{{ BOOKWYRM_CUSTOM_IMAGE }}" container_name: "{{ BOOKWYRM_WORKER_CONTAINER }}" - command: "bash -lc 'celery -A celerywyrm worker -l INFO'" + command: "/venv/bin/celery -A celerywyrm worker -l INFO" pull_policy: never volumes: - 'data:/app/data'