openclaw - 💡(How to fix) Fix [Bug]: claude-cli backend fails when container runs as root (Unraid + Tailscale)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

claude-cli backend fails with two distinct errors when the container runs as --user root (required for Tailscale): Claude Code rejects --dangerously-skip-permissions under root, and the non-root user workaround fails because OpenClaw tightens /tmp/openclaw/ permissions preventing the CLI subprocess from reading the system prompt file.

Error Message

  1. Observe error: "--dangerously-skip-permissions cannot be used with root/sudo privileges"
  2. Observe error: "EACCES: permission denied" on /tmp/openclaw/openclaw-cli-system-prompt-*/system-prompt.md Two failures: (1) Claude Code rejects --dangerously-skip-permissions under root. (2) When CLI runs as non-root user via wrapper, OpenClaw creates root-owned temp files in /tmp/openclaw/ (drwx------) and actively re-tightens permissions, blocking the CLI subprocess from reading the system prompt file. Log: "Error reading append system prompt file: EACCES: permission denied"

Root Cause

claude-cli backend fails with two distinct errors when the container runs as --user root (required for Tailscale): Claude Code rejects --dangerously-skip-permissions under root, and the non-root user workaround fails because OpenClaw tightens /tmp/openclaw/ permissions preventing the CLI subprocess from reading the system prompt file.

Fix Action

Fix / Workaround

claude-cli backend fails with two distinct errors when the container runs as --user root (required for Tailscale): Claude Code rejects --dangerously-skip-permissions under root, and the non-root user workaround fails because OpenClaw tightens /tmp/openclaw/ permissions preventing the CLI subprocess from reading the system prompt file.

Workaround Currently there is no working workaround. Users in this situation must use Anthropic API keys instead of the Claude CLI/Pro subscription path.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

claude-cli backend fails with two distinct errors when the container runs as --user root (required for Tailscale): Claude Code rejects --dangerously-skip-permissions under root, and the non-root user workaround fails because OpenClaw tightens /tmp/openclaw/ permissions preventing the CLI subprocess from reading the system prompt file.

Steps to reproduce

  1. Deploy OpenClaw Docker container on Unraid with Tailscale enabled (requires --user root for NET_ADMIN and /dev/net/tun)
  2. Install Claude Code: npm install -g @anthropic-ai/claude-code
  3. Authenticate: claude auth login
  4. Configure: openclaw models auth login --provider anthropic --method cli --set-default
  5. Send a message using any Anthropic model via claude-cli backend
  6. Observe error: "--dangerously-skip-permissions cannot be used with root/sudo privileges"
  7. Configure wrapper to run claude as node user via runuser
  8. Send message again
  9. Observe error: "EACCES: permission denied" on /tmp/openclaw/openclaw-cli-system-prompt-*/system-prompt.md

Expected behavior

claude-cli backend should function when the container runs as root, as this is required for Tailscale networking and is the default in the Unraid community template.

Actual behavior

Two failures: (1) Claude Code rejects --dangerously-skip-permissions under root. (2) When CLI runs as non-root user via wrapper, OpenClaw creates root-owned temp files in /tmp/openclaw/ (drwx------) and actively re-tightens permissions, blocking the CLI subprocess from reading the system prompt file. Log: "Error reading append system prompt file: EACCES: permission denied"

OpenClaw version

2026.5.22

Operating system

Unraid (Linux)

Install method

docker

Model

anthropic/claude-haiku-4-5 (also tested claude-opus-4-5, claude-opus-4-7)

Provider / routing chain

openclaw -> claude-cli -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: Any Docker deployment requiring root (Tailscale, VPN, NET_ADMIN) Severity: Blocks workflow (claude-cli backend completely unusable) Frequency: 100% — every attempt fails Consequence: Users cannot use Claude Pro/Max subscriptions via CLI backend; must use API keys with separate billing instead

Additional information

Suggested Solutions (any of these would resolve it)

Create CLI temp files with world-readable permissions when a custom cliBackends.<id>.command is configured, or provide a config option like cliBackends.<id>.user to control file ownership. Allow configuring the temp directory permissions or provide an option to skip the tightened permissions enforcement for the CLI system prompt subdirectories. Run the CLI subprocess as a configurable user natively (e.g., cliBackends.claude-cli.runAsUser: "node"), handling the runuser/su internally so temp files are created with the correct ownership. Pass the system prompt via stdin or argument instead of a temp file, avoiding the file permission issue entirely.

Steps to Reproduce

Deploy OpenClaw on Unraid with Tailscale enabled (container runs as --user root) Install Claude Code: npm install -g @anthropic-ai/claude-code Authenticate: claude auth login Configure CLI backend: openclaw models auth login --provider anthropic --method cli --set-default Send a message using any Anthropic model — fails with --dangerously-skip-permissions cannot be used with root/sudo privileges Configure wrapper script to run as node user — fails with EACCES: permission denied on system prompt temp file

Workaround Currently there is no working workaround. Users in this situation must use Anthropic API keys instead of the Claude CLI/Pro subscription path.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

claude-cli backend should function when the container runs as root, as this is required for Tailscale networking and is the default in the Unraid community template.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: claude-cli backend fails when container runs as root (Unraid + Tailscale)