openclaw - 💡(How to fix) Fix [Bug]: SecretRef not working anymore for Discord channel configuration [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…
GitHub stats
openclaw/openclaw#77769Fetched 2026-05-06 06:21:47
View on GitHub
Comments
1
Participants
2
Timeline
10
Reactions
2
Timeline (top)
mentioned ×3subscribed ×3labeled ×2closed ×1

In the past, I used SecretRef vars for Discord + Telegram channels configuration. After 2026.4.27, I had to resort to env vars for Discord because SecretRef didn't work anymore. Telegram, instead, keeps working.

Error Message

│ Discord │ ON │ WARN │ configured token unavailable in this command path · accounts 5 │

Root Cause

In the past, I used SecretRef vars for Discord + Telegram channels configuration. After 2026.4.27, I had to resort to env vars for Discord because SecretRef didn't work anymore. Telegram, instead, keeps working.

Code Example

"channels": {
    "discord": {
      "accounts": {
        "prof-socrates": {
          "token": {
            "source": "file",
            "provider": "openclaw_secrets_file",
            "id": "/DISCORD_TOKEN_PROF_SOCRATES"
          }

---

"secrets": {
    "providers": {
      "openclaw_secrets_file": {
        "source": "file",
        "path": "/home/openclaw/openclaw_secrets_file.json",
        "mode": "json"
      }
    }
  }

---

Channels
┌──────────┬─────────┬────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
ChannelEnabledStateDetail├──────────┼─────────┼────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
TelegramONOK     │ token config (2602…11LE · len 45) · accounts 1/2DiscordONWARN   │ configured token unavailable in this command path · accounts 5└──────────┴─────────┴────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

---

DISCORD_TOKEN_PROF_SOCRATES="my_bot_token_removed"

---

"channels": {
    "discord": {
      "accounts": {
        "prof-socrates": {
          "token": "${DISCORD_TOKEN_PROF_SOCRATES}"

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

In the past, I used SecretRef vars for Discord + Telegram channels configuration. After 2026.4.27, I had to resort to env vars for Discord because SecretRef didn't work anymore. Telegram, instead, keeps working.

Steps to reproduce

Until 2026.4.27 I had this section in my openclaw.json:

  "channels": {
    "discord": {
      "accounts": {
        "prof-socrates": {
          "token": {
            "source": "file",
            "provider": "openclaw_secrets_file",
            "id": "/DISCORD_TOKEN_PROF_SOCRATES"
          }

And, of course, also the relative SecretRef config block

  "secrets": {
    "providers": {
      "openclaw_secrets_file": {
        "source": "file",
        "path": "/home/openclaw/openclaw_secrets_file.json",
        "mode": "json"
      }
    }
  }

And it worked without problem.

I upgraded to 2026.5.2, and Discord stopped working.

I run a openclaw status, and I got

Channels
┌──────────┬─────────┬────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Channel  │ Enabled │ State  │ Detail                                                                                                                          │
├──────────┼─────────┼────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Telegram │ ON      │ OK     │ token config (2602…11LE · len 45) · accounts 1/2                                                                                │
│ Discord  │ ON      │ WARN   │ configured token unavailable in this command path · accounts 5                                                                  │
└──────────┴─────────┴────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

And the only way to have Discord working again was to add in .openclaw\.env

DISCORD_TOKEN_PROF_SOCRATES="my_bot_token_removed"

And in openclaw.json:

  "channels": {
    "discord": {
      "accounts": {
        "prof-socrates": {
          "token": "${DISCORD_TOKEN_PROF_SOCRATES}"

Expected behavior

SecretRef for Discord bot tokens still works after 2026.4.27

Actual behavior

SecretRef for Discord bot tokens DOES NOT works after 2026.4.27, and the whole Discord channel configuration is now invalid, and Discord channel doesn't work.

OpenClaw version

2026.5.3

Operating system

Alpine Linux

Install method

npm global

Model

gemini

Provider / routing chain

openclaw -> google

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

All Discord channels are affected Telegram, instead, works without issued using SecretRef for the bot token key

Additional information

No response

extent analysis

TL;DR

Switch to environment variables for Discord bot tokens, as SecretRef is no longer supported after version 2026.4.27.

Guidance

  • Verify that the SecretRef configuration is correct and the openclaw_secrets_file.json file exists at the specified path.
  • Check the openclaw.json file for any syntax errors or inconsistencies in the channels and secrets configurations.
  • Consider using environment variables for all bot tokens, as it is now the recommended approach for Discord channels.
  • Test the configuration with a different Discord account to isolate the issue.

Example

"channels": {
  "discord": {
    "accounts": {
      "prof-socrates": {
        "token": "${DISCORD_TOKEN_PROF_SOCRATES}"
      }
    }
  }
}

And in .openclaw\.env:

DISCORD_TOKEN_PROF_SOCRATES="my_bot_token_removed"

Notes

The issue seems to be specific to Discord channels and SecretRef, as Telegram channels continue to work with SecretRef. The exact cause of the regression is unclear, but switching to environment variables resolves the issue.

Recommendation

Apply workaround: use environment variables for Discord bot tokens, as SecretRef is no longer supported after version 2026.4.27. This approach has been proven to work, as shown in the example configuration.

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

SecretRef for Discord bot tokens still works after 2026.4.27

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: SecretRef not working anymore for Discord channel configuration [1 comments, 2 participants]