DIYgod/RSSHub · error · ConfigNotFoundError

Locals RSS is disabled due to the lack of <a href="https://d

Error message

Locals 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 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.

Source

Thrown at lib/routes/locals/feed.ts:428

            }

            const existing = items.get(item.link);
            if (existing) {
                existing.category = [...new Set([...(existing.category ?? []), ...(item.category ?? [])])];
                existing.description ||= item.description;
                existing.itunes_item_image ||= item.itunes_item_image;
            }
        }
    }

    return items.values().toArray();
}

async function handler(ctx) {
    const { community, option1, option2 } = ctx.req.param();

    if (!config.locals?.session) {
        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>');
    }

    const { contentType, filter } = parseOptions(option1, option2);
    const serverId = await resolveActionIds(community, config.locals.session);
    const communityInfo = await fetchCommunityInfo(community, config.locals.session);
    const items = await fetchFeedData(communityInfo.id, community, config.locals.session, serverId, filter, contentType);

    return {
        description: `Locals content feed for ${communityInfo.title}${filter ? ` (${filter})` : ''}${contentType ? ` (${contentType})` : ''}`,
        image: communityInfo.design?.image?.big || communityInfo.design?.image?.thumb,
        item: items,
        link: `https://locals.com/${community}/feed?mode=content${contentType ? `&content=${contentType}` : ''}`,
        title: `Locals - ${communityInfo.title}`,
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Set `LOCALS_SESSION=<cookie>` in your RSSHub environment and restart the process.
  2. Confirm the config schema exposes it as `config.locals.session` (see lib/config.ts).
  3. Obtain the cookie value from a logged-in locals.com browser session (`Cookie` header).

Example fix

// before: no env set
// .env or environment
LOCALS_SESSION=

// after
LOCALS_SESSION=locals_sid=...; locals_auth=...
Defensive patterns

Strategy: validation

Validate before calling

function localsConfigured(): boolean {
    return Boolean(config.locals?.session);
}
if (!localsConfigured()) {
    throw new Error('Set LOCALS_SESSION before enabling Locals routes');
}

Type guard

function hasLocalsSession(c: typeof config): c is typeof config & { locals: { session: string } } {
    return typeof c.locals?.session === 'string' && c.locals.session.length > 0;
}

Try / catch

import ConfigNotFoundError from '@/errors/types/config-not-found';
try {
    await fetchLocalsFeed(community);
} catch (e) {
    if (e instanceof ConfigNotFoundError && /Locals RSS is disabled/.test(e.message)) {
        return { disabled: true, reason: 'LOCALS_SESSION env var not set' };
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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