fix(docker): chown runtime node_modules trees to hermes user (#18800)#19303
Closed
nudiltoys-cmyk wants to merge 1 commit into
Closed
fix(docker): chown runtime node_modules trees to hermes user (#18800)#19303nudiltoys-cmyk wants to merge 1 commit into
nudiltoys-cmyk wants to merge 1 commit into
Conversation
Contributor
Author
|
fwiw #20500 was filed today as a duplicate with the same root cause, and you tagged this PR as the fix. so leaving the chown patch as-is happy to pick up vroomfondel's trigger-2 work from #18800 (the workspace |
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.
What does this PR do?
the container drops privileges to the hermes user (uid 10000) in entrypoint.sh, but /opt/hermes/ui-tui and /opt/hermes/node_modules are root-owned from build time. the TUI launcher's _tui_need_npm_install() check trips on every startup (see the existing npm_config_install_links=false comment in the Dockerfile) and runs npm install in /opt/hermes/ui-tui, which fails with EACCES and the Chat tab closes immediately as
[session ended]chown both runtime trees to hermes:hermes in the existing permissions block. /opt/hermes/web is build-time only (HERMES_WEB_DIST points at hermes_cli/web_dist for runtime) and is intentionally not chowned
Related Issue
Fixes #18800
Type of Change
Changes Made
Dockerfile: chainedchown -R hermes:hermes /opt/hermes/ui-tui /opt/hermes/node_modulesonto the existingchmod -R a+rX /opt/hermesRUN under the Permissions block, with a short comment explaining why /opt/hermes/web is excludedtests/tools/test_dockerfile_node_modules_perms.py: new contract test asserting both runtime trees are passed to a chown -R hermes:hermes command in the DockerfileHow to Test
npm installin /opt/hermes/ui-tui — fails with EACCES on/opt/hermes/ui-tui/packages/hermes-ink/node_modules/@esbuild/aix-ppc64npm installsucceeds[session ended]python -m pytest tests/tools/test_dockerfile_node_modules_perms.py -q— passes against the patched Dockerfile, fails if either path is removed from the chownChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
repro of the failure before the patch, from #18800:
after the patch, the same code path completes and the dashboard Chat tab is interactive