fix(render): chown mounted disk as root, drop to nanobot via setpriv#1
Merged
Merged
Conversation
Render mounts a fresh persistent disk root-owned, but the container ran as non-root nanobot (uid 1000), so the app could not write /home/nanobot/.nanobot. The old entrypoint detected this and exit 1'd; Render swallowed the message and surfaced only the generic "Exited with status 128" with zero app logs, in a crash loop. Start the entrypoint as root, mkdir + chown the mounted data dir to nanobot, then exec setpriv to drop back to uid 1000 as PID 1 (graceful shutdown preserved). The app still runs non-root — the hardening is kept. Also bake PYTHONUNBUFFERED=1 / PYTHONFAULTHANDLER=1 into the image so future runtime crashes are visible in Render logs (durable across Blueprint syncs). Verified locally (amd64) against a simulated root-owned disk (--tmpfs ...,uid=0): clean boot, ws://0.0.0.0:8765, GET / = 200, app runs as uid 1000; and against a writable disk (no regression). Co-Authored-By: Claude Opus 4.8 (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.
Render mounts a fresh persistent disk root-owned, but the container ran as non-root nanobot (uid 1000), so the app could not write /home/nanobot/.nanobot. The old entrypoint detected this and exit 1'd; Render swallowed the message and surfaced only the generic "Exited with status 128" with zero app logs, in a crash loop.
Start the entrypoint as root, mkdir + chown the mounted data dir to nanobot, then exec setpriv to drop back to uid 1000 as PID 1 (graceful shutdown preserved). The app still runs non-root — the hardening is kept.
Also bake PYTHONUNBUFFERED=1 / PYTHONFAULTHANDLER=1 into the image so future runtime crashes are visible in Render logs (durable across Blueprint syncs).
Verified locally (amd64) against a simulated root-owned disk (--tmpfs ...,uid=0): clean boot, ws://0.0.0.0:8765, GET / = 200, app runs as uid 1000; and against a writable disk (no regression).