Conversation
Adds §4a to notes/CASCOR_CONDA_ENV_FIX_2026-05-07.md describing the secondary failure mode hit during the 2026-05-08 plant_all run and the out-of-repo fix applied to both env-local activate hooks. Symptom: juniper_plant_all.bash aborted silently on ``conda activate JuniperCanopy1`` with exit code 1, the cleanup ERR trap output also swallowed. Root cause: the LIBTORCH-strip activate hooks in JuniperCanopy1 and JuniperCascor used a ``grep -v /rust_mudgeon/`` pipeline. When LD_LIBRARY_PATH consisted of *only* a rust_mudgeon segment (which is the default state set by ~/.bashrc), grep exited 1 → pipefail → set -e killed the activate hook mid-flight → conda's var-context bookkeeping was left inconsistent → bash emitted the ``pop_var_context: head of shell_variables not a function context`` cascade. Fix: replaced the grep+paste pipeline in both hooks with a pure-bash ``IFS=':' read -ra _segs`` split + filter loop — no subprocess that can fail under pipefail. Both hooks now activate cleanly under ``set -euo pipefail`` and plant_all runs end-to-end with all four services healthy. The hook files themselves live under /opt/miniforge3/envs/<env>/etc/conda/activate.d/ and are not part of the repo; documenting the diagnosis and the canonical fix here so a future env rebuild reinstates the pure-bash split instead of the fragile grep pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds §4a to
notes/CASCOR_CONDA_ENV_FIX_2026-05-07.mddocumenting asecondary failure mode discovered during a fresh
./util/juniper_plant_all.bashrun on 2026-05-08:conda activate JuniperCanopy1with
exit_code=1and no error output (even the cleanup ERR-trapmessage was swallowed).
JuniperCanopy1and
JuniperCascorused agrep -v /rust_mudgeon/pipeline. WhenLD_LIBRARY_PATHis only a single rust_mudgeon segment (the defaultstate set by
~/.bashrc), grep exits 1 → pipefail fails the pipeline→
set -ekills the activate hook mid-flight → conda's var-contextbookkeeping is inconsistent → bash emits
pop_var_context: head of shell_variables not a function contextcascades.IFS=':' read -ra _segssplit + filter loop inboth hooks. No subprocess that can fail under pipefail. Confirmed all
four services (data / cascor / canopy / worker) come up healthy after
the fix.
The hook files live under
/opt/miniforge3/envs/<env>/etc/conda/activate.d/(out-of-repo); this PR captures the diagnosis and canonical replacement
inline so a future env rebuild reinstates the safe pattern.
Test plan
set -euo pipefailbefore the fix🤖 Generated with Claude Code