Skip to content

Hardcoded privileged gateway intents cause CrashLoopBackOff with no actionable error message #116

@masami-agent

Description

@masami-agent

Description

openab hardcodes GatewayIntents::MESSAGE_CONTENT (a Discord privileged intent) in src/main.rs:

let intents = GatewayIntents::GUILD_MESSAGES
    | GatewayIntents::MESSAGE_CONTENT
    | GatewayIntents::GUILDS;

If the user has not enabled MESSAGE CONTENT INTENT in the Discord Developer Portal, the bot crashes immediately with:

Error: Disallowed gateway intents were provided

There are three problems:

  1. The error message gives no guidance — users have no idea which intent is disallowed or how to fix it
  2. The README and chart docs do not mention this prerequisite
  3. Intents are not configurable via config.toml

Steps to Reproduce

  1. Deploy openab 0.5.0 with a valid bot token
  2. Do not enable "MESSAGE CONTENT INTENT" in Discord Developer Portal → Bot → Privileged Gateway Intents
  3. Pod enters CrashLoopBackOff

Expected Behavior

  • README should list enabling MESSAGE CONTENT INTENT as a setup prerequisite
  • On this error, log something actionable:
    "Discord rejected connection: privileged intents not enabled. Please enable MESSAGE CONTENT INTENT at https://discord.com/developers/applications → Bot → Privileged Gateway Intents"
  • Optionally, make intents configurable in config.toml so users can opt out of MESSAGE_CONTENT if not needed

Suggested Code Change

In src/main.rs, wrap client.start().await with a match that catches the intents error:

match client.start().await {
    Err(serenity::Error::Gateway(GatewayError::DisallowedGatewayIntents)) => {
        tracing::error!(
            "Discord rejected privileged intents. \
             Please enable MESSAGE CONTENT INTENT in the Developer Portal: \
             https://discord.com/developers/applications → Bot → Privileged Gateway Intents"
        );
        std::process::exit(1);
    }
    Err(e) => return Err(e.into()),
    Ok(_) => {}
}

Environment

  • Chart: openab-0.5.0
  • Image: ghcr.io/openabdev/openab:9c70cdd
  • Platform: Kubernetes (OrbStack)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions