From 94d8e290bf6ba3492c091c7f0d2215aba5e3bcdf Mon Sep 17 00:00:00 2001 From: sstent Date: Tue, 28 Apr 2026 11:33:21 -0700 Subject: [PATCH] fix(entrypoint): wait for DB file before bind mounting --- entrypoint.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b22c827..b393f49 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -99,8 +99,21 @@ start_app() { # Ensure shared directories exist mkdir -p /shared_data/plugins /shared_data/cache /shared_data/backup /shared_data/artist_images + # Wait for LiteFS to expose the DB file in the FUSE mount + echo "Waiting for /data/navidrome.db..." + local db_timeout=30 + local db_count=0 + while [ ! -f /data/navidrome.db ] && [ $db_count -lt $db_timeout ]; do + sleep 1 + db_count=$((db_count + 1)) + done + + if [ ! -f /data/navidrome.db ]; then + echo "ERROR: /data/navidrome.db did not appear after ${db_timeout}s" + return 1 + fi + # Bind mount the DB so Navidrome finds it in its DataFolder - # We use bind mount because /shared_data is likely SMB and doesn't support symlinks touch /shared_data/navidrome.db mount --bind /data/navidrome.db /shared_data/navidrome.db