Skip to content

fix: make overlay dep grep non-fatal under pipefail (#281)#381

Open
jeremylongshore wants to merge 1 commit into
paradigmxyz:mainfrom
jeremylongshore:fix/entrypoint-zero-dep-overlay-grep
Open

fix: make overlay dep grep non-fatal under pipefail (#281)#381
jeremylongshore wants to merge 1 commit into
paradigmxyz:mainfrom
jeremylongshore:fix/entrypoint-zero-dep-overlay-grep

Conversation

@jeremylongshore
Copy link
Copy Markdown

Fixes #281.

services/api/entrypoint.sh runs under set -euo pipefail. When an overlay tool dir exists but yields zero pip deps, _extra_deps is just a newline, so the [[ -n "${_extra_deps}" ]] guard passes but grep -v '^$' matches nothing and exits 1. With no || true, the script aborts before exec "$@" and the api pod CrashLoopBackOffs with empty logs.

One-line guard on the grep, as suggested in the issue:

-    echo "$_extra_deps" | sort -u | grep -v '^$' > /tmp/_extra_deps.txt
+    echo "$_extra_deps" | sort -u | grep -v '^$' > /tmp/_extra_deps.txt || true

No effect on the success path: with real deps grep exits 0 and the guard is a no-op; with none, the empty file is already handled by the guarded uv pip install -r ... || true on the next line.

Tested: shellcheck clean, bash -n ok, and an isolated repro of the fragment crashes before / passes after. I couldn't run the full overlay-mount path end-to-end without the cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api entrypoint.sh crashes when an overlay tool dir yields zero pip deps (fatal grep under pipefail)

1 participant