From aabb3d5009ec44ae13be900b914dc19729a2c0a1 Mon Sep 17 00:00:00 2001 From: JARVIS Date: Sat, 30 May 2026 23:28:52 -0500 Subject: [PATCH] fix(honcho/deriver): invoke via python -m so src.* imports resolve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deriver script does "from src import crud" at the top, which only works when the cwd / sys.path[0] is /app. Running the script by file path (python /app/src/deriver/deriver.py) puts /app/src/deriver on sys.path instead, and the import fails with ModuleNotFoundError. Switch to python -m src.deriver.deriver and explicitly set WorkingDir=/app so module resolution is deterministic across Podman versions. Discovered during the first deploy of the honcho role on lincoln — honcho-api was healthy on :8000 but the deriver crash-looped 26 times in two minutes. --- ansible/roles/honcho/templates/honcho-deriver.container.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/honcho/templates/honcho-deriver.container.j2 b/ansible/roles/honcho/templates/honcho-deriver.container.j2 index c3259a4..92aa10b 100644 --- a/ansible/roles/honcho/templates/honcho-deriver.container.j2 +++ b/ansible/roles/honcho/templates/honcho-deriver.container.j2 @@ -20,7 +20,8 @@ Network={{ honcho_network_name }} # Run the deriver script instead of the FastAPI server. The deriver # polls the queue and processes work in a loop. Number of concurrent # workers controlled via DERIVER_WORKERS. -Exec=/app/.venv/bin/python /app/src/deriver/deriver.py +WorkingDir=/app +Exec=/app/.venv/bin/python -m src.deriver.deriver # -- Database --------------------------------------------------------------- Environment=DB_CONNECTION_URI=postgresql+psycopg://{{ honcho_db_user }}:{{ honcho_db_password }}@{{ honcho_postgres_container_name }}:5432/{{ honcho_db_name }}