{"record":{"id":"4aff990d2bd3d18d","repo":"DIYgod/RSSHub","slug":"discourse-rss-is-disabled-due-to-the-lack-of-a-hr","errorCode":null,"errorMessage":"Discourse RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/\">relevant config</a>","messagePattern":"Discourse RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/discourse/utils.ts","lineNumber":7,"sourceCode":"import { config } from '@/config';\nimport ConfigNotFoundError from '@/errors/types/config-not-found';\n\nfunction getConfig(ctx) {\n    const discourseConfig = config.discourse.config[ctx.req.param('configId')];\n    if (!discourseConfig) {\n        throw new ConfigNotFoundError('Discourse RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/\">relevant config</a>');\n    }\n    return discourseConfig;\n}\n\nexport { getConfig };\n","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/discourse/utils.ts#L1-L13","documentation":"The Discourse route utilities function getConfig looks up a named Discourse instance configuration by configId from config.discourse.config. Discourse is self-hosted forum software, so each instance needs its own URL and optionally API key. If the configId provided in the route path has no corresponding entry in the configuration, a ConfigNotFoundError is thrown.","triggerScenarios":"ctx.req.param('configId') returns a key that does not exist in config.discourse.config. The config.discourse.config object is populated from environment variables (DISCOURSE_CONFIG_* or a JSON config), and if the requested configId has no matching entry, the lookup fails.","commonSituations":"The user provides a configId that was never configured (e.g., /discourse/myforum/... when only 'example' is configured); the environment variable naming doesn't match the expected pattern; the configId has a typo; the deployment hasn't set up any Discourse configurations.","solutions":["Configure the Discourse instance in RSSHub's config by setting the appropriate environment variables (see https://docs.rsshub.app/deploy/).","Ensure the configId in the route URL matches the key in config.discourse.config exactly.","List configured Discourse instances by checking your environment variables or config file.","If self-hosting, add a new DISCOURSE_CONFIG entry for the forum you want to follow."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const discourseConfig = config.discourse?.config?.[ctx.req.param('configId')];\nif (!discourseConfig) {\n    const configured = Object.keys(config.discourse?.config || {});\n    throw new ConfigNotFoundError(`Discourse config '${ctx.req.param('configId')}' not found. Configured instances: ${configured.join(', ') || 'none'}`);\n}","typeGuard":"function hasDiscourseConfig(cfg: any, configId: string): boolean {\n    return cfg?.discourse?.config?.[configId] != null;\n}","tryCatchPattern":null,"preventionTips":["Configure Discourse instances via environment variables before using Discourse routes.","Use a consistent configId naming convention.","List configured instances in the error message to help users self-diagnose."],"tags":["discourse","configuration","config-not-found","self-hosted","multi-instance"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}