From cfb16d5048471d7cdb410081aa5b887b04439a5c Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sun, 5 Apr 2026 16:31:41 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20bootstrap=20OIDC=20config=20=E2=80=94=20?= =?UTF-8?q?add=20retry=20and=20null=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 7 server health check failed intermittently due to timing. Add 3-attempt retry loop with 2s sleep. Guard against jq returning literal "null" string for TRAD_SECRET. Add debug logging for both preconditions. Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/logto-bootstrap.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker/logto-bootstrap.sh b/docker/logto-bootstrap.sh index c308632..c5347ab 100644 --- a/docker/logto-bootstrap.sh +++ b/docker/logto-bootstrap.sh @@ -171,6 +171,7 @@ else }") TRAD_ID=$(echo "$TRAD_RESPONSE" | jq -r '.id') TRAD_SECRET=$(echo "$TRAD_RESPONSE" | jq -r '.secret') + [ "$TRAD_SECRET" = "null" ] && TRAD_SECRET="" log "Created Traditional app: $TRAD_ID" fi @@ -415,7 +416,15 @@ fi # PHASE 7: Configure cameleer3-server OIDC # ============================================================ -SERVER_HEALTHY=$(curl -sf "${SERVER_ENDPOINT}/api/v1/health" 2>/dev/null && echo "yes" || echo "no") +SERVER_HEALTHY="no" +for i in 1 2 3; do + if curl -sf "${SERVER_ENDPOINT}/api/v1/health" >/dev/null 2>&1; then + SERVER_HEALTHY="yes" + break + fi + sleep 2 +done +log "Phase 7 check: SERVER_HEALTHY=$SERVER_HEALTHY, TRAD_SECRET length=${#TRAD_SECRET}" if [ "$SERVER_HEALTHY" = "yes" ] && [ -n "$TRAD_SECRET" ]; then log "Configuring cameleer3-server OIDC..."