Skip to content

fix(render): chown mounted disk as root, drop to nanobot via setpriv#1

Merged
Ho1yShif merged 1 commit into
mainfrom
fix/render-disk-ownership-exit-128
Jul 7, 2026
Merged

fix(render): chown mounted disk as root, drop to nanobot via setpriv#1
Ho1yShif merged 1 commit into
mainfrom
fix/render-disk-ownership-exit-128

Conversation

@Ho1yShif

@Ho1yShif Ho1yShif commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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).

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>
@Ho1yShif Ho1yShif merged commit d67586d into main Jul 7, 2026
6 checks passed
@Ho1yShif Ho1yShif deleted the fix/render-disk-ownership-exit-128 branch July 7, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant