solution gateway high linux

OpenClaw: 'Unsafe fallback OpenClaw temp dir' after update (openclaw commands crash)

Fix OpenClaw CLI/gateway crashes when the fallback temp dir under /tmp already exists with insecure permissions or wrong ownership.

By CoClaw Team •

Symptoms

  • After updating OpenClaw, any openclaw ... command crashes with an error like:
    • Error: Unsafe fallback OpenClaw temp dir: /tmp/openclaw-1000
  • Gateway restart may also fail because the CLI can’t finish startup.

Cause

OpenClaw tries to use a secure temp directory under /tmp for caches and CLI startup work.

If /tmp/openclaw isn’t available, it falls back to a per-user path like:

  • /tmp/openclaw-<uid> (example: /tmp/openclaw-1000)

For safety on multi-user hosts, OpenClaw rejects the fallback directory if it is:

  • not owned by your user, or
  • group/other-writable (e.g. drwxrwxrwx), or
  • a symlink.

This most often happens when that directory was created earlier with permissive permissions or the wrong owner.

Fix

1) Check which temp dir is failing

id -u
ls -ld /tmp/openclaw /tmp/openclaw-$(id -u) 2>/dev/null || true

If the directory exists, fix ownership + permissions:

sudo chown -R "$(id -u)":"$(id -g)" "/tmp/openclaw-$(id -u)"
sudo chmod 700 "/tmp/openclaw-$(id -u)"

If you don’t need the contents, you can also remove it and let OpenClaw recreate it safely:

sudo rm -rf "/tmp/openclaw-$(id -u)"

3) Restart OpenClaw

openclaw gateway restart

Verify

  • openclaw tui starts without the temp dir error.
  • openclaw gateway status --probe --deep reports healthy (or at least no temp-dir-related crash on startup).

Verification & references

  • Reviewed by:CoClaw Code Team
  • Last reviewed:March 14, 2026
  • Verified on: Linux
Want to explore more? Browse all solutions or ask in the Community Forum .
Report a problem

Related Resources

Gateway: reverse proxy 502 / HTTP/0.9 after update (TLS auto-generate enabled)
Fix
Fix reverse proxy breakage after an update enables gateway TLS: disable gateway TLS or update your proxy to talk HTTPS to the gateway.
Linux/systemd: OpenClaw leaves orphan gateway processes or port 18789 conflicts
Fix
Fix Linux hosts where CLI-triggered gateway respawn collides with a systemd-managed OpenClaw gateway, causing orphan processes, EADDRINUSE, or 'another gateway instance is already listening'.
OpenClaw only chats and won't use tools after update
Fix
Fix OpenClaw when it suddenly stops reading files, patching code, or running commands after a recent update. The most common cause is `tools.profile: messaging` or a narrower tool policy.
Gateway fails to start: EADDRINUSE / another gateway instance is already listening
Fix
Fix OpenClaw gateway port conflicts (EADDRINUSE) by stopping the other process or choosing a new gateway port/profile.
OpenClaw State, Workspace, and Memory: Persistence & Permissions Troubleshooting
Guide
Fix OpenClaw persistence the boring way: confirm the real state and workspace paths, repair write permissions, verify artifacts survive restarts, and stop confusing runtime drift with memory loss.
OpenClaw Not Using Tools After the Update? Fix the ‘Only Chats, Doesn’t Act’ Problem
Guide
A practical step-by-step guide to fix OpenClaw when it suddenly stops using tools after recent updates. Learn how to check `tools.profile`, restore coding tools safely, and verify the agent can act again.