#general install issues during install and setup
1 messages ยท Page 1 of 1 (latest)
Let me verify this against the docs and source instead of guessing.
I found one likely match for that exact trim crash in the setup wizard. Now Iโm checking the Discord server-side behavior too.
yep, this looks like 2 separate things:
-
The
trimcrash during setup
That matches a recent onboarding/setup bug I found in the changelog. If you're on an older build, updating is likely part of the fix. -
DMs work, server messages do not
This usually happens when Discord is still in guild allowlist mode. If channel/server setup was skipped, the bot can work in DMs but ignore guild messages.
For Discord, make sure your config has your server under channels.discord.guilds, for example:
{
channels: {
discord: {
groupPolicy: "allowlist",
guilds: {
"YOUR_SERVER_ID": {
requireMention: true
}
}
}
}
}
If you want it to reply without being pinged, set requireMention: false.
Also check you did not accidentally restrict:
usersroleschannels
Useful docs:
- https://docs.openclaw.ai/channels/discord
- https://docs.openclaw.ai/help/faq
- https://docs.openclaw.ai/gateway/troubleshooting
Can you paste these outputs next?
openclaw --version
openclaw status --all
openclaw channels status --probe
And if you can, paste your sanitized channels.discord config block too, but remove the token.
[xtx@xtx-desktop ~]$ openclaw --version
OpenClaw 2026.4.14 (323493f)
ill post the status all separate as its too large
nice, that helps. 2026.4.14 is old enough to be before the setup-channel fixes, so the trim crash is probably a real onboarding bug, not you misconfiguring it.
No need to dump all of status --all here, thatโs a lot. The most useful next bits are:
openclaw channels status --probe
openclaw doctor
And if possible, paste your sanitized channels.discord config block from your config file, with the token removed.
What Iโm expecting to find is one of these:
- no
channels.discord.guildsentry at all - wrong server ID in
guilds groupPolicy: "allowlist"with no matching guild- an accidental
users/channelsallowlist blocking server messages
So yeah, Iโm pretty confident the install crash and the โDMs work, servers donโtโ part are related.
Gateway not reachable: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/xtx/.openclaw/openclaw.json
Bind: loopback
Gateway not reachable; showing config-only status.
Config: /home/xtx/.openclaw/openclaw.json
Mode: local
- Discord default: enabled, not configured
Tip: status --deep adds gateway health probes to status output (requires a reachable gateway).
ill send openclaw doctor next
OpenClaw doctor
โ
โ Update โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ This install is not a git checkout. โ
โ Run openclaw update to update via your package manager (npm/pnpm), then rerun doctor. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Security โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ - No channel security warnings detected. โ
โ - Run: openclaw security audit --deep โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Skills status โโโโโโโโโโโโโฎ
โ โ
โ Eligible: 29 โ
โ Missing requirements: 23 โ
โ Blocked by allowlist: 0 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
20:25:07 [plugins] discord missing register/activate export
โ
โ Plugins โโโโโโโฎ
โ โ
โ Loaded: 55 โ
โ Imported: 56 โ
โ Disabled: 42 โ
โ Errors: 1 โ
โ - discord โ
โ โ
โโโโโโโโโโโโโโโโโโฏ
โ
โ Plugin diagnostics โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ - ERROR discord: plugin export missing register/activate โ
โ (/home/xtx/.nvm/versions/node/v24.15.0/lib/node_modules/openclaw/dist/extensions/discord/index.js) โ
โ โ
โ
โ
โ
โ Gateway โโโโโโโโโโโโโโโฎ
โ โ
โ Gateway not running. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Gateway connection โโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Gateway target: ws://127.0.0.1:18789 โ
โ Source: local loopback โ
โ Config: /home/xtx/.openclaw/openclaw.json โ
โ Bind: loopback โ
โ โ
20:25:07 [plugins] discord missing register/activate export
20:25:08 [plugins] 1 plugin(s) failed to initialize (validation: discord). Run 'openclaw plugins list' for details.
โ
โ Memory search
โ โ
โ Memory search is enabled, but no embedding provider is ready. โ
โ Semantic recall needs at least one embedding provider. โ
โ โ
โ โ
โ Fix (pick one): โ
โ - Set OPENAI_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, VOYAGE_API_KEY, MISTRAL_API_KEY in โ
โ your environment โ
โ - Configure credentials: openclaw configure --section model โ
โ - For local embeddings: configure agents.defaults.memorySearch.provider and local model โ
โ path โ
โ - To disable: openclaw config set agents.defaults.memorySearch.enabled false โ
โ โ
โ Verify: openclaw memory status --deep โ
โ
ah, this is the useful clue.
Two things are happening:
-
Your gateway is currently down
gateway closed (1006 abnormal closure)- until thatโs fixed, Discord probing/replies will be flaky or dead
-
Discord is not actually configured
Discord default: enabled, not configured- that usually means the channel wizard never finished writing a valid
channels.discordconfig
So Iโd do this in order:
openclaw gateway status
openclaw gateway restart
openclaw logs --follow
If restart fails, paste the last ~30-50 log lines from openclaw logs --follow.
Also, can you check /home/xtx/.openclaw/openclaw.json and see whether there is a channels.discord block at all? If there is, paste that block with the token removed.
Given youโre on 2026.4.14, Iโm also pretty confident you hit the older setup bug. So after we see the logs, Iโd recommend updating before rerunning Discord setup.
perfect, send that next.
If doctor mentions Discord, gateway, or config path problems, thatโs probably the smoking gun. If it still looks vague, the next best thing will be:
openclaw logs --follow
and the channels.discord block from ~/.openclaw/openclaw.json with secrets removed.
Thatโs the smoking gun. Iโm checking the exact plugin error now so I can give you the cleanest fix path.
yep, we found the real blocker.
This is not just a Discord config issue right now.
Your Discord plugin is failing to load, and because of that the gateway isnโt running:
discord missing register/activate exportGateway not running
So the bot canโt reliably respond in servers because the Discord channel backend is basically broken on startup.
What Iโd do next
1. Update OpenClaw first
The doctor output is pointing at that too, and youโre on 2026.4.14, which is right before some onboarding/channel fixes landed.
openclaw update
If you want the newer setup fixes immediately, you can also try:
openclaw update --channel beta
Docs: https://docs.openclaw.ai/install/updating
2. Then rerun:
openclaw doctor
openclaw gateway status
openclaw channels status --probe
Why I think this is the right move
That missing register/activate export error usually means the installed package is in a bad/stale/mismatched state, not that you typed the wrong Discord setting.
So, good news in a weird way: this probably isnโt your fault.
Ignore the memory-search warning for now, thatโs unrelated.
If openclaw update still leaves the Discord plugin broken, send the new doctor output and Iโll help you do the next cleanup step.
would it be easier if i send the doctor output in a text file?
yep, thatโs totally fine.
A text file is easier than pasting a huge wall of logs here.
If you do, the most useful ones are:
openclaw doctoropenclaw channels status --probeopenclaw gateway status- maybe a short
openclaw logs --followtail if update/restart still fails
Just make sure to remove tokens / secrets first.
i cant add text files to this discord thread
no worries, donโt paste the whole thing then.
At this point I think you can skip the giant logs and try the fix first:
openclaw update
Then run:
openclaw doctor
openclaw gateway status
openclaw channels status --probe
If itโs still broken after that, just paste only these parts:
- the
Plugins/Plugin diagnosticssection - the
Gatewaysection - the
Discordline fromchannels status --probe
That should be enough, no giant dump needed.
plugins] discord missing register/activate export
20:37:43 [plugins] 1 plugin(s) failed to initialize (validation: discord). Run 'openclaw plugins list' for details.
Gateway โโโโโโโโโโโโโโโฎ
โ โ
โ Gateway not running. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Discord default: enabled, not configured, stopped, disconnected, error:not configured
yep, that confirms it.
Your install is broken before we even get to Discord config.
The important part is:
discord missing register/activate exportGateway not running
So Discord ... not configured is mostly a downstream symptom right now.
What I recommend
If you have not run this yet, do it first:
openclaw update
If you already ran update and still get that exact Discord plugin error, Iโd stop chasing config and do a clean reinstall/update of OpenClaw, because this looks like a stale/mismatched package install.
Docs:
Cleanest next step if update didnโt fix it
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
openclaw doctor
openclaw gateway status
If the gateway comes up after that, then rerun:
openclaw onboard
and redo the Discord setup.
If you want, I can stay with you and do this one step at a time.
sure, help me uninstall it
Iโm going to verify the uninstall/reinstall commands in the docs first so I donโt give you a fake cleanup path.
yep. Since your install looks half-broken, Iโd do a full clean reset rather than a partial repair.
Recommended path
- removes the broken install
- removes
~/.openclawstate/config - youโll need to onboard again after reinstall
1. Uninstall everything
openclaw uninstall --all --yes --non-interactive
Docs: https://docs.openclaw.ai/install/uninstall
2. Reinstall cleanly
curl -fsSL https://openclaw.ai/install.sh | bash
3. Run onboarding again
openclaw onboard
My recommendation
If youโre okay starting fresh, do exactly those 3 steps.
If you donโt want to wipe your config, say so before you run step 1, and Iโll give you the lighter cleanup path instead.
[xtx@xtx-desktop ~]$ curl -fsSL https://openclaw.ai/install.sh | bash
curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading
that TLS error is annoying, but itโs probably just the installer download path, not OpenClaw itself.
Since you already have Node, skip the installer and use the package manager path instead.
Try this instead
pnpm add -g openclaw@latest
openclaw --version
openclaw onboard
Docs: https://docs.openclaw.ai/install/updating
If pnpm is not installed, tell me, and Iโll give you the quickest pnpm setup step.
i dont have pnpm
Iโm just verifying the cleanest pnpm bootstrap path so I donโt send you a half-right Node command.
easy fix, you can bootstrap pnpm from Node with corepack.
Run this:
corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon
Docs: https://docs.openclaw.ai/install
A couple notes:
pnpm approve-builds -gis expected on first global install
- if
openclawstill says โcommand not foundโ after install, open a new shell and try again
If corepack itself is missing, paste that error and Iโll give you the fallback.
xtx@xtx-desktop ~]$ corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon
Preparing pnpm@latest for immediate activation...
10.33.0
โERR_PNPM_NO_GLOBAL_BIN_DIRโ Unable to find the global bin directory
Run "pnpm setup" to create it automatically, or set the global-bin-dir setting, or the PNPM_HOME env variable. The global bin directory should be in the PATH.
There are no packages awaiting approval
but the openclaw installer works?
yep, if the installer is working now, use the installer. Thatโs easier than fighting PNPM_HOME.
Your pnpm error just means global pnpm wasnโt fully set up yet, not that anything is wrong with OpenClaw.
Easiest path
If this works now:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon
do that.
If you want to keep using pnpm instead
Run:
pnpm setup
then open a new shell, and rerun:
pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon
So yeah, my recommendation is: if the installer works, just use it.
ok so it installed
nice, progress ๐
Next do:
openclaw onboard --install-daemon
After that, run:
openclaw gateway status
openclaw channels status --probe
A couple things:
- if the Discord setup crashes again, stop there and paste the exact error
- if onboarding finishes but it still only works in DMs, weโll check the guild allowlist /
requireMentionconfig next
Youโre through the broken install part now, which was the ugly bit.
Discord channels access
โ Open (allow all channels)
TypeError: Cannot read properties of undefined (reading 'trim')
that happened every time i tried doing it thru config or onboard or setup
I want to give you a manual config workaround that matches the docs exactly, since the wizard is still tripping over that bug.
yep, thatโs the same wizard bug, not you doing it wrong.
The quickest way around it is to skip the Discord access prompt entirely and set Discord manually in config.
Recommended workaround
Put this in ~/.openclaw/openclaw.json under channels.discord:
{
channels: {
discord: {
enabled: true,
token: {
source: "env",
provider: "default",
id: "DISCORD_BOT_TOKEN"
},
groupPolicy: "allowlist",
guilds: {
"YOUR_SERVER_ID": {
requireMention: true,
users: ["YOUR_USER_ID"]
}
}
}
}
}
Then restart and check it:
openclaw gateway restart
openclaw channels status --probe
Notes
- replace
YOUR_SERVER_IDwith your Discord server ID - replace
YOUR_USER_IDwith your own Discord user ID - keep
DISCORD_BOT_TOKENin env, donโt paste the real token into chat requireMention: truemeans it should reply when you ping it in the server- if you want it to reply to everything in that server later, change it to
false
If you want, paste your sanitized channels.discord block after you edit it, and Iโll sanity-check it before you restart.
{
"gateway": {
"auth": {
"mode": "token",
"token": ""
}
},
"wizard": {
"lastRunAt": "2026-04-16T19:57:20.545Z",
"lastRunVersion": "2026.4.14",
"lastRunCommand": "doctor",
"lastRunMode": "local"
},
"meta": {
"lastTouchedVersion": "2026.4.14",
"lastTouchedAt": "2026-04-16T19:57:20.549Z"
}
}
channels: {
discord: {
enabled: true,
token: {
source: "env",
provider: "default",
id: "DISCORD_BOT_TOKEN"
},
groupPolicy: "allowlist",
guilds: {
"YOUR_SERVER_ID": {
requireMention: true,
users: ["YOUR_USER_ID"]
}
}
}
}
}
like this?
almost, but it needs to be inside the same top-level object. Right now your snippet closes the object too early.
Use this shape instead:
{
"gateway": {
"auth": {
"mode": "token",
"token": ""
}
},
"wizard": {
"lastRunAt": "2026-04-16T19:57:20.545Z",
"lastRunVersion": "2026.4.14",
"lastRunCommand": "doctor",
"lastRunMode": "local"
},
"meta": {
"lastTouchedVersion": "2026.4.14",
"lastTouchedAt": "2026-04-16T19:57:20.549Z"
},
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"YOUR_SERVER_ID": {
"requireMention": true,
"users": ["YOUR_USER_ID"]
}
}
}
}
}
So, yes to the content, but merge it into the same object.
Then:
openclaw gateway restart
openclaw channels status --probe
And replace:
YOUR_SERVER_IDYOUR_USER_ID
with your real IDs before restarting.
am i allowed to show server id and user id? i wanna send what i did but idk if theyre safe to show, ill block both tokens tho
yep, server IDs and user IDs are generally fine to share for troubleshooting. Those are not secrets.
What you should not post:
- bot token
- gateway token
- pairing codes
- passwords / API keys
So:
- IDs are okay
- tokens absolutely not
If you want to be extra cautious, you can still partially redact the IDs, but itโs not usually necessary.
{
"gateway": {
"auth": {
"mode": "token",
"token": "token"
}
},
"wizard": {
"lastRunAt": "2026-04-16T19:57:20.545Z",
"lastRunVersion": "2026.4.14",
"lastRunCommand": "doctor",
"lastRunMode": "local"
},
"meta": {
"lastTouchedVersion": "2026.4.14",
"lastTouchedAt": "2026-04-16T19:57:20.549Z"
},
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "token"
},
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true,
"users": ["395328236923518976"]
}
}
}
}
}
if i leaked anything tell me so i can delete it
youโre okay if both "token" strings are just placeholders/redactions.
If either of those was the real token value, then yes, delete the message and rotate it.
One important config fix
This part is probably wrong in the real file:
"token": {
"source": "env",
"provider": "default",
"id": "token"
}
For Discord, id should be the environment variable name, not the token itself. So it should look like:
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
}
Also
If your gateway auth token is literally:
"token": "token"
thatโs a bad real token and you should change it. If that was just redacted for chat, then no problem.
So short version:
- No leak if you replaced secrets with
"token" - Fix
channels.discord.token.idto the env var name - then run:
openclaw gateway restart
openclaw channels status --probe
ok what if i want the bot to respond in any discord channel
youโve got 2 options here:
Recommended: any channel in your server
Keep the server allowlisted, but let it reply without pinging:
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": false
}
}
}
}
If you leave out users, then it can respond to any user in that server.
Wider and riskier: any channel in any server the bot is in
Set:
"groupPolicy": "open"
That means all guilds are open, not just your server. I wouldnโt recommend this unless you really want that behavior.
My recommendation
Use:
groupPolicy: "allowlist"- your server in
guilds requireMention: false- remove
usersif you want anyone in that server to talk to it
That gives you โrespond in any channel on my serverโ without opening it everywhere.
i mean i want anyone to use it only when pinging it, and i wanna add it to another server too, also for the "source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
do i leave that id field as that? and no, the gateway auth token isnt token, i put that there, btw do i not add the discord bot token anywhere there?
got it, then you want:
- anyone in the allowed servers can use it
- only when they ping the bot
- and you want it in more than one server
That config should look like this:
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"SERVER_ID_1": {
"requireMention": true
},
"SERVER_ID_2": {
"requireMention": true
}
}
}
}
Answers to your questions
1. Do I leave id as DISCORD_BOT_TOKEN?
Yes, if your environment variable is named exactly DISCORD_BOT_TOKEN.
2. Do I put the actual Discord bot token there?
No, not when using this env-based form.
That block means:
โread the real bot token from the environment variable named
DISCORD_BOT_TOKENโ
So the real token lives in your environment, not in that JSON block.
3. Should I keep users?
For what you want, no.
If you add users, only those users can talk to it.
If you remove users, then anyone in those allowed servers can use it, but because requireMention is true, they still need to ping it.
After saving, do:
openclaw gateway restart
openclaw channels status --probe
If you want, send the updated channels.discord block and Iโll check it before you restart.
so i remove it like this?
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true,
}
}
}
}
}
yep, thatโs the right idea, just remove the trailing comma after true if youโre editing a JSON file.
Use:
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true
}
}
So:
- no
users requireMention: true- add more server IDs under
guildsif you want more servers
Then:
openclaw gateway restart
openclaw channels status --probe
If you want, paste the full channels.discord block one more time before restarting and Iโll do a final sanity check.
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true
}
}
}
}
}
also could you please show me how i would add another server id and how i would integrate it there
yep, that channels.discord block looks right ๐
To add another server, just add another entry inside guilds, like this:
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true
},
"ANOTHER_SERVER_ID_HERE": {
"requireMention": true
}
}
}
}
So each server ID becomes a key under guilds.
Example with real-looking shape:
"guilds": {
"851569969698570311": {
"requireMention": true
},
"123456789012345678": {
"requireMention": true
}
}
Then restart:
openclaw gateway restart
openclaw channels status --probe
If you want, after you save it, paste the full file one last time with tokens redacted and Iโll check the brace balance too.
estarted systemd service: openclaw-gateway.service
Gateway restart failed after 13s: service stayed stopped and port 18789 stayed free.
Service runtime: status=stopped, state=failed, lastExit=78
Gateway port 18789 status: free.
Gateway restart failed after 13s: service stayed stopped and health checks never came up.
Tip: openclaw gateway status --deep
Tip: openclaw doctor
That usually means the gateway is failing very early, often on config load or startup validation. Iโm checking the docs/source for the most likely cause before I point you at the next command.
I think I see the likely cause from the config you pasted: your file is missing gateway.mode, and the troubleshooting docs call that out as an EX_CONFIG-style startup failure. Let me verify the exact key before I tell you to add it.
I think I see the likely problem.
Your config is missing:
"mode": "local"
inside the gateway block, and the docs call that out as a startup blocker for the local gateway.
Fix your gateway section to look like this
"gateway": {
"mode": "local",
"auth": {
"mode": "token",
"token": "YOUR_GATEWAY_TOKEN"
}
}
Also, since youโre using the systemd service
The service may not see a token you only exported in your shell.
So put your Discord bot token in:
~/.openclaw/.env
like this:
DISCORD_BOT_TOKEN=your_real_discord_bot_token_here
That way the service can read it on startup.
Then do
openclaw gateway restart
openclaw gateway status --deep
openclaw channels status --probe
If it still fails after adding gateway.mode: "local", paste the next openclaw logs --follow output, because then weโll be down to the next real blocker.
could you fix the entire gateway section for me please
Iโm checking the minimal gateway shape from the docs so I donโt accidentally add extra keys you donโt need.
yep, use this as the entire gateway section:
"gateway": {
"mode": "local",
"bind": "loopback",
"port": 18789,
"auth": {
"mode": "token",
"token": "YOUR_REAL_GATEWAY_TOKEN"
}
}
So your full config should have that plus your channels.discord block.
A couple notes:
- replace
YOUR_REAL_GATEWAY_TOKENwith your actual gateway token - do not use the literal string
"token" bind: "loopback"keeps it local-only, which is the safe/default setup
And since youโre using the Discord token from env, make sure this exists too:
~/.openclaw/.env
DISCORD_BOT_TOKEN=your_real_discord_bot_token
Then run:
openclaw gateway restart
openclaw gateway status --deep
openclaw channels status --probe
If you want, I can also write out a full complete config example with both gateway and channels.discord together in one block.
{
"gateway": {
"mode": "local",
"bind": "loopback",
"port": 18789,
"auth": {
"mode": "token",
"token": "faketoken"
}
},
"wizard": {
"lastRunAt": "2026-04-16T19:57:20.545Z",
"lastRunVersion": "2026.4.14",
"lastRunCommand": "doctor",
"lastRunMode": "local"
},
"meta": {
"lastTouchedVersion": "2026.4.14",
"lastTouchedAt": "2026-04-16T19:57:20.549Z"
},
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true
}
}
}
}
}
like this?
yep, that looks structurally right โ
A few quick checks:
faketokenis fine only if thatโs just a placeholder in chat- in the real file, use your actual gateway token
- keep this too in
~/.openclaw/.env:
DISCORD_BOT_TOKEN=your_real_discord_bot_token
Then run:
openclaw gateway restart
openclaw gateway status --deep
openclaw channels status --probe
If it still fails, send the next error output.
If it starts cleanly, test by pinging the bot in that server.
The file or folder /home/xtx/.openclaw/.env does not exist.
thatโs fine, just create it.
Simplest way:
mkdir -p ~/.openclaw
nano ~/.openclaw/.env
Then put this line in it:
DISCORD_BOT_TOKEN=your_real_discord_bot_token
Save, then run:
openclaw gateway restart
openclaw gateway status --deep
openclaw channels status --probe
If you donโt use nano, any text editor is fine, the important part is that ~/.openclaw/.env exists with that line in it.
Restarted systemd service: openclaw-gateway.service
Gateway restart failed after 13s: service stayed stopped and port 18789 stayed free.
Service runtime: status=stopped, state=activating, lastExit=1
Gateway port 18789 status: free.
Gateway restart failed after 13s: service stayed stopped and health checks never came up.
Tip: openclaw gateway status --deep
Tip: openclaw doctor
thatโs actually progress.
Before, it was dying with exit 78 which pointed to config.
Now itโs dying with exit 1, so we got past the earlier config blocker and hit the next real startup error.
Next step:
openclaw logs --follow
Then in another terminal run:
openclaw gateway restart
and paste the first error lines that show up in the logs right after restart.
No need for the whole log, just the first actual error block. That should finally tell us what itโs choking on now.
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/xtx/.openclaw/openclaw.json
Bind: loopback
Hint: run openclaw doctor.
The logs command itself is getting blocked because the gateway never comes up. Iโm grabbing the fallback log commands from the docs so I can give you the next step cleanly.
yep, that means the gateway dies too early for openclaw logs to talk to it.
Since youโre on Linux/systemd, use the service log directly:
journalctl --user -u openclaw-gateway.service -n 100 --no-pager
If you want to watch it live while restarting:
journalctl --user -u openclaw-gateway.service -f
And the file-log fallback from the docs is:
tail -f "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
Best next move:
- run
journalctl --user -u openclaw-gateway.service -n 100 --no-pager - paste the first real error / stack trace
That should finally tell us exactly whatโs still wrong.
Apr 16 21:37:40 xtx-desktop node[484729]: 2026-04-16T21:37:40.682+01:00 Gateway failed to start: Error: Startup failed: required secrets are unavailable. SecretRefResolutionError: Environment variable "DISCORD_BOT_TOKEN" is missing or empty.
Apr 16 21:37:40 xtx-desktop systemd[1651]: openclaw-gateway.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 21:37:40 xtx-desktop systemd[1651]: openclaw-gateway.service: Failed with result 'exit-code'.
Apr 16 21:37:40 xtx-desktop systemd[1651]: openclaw-gateway.service: Consumed 4.421s CPU time over 8.215s wall clock time, 615.3M memory peak.
Apr 16 21:37:45 xtx-desktop systemd[1651]: openclaw-gateway.service: Scheduled restart job, restart counter is at 5.
Apr 16 21:37:45 xtx-desktop systemd[1651]: openclaw-gateway.service: Start request repeated too quickly.
Apr 16 21:37:45 xtx-desktop systemd[1651]: openclaw-gateway.service: Failed with result 'start-limit-hit'.
Apr 16 21:37:45 xtx-desktop systemd[1651]: Failed to start OpenClaw Gateway (v2026.4.14).
Apr 16 21:37:45 xtx-desktop systemd[1651]: openclaw-gateway.service: Consumed 4.421s CPU time over 5.203s wall clock time, 615.3M memory peak.
Apr 16 21:38:54 xtx-desktop systemd[1651]: Started OpenClaw Gateway (v2026.4.14).
Apr 16 21:38:55 xtx-desktop node[484828]: 2026-04-16T21:38:55.941+01:00 [gateway] loading configurationโฆ
Apr 16 21:38:56 xtx-desktop node[484828]: 2026-04-16T21:38:56.016+01:00 [gateway] resolving authenticationโฆ
Apr 16 21:38:56 xtx-desktop node[484828]: 2026-04-16T21:38:56.030+01:00 [gateway] starting...
Apr 16 21:38:57 xtx-desktop node[484828]: 2026-04-16T21:38:57.684+01:00 [secrets] [SECRETS_RELOADER_DEGRADED] SecretRefResolutionError: Environment variable "DISCORD_BOT_TOKEN" is missing or empty.
Apr 16 21:38:57 xtx-desktop node[484828]: 2026-04-16T21:38:57.691+01:00 Gateway failed to start: Error: Startup failed: required secrets are unavailable. SecretRefResolutionError: Environment variable "DISCORD_BOT_TOKEN" is missing or empty.
Apr 16 21:38:57 xtx-desktop systemd[1651]: openclaw-gateway.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 21:38:57 xtx-desktop systemd[1651]: openclaw-gateway.service: Failed with result 'exit-code'.
Apr 16 21:38:57 xtx-desktop systemd[1651]: openclaw-gateway.service: Consumed 4.267s CPU time over 2.941s wall clock time, 615.5M memory peak.
Nice, we finally have the real error. Iโm verifying the exact env-loading rules so I can tell you whether the .env file is in the wrong place or just formatted wrong.
perfect, we finally have the exact blocker:
Environment variable "DISCORD_BOT_TOKEN" is missing or empty.
So your config is getting read now, but the Discord token still is not.
Recommended fix
Make sure ~/.openclaw/.env contains exactly one line like this:
DISCORD_BOT_TOKEN=your_real_discord_bot_token
Important:
- no spaces around
= - donโt leave it blank
- make sure itโs really saved at
/home/xtx/.openclaw/.env
You can recreate it cleanly with:
mkdir -p ~/.openclaw
printf 'DISCORD_BOT_TOKEN=your_real_discord_bot_token\n' > ~/.openclaw/.env
cat ~/.openclaw/.env
Then restart:
openclaw gateway restart
openclaw channels status --probe
If you want a quick test workaround
You can temporarily skip env loading and put the real token directly in config as:
"token": "YOUR_REAL_DISCORD_BOT_TOKEN"
instead of the source/provider/id object.
Iโd still recommend the .env route first, but the plaintext token is a good quick sanity test if .env keeps being annoying.
[xtx@xtx-desktop ~]$ printf 'DISCORD_BOT_TOKEN=i actually put it there but removed it here cuz yknow' > ~/.openclaw/.env
bash: /home/xtx/.openclaw/.env: Is a directory
[xtx@xtx-desktop ~]$
ah, there it is. Thatโs the problem.
~/.openclaw/.env is a directory, but OpenClaw expects it to be a file.
Safe fix
Rename the directory out of the way, then create the file:
mv ~/.openclaw/.env ~/.openclaw/.env.backup-dir
printf 'DISCORD_BOT_TOKEN=your_real_discord_bot_token\n' > ~/.openclaw/.env
cat ~/.openclaw/.env
Then restart:
openclaw gateway restart
openclaw channels status --probe
So yeah, good catch, you didnโt have a bad token path anymore, you had a directory where the .env file should be. That would absolutely break secret loading.
Gateway reachable.
- Discord default: enabled, configured, running, connected, bot:@xtBot, token:config, intents:content=limited, works
Tip: status --deep adds gateway health probes to status output (requires a reachable gateway).
hell yes, thatโs it ๐
This is the healthy signal:
- Gateway reachable
- Discord configured
- running, connected
- works
So the broken install/config/env mess is finally fixed.
What to do now
Go into your server and ping the bot to test it.
With the config you set:
- it should work in your allowlisted server
- anyone there can use it
- but only when they mention/ping the bot
One small note
intents: content=limited is usually okay for mention-based use.
If you later want it to respond without being pinged, make sure Message Content Intent is enabled in the Discord developer portal.
For another server later
Just add another server ID under channels.discord.guilds, same pattern as before.
Glad we caught that .env directory thing, that was such a sneaky failure.
If this fixed it, please right-click the solution message โ Apps โ โ
Mark Solution.
That helps Answer Overflow index it for future users.
Gateway reachable.
- Discord default: enabled, configured, running, connected, bot:@xtBot, token:config, intents:content=limited, works
Tip: status --deep adds gateway health probes to status output (requires a reachable gateway).
i talked to the discord bot on the server and gave this, i think i know how to fix it? unless its a command
if you mean you pasted that status output to the bot in Discord, thatโs not a command, just diagnostic text.
The important question is:
- did the bot actually reply when you pinged it in the server?
If yes, youโre basically done.
If no, paste the exact reply the bot gave you in the server, because thatโll tell us whether itโs a Discord permission/intents thing or just config.
it actually replied, i think that openclaw agent is using the wrong ai model, how can i set qwen3:8b as the default one
Lemme verify the exact config key first so I donโt send you a made-up model setting.
Iโve got the default-model command. Iโm just checking the exact provider/model format for an Ollama-style model ref so I donโt tell you the wrong prefix.
yep, if thatโs an Ollama model, the clean way is:
openclaw models set ollama/qwen3:8b
That sets the default model (agents.defaults.model.primary).
If you havenโt pulled it yet in Ollama, do that first:
ollama pull qwen3:8b
If OpenClaw says the model is not allowed, then check:
openclaw models list
Docs:
- https://docs.openclaw.ai/cli/models
- https://docs.openclaw.ai/concepts/models
- https://docs.openclaw.ai/concepts/models#model-discussions-community-notes
Tiny heads-up: smaller local models can be a bit shaky with tool calling, so if the bot gets weird later, that may be the reason rather than your config.
alr it works
nice, glad we got it over the line ๐
The big fixes ended up being:
- repairing the broken install
- adding
gateway.mode: "local" - fixing the Discord config manually
- turning
~/.openclaw/.envfrom a directory into the actual env file - making sure
DISCORD_BOT_TOKENwas available to the service
If this fixed it, please right-click the solution message โ Apps โ โ
Mark Solution.
That helps Answer Overflow index it for future users.
the mark solution thing didnt work
no worries, that happens sometimes. Not a big deal.
Iโm just glad itโs working now ๐
If anything else acts weird with Discord, models, or multi-server setup, drop it here.