Troubleshooting common OpenClaw problems
When something does not work, guessing is the expensive part. Here is a fixed order of diagnosis — five commands that tell you where the problem is — and fixes for the four most common cases: the Discord bot stays silent, the Gateway will not start, the model times out, and OpenClaw cannot reach Ollama from WSL2.
status → gateway status → logs --follow → doctor → channels status --probe) instead of three commands that did not cover channels. Corrected: (1) the setting agents.defaults.llm.idleTimeoutSeconds and its exact error text do not appear in the documentation — replaced with the documented models.providers.ollama.timeoutSeconds plus keep_alive (⚠️ the old key is unverified; if you have it in your config, openclaw doctor will tell you whether it is valid); (2) the log line is drop guild message (mention required, not "skipping guild message (no-mention)", and we added what pairing and the server list (channels.discord.guilds) are for; (3) for the Discord token we now recommend an environment variable instead of a command that leaves it in your terminal history; (4) the JSON5 config is checked with openclaw config validate, not python3 -m json.tool (which cannot read JSON5); (5) for Ollama on WSL2 there are now two network modes — mirrored (recommended by Microsoft; 127.0.0.1 works both ways) and NAT; we removed the manual netsh portproxy because neither the OpenClaw nor the Ollama documentation mentions it; (6) we added the known WSL2 crash loop with NVIDIA and ollama.service. A real Discord user number and a real machine address were removed from the examples — replaced by <PLACEHOLDER>. Open WebUI: we found no step in this lesson that belongs to Open WebUI; if old files show an "openclaw" image with WEBUI_SECRET_KEY, that is Open WebUI, not OpenClaw.
01What you'll learn
- How to find where the problem is with five commands in the right order, instead of guessing.
- Why a Discord bot is "connected but silent" and which three settings are most often the cause.
- How to recognise a busy port, a broken config or missing Gateway authentication.
- How to stop timeouts from a slow local model without touching anything unnecessary.
- How OpenClaw on WSL2 reaches Ollama — in mirrored mode and in NAT mode.
- How to share a log without leaking anything secret.
02Before you start
- You have OpenClaw installed with a Gateway (see DevStation · Lesson 3 and OpenClaw · Lesson 3). The commands are for
openclawin Ubuntu on WSL2; on Windows the same ones work. - If you use Discord: the bot exists in the Discord Developer Portal 🌐 global.
- If you use a local model: Ollama 🔒 local is installed (DevStation · Lesson 2).
- For WSL2 mirrored mode: Windows 11 22H2 or newer.
<PLACEHOLDER>.03Steps
-
The command ladder — always first
The official OpenClaw guide recommends five commands in this order. Each one answers one question, and the first one that fails shows where to dig. That way you do not guess whether it is the network, the config or the channel.
bash · diagnosticsopenclaw status openclaw gateway status openclaw logs --follow openclaw doctor openclaw channels status --probeCommand What you are asking Good sign openclaw statusOverall state No warnings openclaw gateway statusIs the Gateway running? Runtime: runningandConnectivity probe: okopenclaw logs --followWhat is happening right now? Watch while you send a message openclaw doctorIs a config or service broken? No blocking issues openclaw channels status --probeAre the channels alive? Live status per account; where supported, worksoraudit ok💡Where the logs areThe easiest way isopenclaw logs --follow— no path needed. On Linux the default file is/tmp/openclaw/openclaw-YYYY-MM-DD.log(one per day); the path can be changed inlogging.filein the configuration. -
The Discord bot does not answer 🌐 global
When the channel is "connected" but silent, it is almost always a question of rules, not of connection. Check in order:
a) The privileged intents. In the Discord Developer Portal → your application → Bot → Privileged Gateway Intents: turn on Message Content Intent (needed for ordinary server messages) and preferably Server Members Intent. Then restart the Gateway. Without Message Content Intent the bot sees that a message exists but cannot read its text. If Discord does not let you have this intent, OpenClaw can still work in direct messages and on explicit mention — see the
channels.discord.intents.messageContentsetting in the documentation.b) The server rules. If the policy is an allowlist (
groupPolicy: "allowlist") but your server is not listed inchannels.discord.guilds, messages are rejected. If a channel list exists, only the listed channels are allowed. TherequireMentionsetting must be in the right place — underchannels.discord.guildsor in the channel entry. A typical log line:drop guild message (mention required— the bot is waiting to be mentioned.c) Direct messages. By default Discord DMs are in pairing mode: an unknown sender waits for approval.
bash · pairingopenclaw pairing list --channel discord openclaw pairing approve discord <CODE>If you use a list instead of pairing (
channels.discord.dmPolicy: "allowlist"), the bot answers only senders inchannels.discord.allowFrom; check that your Discord user ID is there (openclaw config get channels.discord.allowFrom). The legacy keyschannels.discord.dm.policyanddm.allowFromare still read, andopenclaw doctor --fixmoves them to the new ones.d) The token. If you reset it in the Developer Portal, the old one stops working. Set the new one as an environment variable on the machine where OpenClaw runs — do not type it into a chat and do not leave it in your terminal history. For a service installed with
openclaw gateway install, the value must also be available to the service (for example in the.envfile in the OpenClaw folder).bash · token (placeholder)export DISCORD_BOT_TOKEN="<BOT_TOKEN>" openclaw gateway restart⚠️Unverified line from the old lessonThe old lesson mentioned a "sender not in allowFrom" log line. We could not find it in the documentation — do not rely on it. The documented signals aredrop guild message (mention requiredandpairing request(waiting for approval). -
The Gateway does not start or keeps falling over
Start with the ladder, then look at exactly what
gateway statussays.bash · Gatewayopenclaw gateway status openclaw gateway status --deep # also looks for extra services openclaw logs --follow openclaw doctorOn Linux/WSL2 you can also look at the systemd service itself (the default name is
openclaw-gateway.service; for a user service use--user, withoutsudo) and at who holds the port:bash · service and portsystemctl --user status openclaw-gateway.service journalctl --user -u openclaw-gateway.service -n 50 --no-pager ss -ltnp | grep 18789⚠️ If the service is installed as a system service rather than a user one, drop
--userand addsudo;openclaw gateway statusshows the exact name.The most common signals and what they mean (from the official guide):
Signal Meaning Fix another gateway instance is already listeningorEADDRINUSEThe port is busy — a second Gateway or another process Stop the extra one. By default the Gateway listens on port 18789; most setups want one Gateway per machine Gateway start blocked: set gateway.mode=localLocal mode is not on, or the config lost the line Set gateway.mode="local"or runopenclaw onboard --mode localrefusing to bind gateway ... without authTrying to listen beyond loopback without authentication Go back to loopback (the default) or set up a Gateway token/password Gateway service port does not match current gateway configThe service still holds the old port openclaw doctor --fixoropenclaw gateway install --force, then restartA broken config. The Gateway accepts only a configuration that fully matches the schema: an unknown key or invalid value = it refuses to start. The config is JSON5 (comments and trailing commas allowed), so the standard
json.toolis no use. Use:bash · configopenclaw config validate openclaw doctor --fixThe second command repairs legacy keys; the old config stays in a backup (
.bak).💡Changes apply by themselvesThe Gateway watches the file~/.openclaw/openclaw.jsonand applies most changes without a restart. If something did not change, runopenclaw gateway restart. On Linux the managed service is systemd (user); on Windows it is a Task Scheduler task; in both casesopenclaw gateway statusis the easiest way to see it. -
The model times out (local model)
OpenClaw aborts a model request if no part of an answer arrives within a set time. According to the documentation that time is 120 seconds for a cloud model and 300 seconds for a self-hosted one. A large local model on first load (cold start) can exceed that.
The documented way is to extend the time only for the Ollama provider and keep the model loaded between requests. Add to
~/.openclaw/openclaw.json(the example follows the official Ollama-for-OpenClaw documentation; replace the model name with yours):json5 · models.providers.ollama{ models: { providers: { ollama: { timeoutSeconds: 300, models: [ { id: "<MODEL_NAME>", name: "<MODEL_NAME>", params: { keep_alive: "15m" }, }, ], }, }, }, }✅Why this way, and not with the "global" timeoutThe documentation recommends extending the time for the specific provider before raising the timeout of the whole agent. That way one slow model does not loosen every other safeguard. If the model does not answer at all, test it directly:curl http://127.0.0.1:11434/api/tagson the machine where Ollama runs.⚠️Unverified from the old lessonThe keyagents.defaults.llm.idleTimeoutSecondsand the text "The model did not produce a response before the LLM idle timeout" are not in the current documentation — so we do not give them as fact. If you see a different message, runopenclaw logs --followand look for the word "timeout".If the Ollama server is on WSL2 with NVIDIA and Windows keeps restarting it in a loop — see the end of the next step.
-
OpenClaw cannot reach Ollama from WSL2 🔒 local
First decide where Ollama is relative to OpenClaw — everything depends on it:
- Both in Ubuntu on WSL2. No network problem:
curl http://127.0.0.1:11434/api/tagsfrom the same terminal. - OpenClaw in WSL2, Ollama on Windows. Here the WSL2 network mode decides everything (below).
- OpenClaw in a container.
localhostinside the container is not your machine — the host address is different (see DevStation · Lesson 3).
Option A — mirrored mode (recommended)
Microsoft recommends the newer mirrored mode (Windows 11 22H2 or newer). In it Windows and WSL2 see each other through
127.0.0.1, so you do not need to hunt for addresses. On Windows create or extend the file%USERPROFILE%\.wslconfig:ini · .wslconfig (Windows)[wsl2] networkingMode=mirroredThen in PowerShell:
wsl --shutdownand open Ubuntu again. Check from Ubuntu:bash · checkcurl http://127.0.0.1:11434/api/tagsYou should get JSON with the list of models. The provider address in OpenClaw is
http://127.0.0.1:11434— without/v1(with/v1Ollama switches to a compatibility mode and tools break).Option B — NAT mode (the default)
Here WSL2 sits "behind" Windows and
localhostin Ubuntu is not Windows. The host address shows up as the default gateway:bash · Windows host addressip route show | grep -i default | awk '{ print $3 }' curl http://<WINDOWS_HOST_ADDRESS>:11434/api/tagsOllama for Windows listens only on
127.0.0.1by default; to reach it from WSL2 in this mode you must change its listening address with theOLLAMA_HOSTvariable, for example0.0.0.0:11434; on Windows you set it as an environment variable for your account (Settings → "Edit environment variables for your account"), then quit Ollama and start it again (see the Ollama documentation). Listening on all addresses opens Ollama to every network your machine is connected to — be careful.⚠️Unverified: firewall and "portproxy"The old lesson gave a Windows firewall rule and a manualnetsh interface portproxy. Neither is in the OpenClaw or Ollama documentation. The firewall may block the port; if mirrored mode is not available to you and the connection fails, review the firewall rules — but we have not tested a specific command, so we do not give one.❌WSL2 restarts by itself as soon as Ollama startsThe OpenClaw documentation describes a known problem on WSL2 with NVIDIA: theollama.serviceunit withRestart=alwaysloads a model at startup and Windows kills the virtual machine in a loop. Fixes:sudo systemctl disable ollamaand start Ollama by hand; or in%USERPROFILE%\.wslconfigadd the lineautoMemoryReclaim=disabledunder[experimental], thenwsl --shutdown. - Both in Ubuntu on WSL2. No network problem:
-
How to ask for help without leaking secrets
- Send a short excerpt of the log, not the whole file, and name your OpenClaw version (
openclaw --version). - Replace tokens, addresses, machine names and user names with
<PLACEHOLDER>. - For a full diagnosis use
openclaw gateway diagnostics export(the documentation describes it as sanitised), but review it too before you attach it. - If a token has leaked anywhere, reset it in the Developer Portal immediately — the old one counts as compromised.
- Send a short excerpt of the log, not the whole file, and name your OpenClaw version (
04Check
Checklist
- You ran the five commands in order and know which one is the first to fail.
- Discord: Message Content Intent is on, the server is in
channels.discord.guilds, you understand the mention rule, direct messages are approved through pairing. - The token is in an environment variable, not in a chat and not in a shared log.
openclaw gateway statusshowsRuntime: runningandConnectivity probe: ok;openclaw doctoris clean;openclaw config validatepasses.- There is no second Gateway on the same port.
- For a local model:
timeoutSecondsandkeep_aliveare set; a directcurlto Ollama answers. - WSL2: you know whether you are in mirrored or NAT mode; the Ollama address has no
/v1.
Quiz
1. The Discord bot sees the channel but does not read the messages. Which setting do you check first?
2. In the logs you see EADDRINUSE or "another gateway instance is already listening". What does it mean?
3. A large local model times out on first load. What is the documented fix?
4. OpenClaw is in WSL2, Ollama is on Windows, and WSL2 is in mirrored mode. What is the Ollama address?
05What's next
06Sources
- OpenClaw: troubleshooting — the command ladder; sub-pages: Gateway service and process, channel delivery.
- OpenClaw: Discord — setup (intents, token) and troubleshooting.
- OpenClaw: configuration · Gateway · logging · Windows and WSL2.
- OpenClaw: the Ollama provider 🔒 local and troubleshooting (timeouts, WSL2 loop).
- Microsoft: networking in WSL — mirrored and NAT modes;
.wslconfigsettings. - Ollama: FAQ 🔒 local —
OLLAMA_HOST,OLLAMA_KEEP_ALIVE.