From fb5199c0949402ac554ec46b9787dad7186f613e Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 16 Mar 2026 16:35:09 -0700 Subject: [PATCH] fix: filter eval to only export lines in Infisical entrypoint The 2>&1 redirect captured stderr log messages into EXPORTS variable, causing eval to fail on "[infisical] ..." lines. Now only lines starting with "export" are eval'd. Co-Authored-By: Claude Opus 4.6 --- backend/entrypoint.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 983dda3..60c3092 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -48,14 +48,16 @@ try: except Exception as e: print(f'[infisical] Error: {e}', file=sys.stderr) sys.exit(1) -" 2>&1) || { +") || { echo "[infisical] WARNING: Failed to fetch secrets, starting with existing env vars" exec "$@" } if echo "$EXPORTS" | grep -q "^export "; then - COUNT=$(echo "$EXPORTS" | grep -c "^export ") - eval "$EXPORTS" + # Only eval lines starting with "export" — skip any log messages + EXPORT_LINES=$(echo "$EXPORTS" | grep "^export ") + COUNT=$(echo "$EXPORT_LINES" | wc -l) + eval "$EXPORT_LINES" echo "[infisical] Injected ${COUNT} secrets" else echo "[infisical] WARNING: $EXPORTS" @@ -81,9 +83,10 @@ try: print(f\"export {env_key}='{val}'\") except Exception as e: print(f'[smtp] Could not fetch from claude-ops: {e}', file=sys.stderr) -" 2>&1) || true +") || true if echo "$SMTP_OVERRIDES" | grep -q "^export "; then - eval "$SMTP_OVERRIDES" + SMTP_EXPORT_LINES=$(echo "$SMTP_OVERRIDES" | grep "^export ") + eval "$SMTP_EXPORT_LINES" echo "[infisical] Loaded SMTP config from claude-ops/mail" fi