{"record":{"id":"2678c313d9c3ecda","repo":"DIYgod/RSSHub","slug":"github-discussions-rss-is-disabled-due-to-the-lack","errorCode":null,"errorMessage":"GitHub Discussions RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"GitHub Discussions RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/github/discussions.ts","lineNumber":78,"sourceCode":"                name: 'GITHUB_ACCESS_TOKEN',\n                description: 'GitHub Access Token',\n            },\n        ],\n    },\n    radar: [\n        {\n            source: ['github.com/:user/:repo/discussions', 'github.com/:user/:repo/discussions/:id', 'github.com/:user/:repo'],\n            target: '/discussion/:user/:repo',\n        },\n    ],\n    name: 'Repo Discussions',\n    maintainers: ['waynzh'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.github || !config.github.access_token) {\n        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>');\n    }\n    const { user, repo, limit, state = 'open', category = null } = ctx.req.param();\n    const { answered, closed, locked } = mapStateToBooleans(state);\n    const perPage = Math.min(Number.parseInt(limit) || 100, 100);\n\n    const host = `https://github.com/${user}/${repo}/discussions`;\n    const url = 'https://api.github.com/graphql';\n\n    let filters = `first: ${perPage}`;\n    if (answered !== null) {\n        filters += `, answered: ${answered}`;\n    }\n    if (category !== null) {\n        const response = await got({\n            method: 'post',\n            url,\n            headers: {\n                Authorization: `bearer ${config.github.access_token}`,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/github/discussions.ts#L60-L96","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set GITHUB_ACCESS_TOKEN in your RSSHub environment (env var or .env file) with a valid GitHub personal access token","If using Docker, pass it as -e GITHUB_ACCESS_TOKEN=ghp_xxxx","Verify the token works by testing it against the GitHub GraphQL API directly","Restart RSSHub after setting the env var so config is re-read"],"exampleFix":"// No code change needed — this is a configuration error.\n// Fix by setting the environment variable:\n// .env or environment:\n//   GITHUB_ACCESS_TOKEN=ghp_your_personal_access_token\n// Then restart RSSHub.","handlingStrategy":"validation","validationCode":"// Check config before making the request\nimport { config } from '@/config';\nif (!config.github?.access_token) {\n    // Display setup instructions instead of proceeding\n    throw new ConfigNotFoundError('Set GITHUB_ACCESS_TOKEN environment variable');\n}","typeGuard":"function hasGitHubToken(cfg: typeof config): cfg is typeof config & { github: { access_token: string } } {\n    return !!cfg.github?.access_token;\n}","tryCatchPattern":null,"preventionTips":["Set GITHUB_ACCESS_TOKEN during RSSHub deployment","Add a startup health check that warns when GitHub routes are used without a token","Document token creation steps in your deployment README","Verify the token hasn't expired"],"tags":["config","github","authentication","missing-config","config-not-found"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}