DIYgod/RSSHub · error · ConfigNotFoundError
该 RSS 源由于配置不正确而被禁用:令牌丢失。
Error message
该 RSS 源由于配置不正确而被禁用:令牌丢失。
What it means
Same ConfigNotFoundError pattern as the group route, but in lib/routes/zsxq/user.ts. The handler guards config.zsxq.accessToken before fetching /users/:id and throws when it is absent. RSSHub treats ConfigNotFoundError specially so the feed reports a configuration problem rather than an internal error.
Source
Thrown at lib/routes/zsxq/user.ts:41
],
features: {
requireConfig: [
{
name: 'ZSXQ_ACCESS_TOKEN',
description:
'知识星球访问令牌,获取方式:\n1. 登录知识星球网页版\n2. 打开浏览器开发者工具,切换到 Application 面板\n3. 点击侧边栏中的Storage -> Cookies -> https://wx.zsxq.com\n4. 复制 Cookie 中的 zsxq_access_token 值',
},
],
},
handler,
};
async function handler(ctx: Context): Promise<Data> {
const uid = ctx.req.param('id');
const accessToken = config.zsxq.accessToken;
if (!accessToken) {
throw new ConfigNotFoundError('该 RSS 源由于配置不正确而被禁用:令牌丢失。');
}
let count = Number(ctx.req.query('limit')) || 20;
if (count > 30) {
count = 30;
}
const userInfo = await customFetch<UserInfoResponse>(`/users/${uid}`);
const { topics } = await customFetch<TopicsResponse>(`/users/${uid}/topics/footprint?count=${count}`);
return {
title: `知识星球 - ${userInfo.user.name}`,
description: userInfo.user.introduction,
image: userInfo.user.avatar_url,
link: `https://wx.zsxq.com/dweb2/index/footprint/${uid}`,
item: generateTopicDataItem(topics),
};View on GitHub (pinned to bed535e087)
Solutions
- Set ZSXQ_ACCESS_TOKEN exactly (note the full name) from the wx.zsxq.com cookie.
- Restart RSSHub after setting it.
- Confirm both /zsxq/group and /zsxq/user read the same env var — fixing it fixes both.
- If using a secrets manager, ensure the var is injected into the RSSHub process env.
Example fix
// before: /zsxq/user/2414218251 -> 'route disabled' // after: export ZSXQ_ACCESS_TOKEN=<token-from-cookie> && restart
Defensive patterns
Strategy: validation
Validate before calling
import { config } from '@/config';
if (!config.zsxq?.accessToken) {
// do not expose /zsxq/user — warn operator at boot
console.warn('ZSXQ_ACCESS_TOKEN missing — /zsxq/user disabled.');
} Type guard
import ConfigNotFoundError from '@/errors/types/config-not-found';
function isConfigNotFoundError(e: unknown): e is ConfigNotFoundError {
return e instanceof Error && (e as ConfigNotFoundError).name === 'ConfigNotFoundError';
} Try / catch
try {
await fetchZsxqUser(uid);
} catch (e) {
if (isConfigNotFoundError(e)) return respondDisabled('Set ZSXQ_ACCESS_TOKEN');
throw e;
} Prevention
- Use the exact env var name ZSXQ_ACCESS_TOKEN (common typo: ZSXQ_TOKEN).
- Both /zsxq/group and /zsxq/user share one token — set it once.
- Reload RSSHub after editing the env so the value is re-read.
When it happens
Trigger: Requesting /zsxq/user/:id (user footprint/feed) while ZSXQ_ACCESS_TOKEN is unset or empty. The guard at user.ts:40 fires before the /users/${uid} call.
Common situations: Operator forgot to set the token for the user route even if other zsxq routes work; env var typo (e.g. ZSXQ_TOKEN instead of ZSXQ_ACCESS_TOKEN); token rotated and not updated.
Related errors
- 该 RSS 源由于配置不正确而被禁用:令牌丢失。
- 缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值
- 缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值
- 缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/c2e008840637a88a.
Report an issue: GitHub.