From 4ab08ca7bdab16e5a28ba278deb97ca0e2bb49b4 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 2 Jun 2026 19:01:38 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20admin=20server=20must=20use=20shared=20a?= =?UTF-8?q?ssets.db=20=E2=80=94=20stale=20local=20copy=20caused=20'asset?= =?UTF-8?q?=20not=20found'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: Admin server's DB_PATH defaulted to its own assets.db (local copy with 7,560 assets) instead of the main app's DB (10,148 assets). Machine ID 68026 didn't exist in the stale copy. Fix: - Copied main app's assets.db over (now synced) - Set CANTEEN_DB_PATH in run.sh to default to ../canteen-asset-tracker/assets.db (env var can still override for custom setups) --- run.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index fd0f3f6..afe696e 100644 --- a/run.sh +++ b/run.sh @@ -1,10 +1,13 @@ #!/usr/bin/env bash -# Run the admin server — uses same DB as main canteen-asset-tracker -# CANTEEN_DB_PATH defaults to ../canteen-asset-tracker/assets.db +# Run the admin server — MUST use same DB as main canteen-asset-tracker set -euo pipefail PORT="${PORT:-8090}" HOST="${HOST:-0.0.0.0}" +APP_DIR="$(cd "$(dirname "$0")" && pwd)" +CANTEEN_DB_PATH="${CANTEEN_DB_PATH:-${APP_DIR}/../canteen-asset-tracker/assets.db}" + +export CANTEEN_DB_PATH exec python -m uvicorn admin_server:app \ --host "$HOST" \