fix(bench): Pass build-relevant env into SSH sessions - #566
Open
balamurali27 wants to merge 1 commit into
Open
Conversation
sshd builds a fresh environment per session, and this config sets UsePAM no and PermitUserEnvironment no, so none of the bench image's ENV reaches an SSH shell. A manual `bench build` over SSH therefore symlinked assets instead of hard-linking them, while the same command via `docker exec` did the right thing. Kept to a single SetEnv line because sshd keeps only the first one it reads (verified with `sshd -T`). PATH is left out since it embeds the node version.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
echo $FRAPPE_HARD_LINK_ASSETSinside a bench over SSH comes back empty, even though the image sets it.sshd builds a fresh environment for each session rather than inheriting its parent's. This config sets
UsePAM no(so no/etc/environment) andPermitUserEnvironment no(so no~/.ssh/environment), which leaves nothing to carry the image'sENVthrough. Result: a manualbench buildover SSH symlinks assets, while the identical command viadocker exec(agent'sRebuild Bench Assets) hard-links them.Added a
SetEnvline with the vars that are safe and meaningful in a shell session.Two things worth knowing
SetEnvdoes not merge across lines. sshd keeps only the first one it reads — the "first obtained value wins" rule. Verified:Hence the single long line. Anyone adding a var later must append to it, not add a line — the comment says so.
PATHis deliberately excluded. The image builds it as$PATH:/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin, and the node version isn't known to this static file. SSH sessions still won't findnode/yarn— separate problem, not fixed here.Config parses clean under
sshd -T, and the trailing space inHISTTIMEFORMATsurvives (it's inside the quotes).Rollout
Bench.start()bind-mounts the host'sconfig/over the image's, and that host copy is seeded once atbench_initviadocker run ... cp -LR config/. configmount. So this reaches new benches only — existing benches keep their baked-insshd_configuntil they're recreated.Related
Companion fix in press for the image-build side of the same symptom: frappe/press#7076
🤖 Generated with Claude Code