Windows: Gateway service fails to start when the user profile path is non-ASCII
Fix cases where `openclaw gateway start` works in the foreground but exits immediately when launched via Scheduled Task because the command path includes non-ASCII characters.
Symptoms
openclaw gateway start(background/service mode) exits immediately on Windows.- The same machine can run the Gateway in the foreground:
openclaw gateway runworks, or- running the Node entrypoint manually works.
- The install path for OpenClaw (or Node) includes a Windows user directory with non-ASCII characters (for example CJK characters), or other locale-sensitive path edge cases.
Cause
On native Windows, the Gateway “service” is typically implemented as a Scheduled Task.
If the Scheduled Task’s command line (or working directory / quoting) is constructed or persisted in a way that does not round-trip non-ASCII paths correctly, the background launcher can fail even though the underlying Node program can run fine.
This is why foreground runs can work while gateway start fails.
Fix
1) Move the install prefix in use to an ASCII-only path
For affected native Windows installs, keep the OpenClaw install path used by the Scheduled Task out of
C:\Users\<non-ascii>\....
In PowerShell:
npm config set prefix C:\\openclaw-npm
npm install -g openclaw@latest
openclaw gateway uninstall
openclaw gateway install
openclaw gateway start
If you use pnpm or another install method, move that install method’s global directory to an ASCII-only location and reinstall similarly. Do not switch package managers only for this workaround unless that is already part of your recovery plan.
2) Confirm what the Scheduled Task is actually running
Before guessing, capture the exact command line:
openclaw gateway status --deep
If status --deep shows a command path under a non-ASCII user profile directory, apply Fix (1) and reinstall the task.
Verify
openclaw gateway status --deepshows the Gateway as running.- Opening the Control UI works (default:
http://127.0.0.1:18789/on the Gateway host). - Restart survives a stop/start cycle:
openclaw gateway stop
openclaw gateway start
Related
- OpenClaw CLI: Gateway
- GitHub: #43943