DIYgod/RSSHub · error · ConfigNotFoundError
Baidu Tieba RSS is disabled due to the lack of <a href="http
Error message
Baidu Tieba RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#baidu">BAIDU_COOKIE</a>
What it means
ConfigNotFoundError thrown by getTiebaPageContent when config.baidu.cookie is falsy. The Playwright-based Tieba fetcher cannot operate without BAIDU_COOKIE because every page load needs authenticated cookies to pass Baidu's security verification, so the route refuses to run and points the operator at the deploy docs.
Source
Thrown at lib/routes/baidu/tieba/common.ts:54
/**
* 使用 Playwright 获取贴吧页面内容
* 包含统一的 cookie 设置、安全验证检查和缓存逻辑
* 带有重试机制处理瞬态错误
*/
export async function getTiebaPageContent(
url: string,
cacheKey: string,
options: {
waitForSelector?: string;
timeout?: number;
retries?: number;
} = {}
): Promise<string> {
const cookie = config.baidu.cookie;
if (!cookie) {
throw new ConfigNotFoundError('Baidu Tieba RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#baidu">BAIDU_COOKIE</a>');
}
const cookies = parseBaiduCookies(cookie);
const { waitForSelector = '.thread-card-wrapper, .virtual-list-item, .thread-content-box, .thread-card', timeout = 3000, retries = 3 } = options;
const data = await cache.tryGet(
cacheKey,
async () => {
let lastError: Error | undefined;
/* eslint-disable no-await-in-loop -- Intentional sequential retry logic */
for (let attempt = 0; attempt < retries; attempt++) {
const { page, destroy } = await getPlaywrightPage(url, {
onBeforeLoad: async (page) => {
if (cookies.length > 0) {
await page.context().addCookies(cookies);
}
},View on GitHub (pinned to bed535e087)
Solutions
- Set BAIDU_COOKIE in your RSSHub config (see https://docs.rsshub.app/deploy/config#baidu) to a cookie string copied from a logged-in tieba.baidu.com session, including BDUSS.
- Restart RSSHub after setting the env var so config is re-read.
- Verify with a smoke-test request to the Tieba route once the cookie is in place.
Defensive patterns
Strategy: validation
Validate before calling
if (!config.baidu.cookie) {
throw new ConfigNotFoundError('BAIDU_COOKIE is not set. Configure it per https://docs.rsshub.app/deploy/config#baidu');
} Type guard
function hasBaiduCookie(c: typeof config): boolean {
return Boolean(c.baidu?.cookie);
} Prevention
- Set BAIDU_COOKIE at deploy time and validate it on boot.
- Treat ConfigNotFoundError as an operator-actionable signal — surface it to ops, not end users.
When it happens
Trigger: Any Tieba route that calls getTiebaPageContent while BAIDU_COOKIE is unset/empty in the RSSHub config.
Common situations: Self-hosted RSSHub deployed without BAIDU_COOKIE; env var name typo; cookie value cleared during a config rotation.
Related errors
- Baidu security verification required. The cookie may be expi
- BAIDU_COOKIE must contain BDUSS. Please check your cookie co
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
- 缺少 TSDM39 用户登录后的 Cookie 值 <a href="https://docs.rsshub.app/z
- 缺少知乎用户登录后的 Cookie 值
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/0bc242b6f272229e.
Report an issue: GitHub.