openclaw - 💡(How to fix) Fix [Bug]: Gateway fails after Migration Assistant — hardcoded TMPDIR path in LaunchAgent [1 participants]

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…
GitHub stats
openclaw/openclaw#53679Fetched 2026-04-08 01:24:56
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

Title: Gateway fails after Migration Assistant — hardcoded TMPDIR path in LaunchAgent

OpenClaw Version: 2026.3.11

Environment:

  • macOS 15 (Darwin 25.3.0, arm64)
  • Migrated from Mac mini (M4) → MacBook Pro (M4 Max) via Migration Assistant

What happened:

After migrating OpenClaw from one Mac to another using macOS Migration Assistant, the gateway failed to start. The LaunchAgent plist at ~/Library/LaunchAgents/ai.openclaw.gateway.plist contains a hardcoded TMPDIR environment variable pointing to the old machine's temp directory:

<key>TMPDIR</key>
<string>/var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/</string>

The new Mac was assigned /var/folders/99/... by macOS. Since the old path doesn't exist, the gateway fails on startup.

Workaround:

sudo mkdir -p /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/
sudo chown $(whoami) /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/

Expected behavior:

The LaunchAgent should not hardcode TMPDIR. It should either:

  1. Omit TMPDIR entirely (let macOS assign it at runtime), or
  2. Use a relative/dynamic path like $TMPDIR or resolve it at gateway startup

Impact: Gateway is completely non-functional after migration until manually fixed. No error message is surfaced to the user — it just silently fails to start.

Notes: This was diagnosed by another OpenClaw instance (Ember) running on a separate machine on the same network, which took about an hour to identify the root cause. A human user without another AI assistant would likely have had significant difficulty diagnosing this.

Error Message

Impact: Gateway is completely non-functional after migration until manually fixed. No error message is surfaced to the user — it just silently fails to start.

Root Cause

Notes: This was diagnosed by another OpenClaw instance (Ember) running on a separate machine on the same network, which took about an hour to identify the root cause. A human user without another AI assistant would likely have had significant difficulty diagnosing this.

Fix Action

Fix / Workaround

Workaround:

Code Example

<key>TMPDIR</key>
<string>/var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/</string>

---

sudo mkdir -p /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/
sudo chown $(whoami) /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/

---
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Summary

Title: Gateway fails after Migration Assistant — hardcoded TMPDIR path in LaunchAgent

OpenClaw Version: 2026.3.11

Environment:

  • macOS 15 (Darwin 25.3.0, arm64)
  • Migrated from Mac mini (M4) → MacBook Pro (M4 Max) via Migration Assistant

What happened:

After migrating OpenClaw from one Mac to another using macOS Migration Assistant, the gateway failed to start. The LaunchAgent plist at ~/Library/LaunchAgents/ai.openclaw.gateway.plist contains a hardcoded TMPDIR environment variable pointing to the old machine's temp directory:

<key>TMPDIR</key>
<string>/var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/</string>

The new Mac was assigned /var/folders/99/... by macOS. Since the old path doesn't exist, the gateway fails on startup.

Workaround:

sudo mkdir -p /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/
sudo chown $(whoami) /var/folders/0t/gnmc00r96pnb26s5vlk2d0s80000gn/T/

Expected behavior:

The LaunchAgent should not hardcode TMPDIR. It should either:

  1. Omit TMPDIR entirely (let macOS assign it at runtime), or
  2. Use a relative/dynamic path like $TMPDIR or resolve it at gateway startup

Impact: Gateway is completely non-functional after migration until manually fixed. No error message is surfaced to the user — it just silently fails to start.

Notes: This was diagnosed by another OpenClaw instance (Ember) running on a separate machine on the same network, which took about an hour to identify the root cause. A human user without another AI assistant would likely have had significant difficulty diagnosing this.

Steps to reproduce

Migrate from one system to another(e.g., Mac mini) to another Mac mini, Studio, etc.

Expected behavior

Expected behavior:

The LaunchAgent should not hardcode TMPDIR. It should either:

  1. Omit TMPDIR entirely (let macOS assign it at runtime), or
  2. Use a relative/dynamic path like $TMPDIR or resolve it at gateway startup

Actual behavior

System does not start

OpenClaw version

2026.3.11

Operating system

macOS Tahoe 26.3.1

Install method

npm global

Model

All models

Provider / routing chain

Not relevant to this issue

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the issue, we need to modify the LaunchAgent plist to use a dynamic TMPDIR path. Here are the steps:

  • Open the ai.openclaw.gateway.plist file in a text editor: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
  • Locate the TMPDIR environment variable and replace the hardcoded path with a dynamic one:
<key>TMPDIR</key>
<string>$TMPDIR</string>

Alternatively, you can omit the TMPDIR environment variable altogether, allowing macOS to assign it at runtime:

<!-- Remove the entire TMPDIR key -->
  • Save the changes to the plist file
  • Reload the LaunchAgent configuration: launchctl reload ~/Library/LaunchAgents/ai.openclaw.gateway.plist
  • Restart the gateway service: launchctl start ai.openclaw.gateway

Verification

To verify that the fix worked, check that the gateway service is running:

launchctl list | grep ai.openclaw.gateway

This should show the service as running. You can also check the gateway logs to ensure it's functioning correctly.

Extra Tips

To prevent similar issues in the future, consider using a more robust method for setting environment variables in your LaunchAgent configuration, such as using a script to set the TMPDIR variable at runtime. Additionally, make sure to test your application after migrating to a new system to catch any potential issues early on.

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

Expected behavior:

The LaunchAgent should not hardcode TMPDIR. It should either:

  1. Omit TMPDIR entirely (let macOS assign it at runtime), or
  2. Use a relative/dynamic path like $TMPDIR or resolve it at gateway startup

Still need to ship something?

×6

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

Back to top recommendations

TRENDING