DIYgod/RSSHub · error · ConfigNotFoundError

GitHub Discussions RSS is disabled due to the lack of <a hre

Error message

GitHub Discussions RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>

What it means

Thrown as a ConfigNotFoundError by the GitHub Discussions route when config.github.access_token is not set. RSSHub uses this to distinguish 'configuration missing' from runtime errors, surfacing a specific HTTP status and HTML link to the config docs. The route requires GITHUB_ACCESS_TOKEN because the GitHub GraphQL API needs authentication for discussions (a preview feature).

Source

Thrown at lib/routes/github/discussions.ts:78

                name: 'GITHUB_ACCESS_TOKEN',
                description: 'GitHub Access Token',
            },
        ],
    },
    radar: [
        {
            source: ['github.com/:user/:repo/discussions', 'github.com/:user/:repo/discussions/:id', 'github.com/:user/:repo'],
            target: '/discussion/:user/:repo',
        },
    ],
    name: 'Repo Discussions',
    maintainers: ['waynzh'],
    handler,
};

async function handler(ctx) {
    if (!config.github || !config.github.access_token) {
        throw new ConfigNotFoundError('GitHub Discussions RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }
    const { user, repo, limit, state = 'open', category = null } = ctx.req.param();
    const { answered, closed, locked } = mapStateToBooleans(state);
    const perPage = Math.min(Number.parseInt(limit) || 100, 100);

    const host = `https://github.com/${user}/${repo}/discussions`;
    const url = 'https://api.github.com/graphql';

    let filters = `first: ${perPage}`;
    if (answered !== null) {
        filters += `, answered: ${answered}`;
    }
    if (category !== null) {
        const response = await got({
            method: 'post',
            url,
            headers: {
                Authorization: `bearer ${config.github.access_token}`,

View on GitHub (pinned to bed535e087)

Solutions

  1. Set GITHUB_ACCESS_TOKEN in your RSSHub environment (env var or .env file) with a valid GitHub personal access token
  2. If using Docker, pass it as -e GITHUB_ACCESS_TOKEN=ghp_xxxx
  3. Verify the token works by testing it against the GitHub GraphQL API directly
  4. Restart RSSHub after setting the env var so config is re-read

Example fix

// No code change needed — this is a configuration error.
// Fix by setting the environment variable:
// .env or environment:
//   GITHUB_ACCESS_TOKEN=ghp_your_personal_access_token
// Then restart RSSHub.
Defensive patterns

Strategy: validation

Validate before calling

// Check config before making the request
import { config } from '@/config';
if (!config.github?.access_token) {
    // Display setup instructions instead of proceeding
    throw new ConfigNotFoundError('Set GITHUB_ACCESS_TOKEN environment variable');
}

Type guard

function hasGitHubToken(cfg: typeof config): cfg is typeof config & { github: { access_token: string } } {
    return !!cfg.github?.access_token;
}

Prevention

When it happens

Trigger: Any request to /github/discussion/:user/:repo when the GITHUB_ACCESS_TOKEN environment variable is not configured. The check is 'if (!config.github || !config.github.access_token)' — both the config section and the token must be present.

Common situations: Fresh RSSHub deployment without setting GITHUB_ACCESS_TOKEN; the env var is set but under a different name; the token expired or was revoked; deploying via Docker without passing the env var.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/2678c313d9c3ecda. Report an issue: GitHub.