From 45e40bf273a075df03893e6f1b9e2a2950083090 Mon Sep 17 00:00:00 2001 From: sstent Date: Mon, 27 Apr 2026 10:23:30 -0700 Subject: [PATCH] debug(entrypoint): add logging to check_primary --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1542f61..cefd4ab 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,12 +16,13 @@ PRIMARY_TAGS='["navidrome","web","traefik.enable=true","urlprefix-/navidrome","t # Check if this node is the LiteFS Primary # LiteFS 0.5 status API returns a flat object: {"isPrimary": true, ...} check_primary() { - local status=$(curl -s http://localhost:20202/info || echo "{}") + local status=$(curl -s http://localhost:20202/info || echo "{\"error\": \"curl failed\"}") local is_primary=$(echo "$status" | jq -r 'if type == "object" then (.isPrimary // false) else false end' 2>/dev/null || echo "false") if [ "$is_primary" = "true" ]; then return 0 # We are the primary fi + echo "check_primary: Not primary. Status: $status" return 1 # We are a replica }