{"record":{"id":"b15ae56823be4497","repo":"DIYgod/RSSHub","slug":"locals-rss-is-disabled-due-to-the-lack-of-a-href","errorCode":null,"errorMessage":"Locals RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"Locals 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/locals/feed.ts","lineNumber":428,"sourceCode":"            }\n\n            const existing = items.get(item.link);\n            if (existing) {\n                existing.category = [...new Set([...(existing.category ?? []), ...(item.category ?? [])])];\n                existing.description ||= item.description;\n                existing.itunes_item_image ||= item.itunes_item_image;\n            }\n        }\n    }\n\n    return items.values().toArray();\n}\n\nasync function handler(ctx) {\n    const { community, option1, option2 } = ctx.req.param();\n\n    if (!config.locals?.session) {\n        throw new ConfigNotFoundError('Locals RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n\n    const { contentType, filter } = parseOptions(option1, option2);\n    const serverId = await resolveActionIds(community, config.locals.session);\n    const communityInfo = await fetchCommunityInfo(community, config.locals.session);\n    const items = await fetchFeedData(communityInfo.id, community, config.locals.session, serverId, filter, contentType);\n\n    return {\n        description: `Locals content feed for ${communityInfo.title}${filter ? ` (${filter})` : ''}${contentType ? ` (${contentType})` : ''}`,\n        image: communityInfo.design?.image?.big || communityInfo.design?.image?.thumb,\n        item: items,\n        link: `https://locals.com/${community}/feed?mode=content${contentType ? `&content=${contentType}` : ''}`,\n        title: `Locals - ${communityInfo.title}`,\n    };\n}\n","sourceCodeStart":410,"sourceCodeEnd":444,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/locals/feed.ts#L410-L444","documentation":"Thrown by the Locals route handler (lib/routes/locals/feed.ts:428) as a `ConfigNotFoundError` when `config.locals?.session` is falsy. The entire Locals feed depends on an authenticated session cookie, so without it the route refuses to run rather than emitting broken output.","triggerScenarios":"Deploying RSSHub without setting the `LOCALS_SESSION` env var (or the equivalent in the config file); setting it to an empty string; the config key misspelled so `config.locals` is undefined.","commonSituations":"Fresh install without route-specific config; config file edited but process not restarted; env var name typo; session moved to a secret store that was not wired.","solutions":["Set `LOCALS_SESSION=<cookie>` in your RSSHub environment and restart the process.","Confirm the config schema exposes it as `config.locals.session` (see lib/config.ts).","Obtain the cookie value from a logged-in locals.com browser session (`Cookie` header)."],"exampleFix":"// before: no env set\n// .env or environment\nLOCALS_SESSION=\n\n// after\nLOCALS_SESSION=locals_sid=...; locals_auth=...","handlingStrategy":"validation","validationCode":"function localsConfigured(): boolean {\n    return Boolean(config.locals?.session);\n}\nif (!localsConfigured()) {\n    throw new Error('Set LOCALS_SESSION before enabling Locals routes');\n}","typeGuard":"function hasLocalsSession(c: typeof config): c is typeof config & { locals: { session: string } } {\n    return typeof c.locals?.session === 'string' && c.locals.session.length > 0;\n}","tryCatchPattern":"import ConfigNotFoundError from '@/errors/types/config-not-found';\ntry {\n    await fetchLocalsFeed(community);\n} catch (e) {\n    if (e instanceof ConfigNotFoundError && /Locals RSS is disabled/.test(e.message)) {\n        return { disabled: true, reason: 'LOCALS_SESSION env var not set' };\n    }\n    throw e;\n}","preventionTips":["Set LOCALS_SESSION at deploy time and validate on boot.","Mark Locals routes as `requireConfig: true` in features so the framework surfaces the gap.","Use a secret manager so the cookie rotates without a code change."],"tags":["config","missing-secret","session","locals"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}