Skip to content

fix(docker): give the agent executor a passwd entry - #708

Closed
jedrzejsieracki wants to merge 1 commit into
BaaRai:mainfrom
jedrzejsieracki:fix/executor-passwd-entry
Closed

jedrzejsieracki wants to merge 1 commit into
BaaRai:mainfrom
jedrzejsieracki:fix/executor-passwd-entry

Conversation

@jedrzejsieracki

Copy link
Copy Markdown

Problem

An ssh-based stdio MCP server fails in the Docker image with only mcp: connection closed, for example:

command: ssh
args: -T -i /app/data/ssh/<key> -o BatchMode=yes -o UserKnownHostsFile=/app/data/ssh/known_hosts -o StrictHostKeyChecking=yes user@host

Run by hand as the MCP server runs, ssh exits with 255 before it connects:

No user exists for uid 10001

Since 04a7ab3 (the agent privilege drop), stdio MCP servers run as the executor uid 10001 (server/mcpdiscover.go), but the image has no passwd or group entry for it. OpenSSH looks up the user it runs as and refuses to start without an entry. Any program that does the same lookup fails the same way.

The same configuration still works in a container built before the privilege drop, because there everything runs as root, which made this confusing to track down.

Change

The runtime stage creates artex-exec with uid/gid 10001 (the default -exec-uid / -exec-gid):

  • home /app/data/exec-home, the executor home the server prepares;
  • /usr/sbin/nologin as the shell;
  • no home directory created at build time.

It sits right before the binary is copied in, so the cached layers above it stay valid.

The CHANGELOG entry notes two things operators may trip over:

  • files such a server reads, such as an SSH key, must be readable by uid 10001;
  • a custom -exec-uid needs its own entry.

Testing

On a deployment running this change, with an MCP server like the one above:

  • getent passwd 10001 gives artex-exec:x:10001:10001::/app/data/exec-home:/usr/sbin/nologin.
  • ssh run as uid 10001 (docker compose exec -u 10001:10001 artex ssh ...) gets past the user lookup. With the key made readable to uid 10001, it authenticates and the server exits 0.
  • On restart, [isolation] self-test passed is still logged and [mcp] <name> discovered 14 tools and cached them. Before the change the log said startup auto-discovery of <name> failed: mcp: connection closed.

There is no Go change, so the Go tests are unaffected.

🤖 Generated with Claude Code

Agent processes and stdio MCP servers run as uid 10001 since the
privilege drop, but the image had no passwd or group entry for it.
Programs that look their own user up refuse to start without one: an
ssh-based stdio MCP server failed with "No user exists for uid 10001"
and ARTEX reported only "mcp: connection closed".

Create artex-exec (10001:10001, the default -exec-uid/-exec-gid) with
the server's executor home and no login shell, before the binary is
copied in so the cached layers above stay valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BaaRai

BaaRai commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Landed in main through #722 (merge 86a5eb9). Thank you @jedrzejsieracki.

What merged is your panel change: the panel image now creates artex-exec (10001:10001, /app/data/exec-home, /usr/sbin/nologin), so tools that look their own user up stop failing with "No user exists for uid 10001". The CHANGELOG entry is there too.

One difference from the patch: Dockerfile.worker is unchanged. It already defined exec (10001:10001, /home/exec, /bin/bash) before this release, so the worker identity was never broken, and renaming it would have changed the account name under a custom exec home. Only the panel needed the entry.

Closing as merged. The credit stays with you in the 0.7.1 notes.

@BaaRai BaaRai closed this Nov 30, 2026
1119738829 pushed a commit to 1119738829/ARTEX that referenced this pull request Nov 30, 2026
…nel and worker images

Port BaaRai#708 into the panel Dockerfile and Dockerfile.worker so uid/gid 10001
resolves to artex-exec in both images (fixing tools such as ssh that require
a passwd entry for the running UID) and add the 0.7.1 CHANGELOG entry.

Co-authored-by: BaaRai <130491490+BaaRai@users.noreply.github.com>
1119738829 pushed a commit to 1119738829/ARTEX that referenced this pull request Nov 30, 2026
Dockerfile.worker already creates exec (10001:10001) with HOME=/home/exec; BaaRai#708's artex-exec rename was unnecessary and would have changed the worker identity name. The panel image keeps the artex-exec entry it needed; the worker is unchanged. The changelog now says so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants