#general install issues during install and setup

1 messages ยท Page 1 of 1 (latest)

sturdy kestrelBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> โœ… Mark Solution

timber spruceBOT
ember bridgeBOT
#

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:

  1. The trim crash 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.

  2. 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:

  • users
  • roles
  • channels
gray patrol
#

[xtx@xtx-desktop ~]$ openclaw --version
OpenClaw 2026.4.14 (323493f)

ill post the status all separate as its too large

ember bridgeBOT
#

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.guilds entry at all
  • wrong server ID in guilds
  • groupPolicy: "allowlist" with no matching guild
  • an accidental users / channels allowlist blocking server messages
#

So yeah, Iโ€™m pretty confident the install crash and the โ€œDMs work, servers donโ€™tโ€ part are related.

gray patrol
#

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 โ”‚
โ”‚

ember bridgeBOT
#

ah, this is the useful clue.

Two things are happening:

  1. Your gateway is currently down

    • gateway closed (1006 abnormal closure)
    • until thatโ€™s fixed, Discord probing/replies will be flaky or dead
  2. Discord is not actually configured

    • Discord default: enabled, not configured
    • that usually means the channel wizard never finished writing a valid channels.discord config

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 export
  • Gateway 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 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.

gray patrol
#

would it be easier if i send the doctor output in a text file?

ember bridgeBOT
#

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 doctor
  • openclaw channels status --probe
  • openclaw gateway status
  • maybe a short openclaw logs --follow tail if update/restart still fails

Just make sure to remove tokens / secrets first.

gray patrol
#

i cant add text files to this discord thread

ember bridgeBOT
#

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 diagnostics section
  • the Gateway section
  • the Discord line from channels status --probe

That should be enough, no giant dump needed.

gray patrol
#

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

ember bridgeBOT
#

yep, that confirms it.

Your install is broken before we even get to Discord config.
The important part is:

  • discord missing register/activate export
  • Gateway 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.

gray patrol
#

sure, help me uninstall it

ember bridgeBOT
#

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 ~/.openclaw state/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.

gray patrol
#

[xtx@xtx-desktop ~]$ curl -fsSL https://openclaw.ai/install.sh | bash
curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading

ember bridgeBOT
#

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.

gray patrol
#

i dont have pnpm

ember bridgeBOT
#

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 -g is expected on first global install
#
  • if openclaw still 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.

gray patrol
#

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?

ember bridgeBOT
#

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.

gray patrol
#

ok so it installed

ember bridgeBOT
#

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 / requireMention config next

Youโ€™re through the broken install part now, which was the ugly bit.

gray patrol
#

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

ember bridgeBOT
#

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_ID with your Discord server ID
  • replace YOUR_USER_ID with your own Discord user ID
  • keep DISCORD_BOT_TOKEN in env, donโ€™t paste the real token into chat
  • requireMention: true means 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.

gray patrol
#

{
"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?

ember bridgeBOT
#

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_ID
  • YOUR_USER_ID

with your real IDs before restarting.

gray patrol
#

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

ember bridgeBOT
#

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.

gray patrol
#

{
"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

ember bridgeBOT
#

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.id to the env var name
  • then run:
openclaw gateway restart
openclaw channels status --probe
gray patrol
#

ok what if i want the bot to respond in any discord channel

ember bridgeBOT
#

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 users if you want anyone in that server to talk to it

That gives you โ€œrespond in any channel on my serverโ€ without opening it everywhere.

gray patrol
#

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?

ember bridgeBOT
#

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.

gray patrol
#

so i remove it like this?

"groupPolicy": "allowlist",
"guilds": {
"851569969698570311": {
"requireMention": true,
}
}
}
}
}

ember bridgeBOT
#

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 guilds if 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.

gray patrol
#

"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

ember bridgeBOT
#

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.

gray patrol
#

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

ember bridgeBOT
#

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.

gray patrol
#

could you fix the entire gateway section for me please

ember bridgeBOT
#

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_TOKEN with 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.

gray patrol
#

{
"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?

ember bridgeBOT
#

yep, that looks structurally right โœ…

A few quick checks:

  • faketoken is 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.

gray patrol
#

The file or folder /home/xtx/.openclaw/.env does not exist.

ember bridgeBOT
#

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.

gray patrol
#

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

ember bridgeBOT
#

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.

gray patrol
#

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.

ember bridgeBOT
#

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:

  1. run journalctl --user -u openclaw-gateway.service -n 100 --no-pager
  2. paste the first real error / stack trace

That should finally tell us exactly whatโ€™s still wrong.

gray patrol
#

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.

ember bridgeBOT
#

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.

gray patrol
#

[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 ~]$

ember bridgeBOT
#

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.

gray patrol
#

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).

ember bridgeBOT
#

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.

gray patrol
#

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

ember bridgeBOT
#

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.

gray patrol
#

it actually replied, i think that openclaw agent is using the wrong ai model, how can i set qwen3:8b as the default one

ember bridgeBOT
#

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:

gray patrol
#

alr it works

ember bridgeBOT
#

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/.env from a directory into the actual env file
  • making sure DISCORD_BOT_TOKEN was 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.

gray patrol
#

the mark solution thing didnt work

ember bridgeBOT
#

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.