DIYgod/RSSHub · error · ConfigNotFoundError

Sehuatang RSS is disabled due to the lack of <a href="https:

Error message

Sehuatang 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

The Sehuatang user-articles route requires a logged-in session cookie (`config.sehuatang.cookie`) because the forum gates member thread listings behind authentication. Without it, the handler refuses to run — any unauthenticated request to the forum returns a login redirect, not the thread list. The check fires before `got(link, {headers: {Cookie: ...}})`.

Source

Thrown at lib/routes/sehuatang/user.ts:39

                name: 'SEHUATANG_COOKIE',
                description: '',
            },
        ],
        requirePuppeteer: false,
        antiCrawler: false,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
        nsfw: true,
    },
    name: '作者文章',
    maintainers: ['JamYiz'],
    handler,
};

async function handler(ctx) {
    if (!config.sehuatang.cookie) {
        throw new ConfigNotFoundError('Sehuatang RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }
    // 从Url参数中获取uid
    const uid = ctx.req.param('uid');
    const link = `${baseUrl}home.php?mod=space&uid=${uid}&do=thread&view=me&from=space`;

    const response = await got(link, {
        headers: {
            Cookie: config.sehuatang.cookie,
            'Accept-Encoding': 'gzip, deflate, br',
            'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
        },
    });

    const $ = load(response.data);

    const list = $('#delform tr:not(.th)')
        .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25)
        .toArray()

View on GitHub (pinned to bed535e087)

Solutions

  1. Log in to Sehuatang in a browser, copy the full `Cookie` header value, and set `SEHUATANG_COOKIE=<value>` in the RSSHub environment, then restart.
  2. Refresh the cookie periodically — forum sessions expire and the route will start returning empty or login-redirect content once it does.
  3. If you cannot obtain an account, this route is unavailable to you.

Example fix

// before
# SEHUATANG_COOKIE unset

// after
SEHUATANG_COOKIE=PHPSESSID=xxxxxxx; xxxxx=yyyyy
Defensive patterns

Strategy: validation

Validate before calling

if (!config.sehuatang?.cookie) {
    return ctx.body('Sehuatang route requires SEHUATANG_COOKIE.', 503);
}

Type guard

const hasSehuatangCookie = (c: typeof config): boolean => Boolean(c.sehuatang?.cookie);

Prevention

When it happens

Trigger: Thrown at lib/routes/sehuatang/user.ts:39 when the library encounters an invalid state.

Common situations: Self-hosted deploy without the cookie set; user expects the public rsshub.app to provide authenticated content; cookie expired (Sehuatang sessions rotate) and was removed but not refreshed.

Related errors


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