openclaw - 💡(How to fix) Fix [Bug]: macOS LaunchAgent generated by 2026.5.22 uses env-wrapper and missing gateway run, causing EX_CONFIG / Permission denied on external home volumes

Official PRs (…)
ON THIS PAGE

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…
  • OpenClaw 2026.5.22
  • generated LaunchAgent uses gateway --port 18789 instead of gateway run --port 18789
  • generated plist points directly at ...gateway-env-wrapper.sh
  • macOS rejects that wrapper path with posix_spawn(...), Permission denied
  • this causes immediate exit and the gateway is not able to run under launchd
  • workaround is to edit the wrapper to include: /bin/sh -lc '. env; exec node ... gateway run --port 18789'
  • because I'm using an external USB drive as my home drive, every single openclaw version upgrade requires me to copy ai.openclaw.gateway.plist from my user library at ~/Library/LaunchAgents to the global /Library/LaunchAgents and rerun the launchctl commands to bootout the old then bootstrap, enable, and kickstart the new plist using the global path - whining here because this is an ongoing pain I don't know how to fix!
  • There are related issues, but not the same bug:

Error Message

{"0":"Gateway restart failed after 13s: service stayed stopped and health checks never came up.","_meta":{"runtime":"node","runtimeVersion":"25.8.1","hostname":"unknown","name":"openclaw","date":"2026-05-27T04:52:38.051Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151:68","fileName":"console-BAPPAj56.js","fileNameWithLine":"console-BAPPAj56.js:151","fileColumn":"68","fileLine":"151","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151","method":"console.error"}},"time":"2026-05-26T21:52:38.052-07:00","hostname":"Joshs-Mac-mini.local","message":"Gateway restart failed after 13s: service stayed stopped and health checks never came up."}

Root Cause

  • OpenClaw 2026.5.22
  • generated LaunchAgent uses gateway --port 18789 instead of gateway run --port 18789
  • generated plist points directly at ...gateway-env-wrapper.sh
  • macOS rejects that wrapper path with posix_spawn(...), Permission denied
  • this causes immediate exit and the gateway is not able to run under launchd
  • workaround is to edit the wrapper to include: /bin/sh -lc '. env; exec node ... gateway run --port 18789'
  • because I'm using an external USB drive as my home drive, every single openclaw version upgrade requires me to copy ai.openclaw.gateway.plist from my user library at ~/Library/LaunchAgents to the global /Library/LaunchAgents and rerun the launchctl commands to bootout the old then bootstrap, enable, and kickstart the new plist using the global path - whining here because this is an ongoing pain I don't know how to fix!
  • There are related issues, but not the same bug:

Fix Action

Fix / Workaround

  • OpenClaw 2026.5.22
  • generated LaunchAgent uses gateway --port 18789 instead of gateway run --port 18789
  • generated plist points directly at ...gateway-env-wrapper.sh
  • macOS rejects that wrapper path with posix_spawn(...), Permission denied
  • this causes immediate exit and the gateway is not able to run under launchd
  • workaround is to edit the wrapper to include: /bin/sh -lc '. env; exec node ... gateway run --port 18789'
  • because I'm using an external USB drive as my home drive, every single openclaw version upgrade requires me to copy ai.openclaw.gateway.plist from my user library at ~/Library/LaunchAgents to the global /Library/LaunchAgents and rerun the launchctl commands to bootout the old then bootstrap, enable, and kickstart the new plist using the global path - whining here because this is an ongoing pain I don't know how to fix!
  • There are related issues, but not the same bug:

Code Example

Runtime: stopped (state active)Service is loaded but not running (likely exited immediately).     

{"0":"Gateway restart failed after 13s: service stayed stopped and health checks never came up.","_meta":{"runtime":"node","runtimeVersion":"25.8.1","hostname":"unknown","name":"openclaw","date":"2026-05-27T04:52:38.051Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151:68","fileName":"console-BAPPAj56.js","fileNameWithLine":"console-BAPPAj56.js:151","fileColumn":"68","fileLine":"151","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151","method":"console.error"}},"time":"2026-05-26T21:52:38.052-07:00","hostname":"Joshs-Mac-mini.local","message":"Gateway restart failed after 13s: service stayed stopped and health checks never came up."}
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

  • OpenClaw 2026.5.22
  • generated LaunchAgent uses gateway --port 18789 instead of gateway run --port 18789
  • generated plist points directly at ...gateway-env-wrapper.sh
  • macOS rejects that wrapper path with posix_spawn(...), Permission denied
  • this causes immediate exit and the gateway is not able to run under launchd
  • workaround is to edit the wrapper to include: /bin/sh -lc '. env; exec node ... gateway run --port 18789'
  • because I'm using an external USB drive as my home drive, every single openclaw version upgrade requires me to copy ai.openclaw.gateway.plist from my user library at ~/Library/LaunchAgents to the global /Library/LaunchAgents and rerun the launchctl commands to bootout the old then bootstrap, enable, and kickstart the new plist using the global path - whining here because this is an ongoing pain I don't know how to fix!
  • There are related issues, but not the same bug:

Steps to reproduce

Run macOS Tahoe 26.5 Use an external USB drive as your $HOME drive (must be configured in system settings -> users & groups (advanced settings) note that gateway won't start on openclaw 2026.5.22 - generated wrapper script exits with above mentioned permission denied

Expected behavior

Generated wrapper script should not be pooped upon by silly macOS

Actual behavior

aforementioned aromatic behavior leading to inability to run the gateway in the background under launchd

OpenClaw version

2026.5.22

Operating system

macOS Tahoe 26.5 (25F71)

Install method

npm global

Model

openai-codex

Provider / routing chain

openclaw -> gateway

Additional provider/model setup details

No response

Logs, screenshots, and evidence

│  Runtime: stopped (state active)│  Service is loaded but not running (likely exited immediately).     

{"0":"Gateway restart failed after 13s: service stayed stopped and health checks never came up.","_meta":{"runtime":"node","runtimeVersion":"25.8.1","hostname":"unknown","name":"openclaw","date":"2026-05-27T04:52:38.051Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151:68","fileName":"console-BAPPAj56.js","fileNameWithLine":"console-BAPPAj56.js:151","fileColumn":"68","fileLine":"151","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/console-BAPPAj56.js:151","method":"console.error"}},"time":"2026-05-26T21:52:38.052-07:00","hostname":"Joshs-Mac-mini.local","message":"Gateway restart failed after 13s: service stayed stopped and health checks never came up."}

Impact and severity

No response

Additional information

No response

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

Generated wrapper script should not be pooped upon by silly macOS

Still need to ship something?

×6

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

Back to top recommendations

TRENDING