DIYgod/RSSHub · error · ConfigNotFoundError

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

Error message

pixiv 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

ConfigNotFoundError thrown at the top of the pixiv user-activity handler when config.pixiv or config.pixiv.refreshToken is falsy. The /v1/user/illusts call needs a bearer token, so the route requires credentials for any user, R18 or not.

Source

Thrown at lib/routes/pixiv/user.ts:38

        antiCrawler: false,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
        nsfw: true,
    },
    radar: [
        {
            source: ['www.pixiv.net/users/:id', 'www.pixiv.net/en/users/:id'],
        },
    ],
    name: 'User Activity',
    maintainers: ['DIYgod'],
    handler,
};

async function handler(ctx) {
    if (!config.pixiv || !config.pixiv.refreshToken) {
        throw new ConfigNotFoundError('pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }

    const id = ctx.req.param('id');
    const token = await getToken();
    if (!token) {
        throw new ConfigNotFoundError('pixiv not login');
    }

    const response = await getIllusts(id, token);

    const illusts = response.data.illusts;
    const username = illusts[0].user.name;

    return {
        title: `${username} 的 pixiv 动态`,
        link: `https://www.pixiv.net/users/${id}`,
        image: pixivUtils.getProxiedImageUrl(illusts[0].user.profile_image_urls.medium),
        description: `${username} 的 pixiv 最新动态`,

View on GitHub (pinned to bed535e087)

Solutions

  1. Set PIXIV_REFRESHTOKEN in the environment and restart.
  2. Verify the token is loaded into config.pixiv.refreshToken.
  3. There is no unauthenticated fallback for this route; credentials are mandatory.
  4. Check the env source (file, Docker, secrets manager) actually provides the value.

Example fix

// before: PIXIV_REFRESHTOKEN unset
// after (in .env):
PIXIV_REFRESHTOKEN=your_refresh_token_here
Defensive patterns

Strategy: validation

Validate before calling

import { config } from '@/config';
function canFetchUserActivity(): boolean {
  return Boolean(config.pixiv && config.pixiv.refreshToken);
}
if (!canFetchUserActivity()) {
  // user route has no SFW fallback; require token
}

Type guard

const hasPixivAuth = (c: typeof config): c is typeof config & { pixiv: { refreshToken: string } } =>
  Boolean(c.pixiv && typeof c.pixiv.refreshToken === 'string' && c.pixiv.refreshToken.length > 0);

Try / catch

try {
  // user handler body
} catch (e) {
  if (e instanceof ConfigNotFoundError) {
    // user activity needs auth: surface config guidance
  }
}

Prevention

When it happens

Trigger: Requesting /pixiv/user/:id without PIXIV_REFRESHTOKEN set; handler aborts before resolving the user id.

Common situations: Fresh install; env var dropped; operator expecting the user route to work unauthenticated like some SFW novel paths.

Related errors


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