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 keyword-search handler when config.pixiv or config.pixiv.refreshToken is falsy. Search is performed through the authenticated app API, so the token is required regardless of the requested mode (safe/r18).

Source

Thrown at lib/routes/pixiv/search.ts:82

        },
    },
    features: {
        requireConfig: false,
        requirePuppeteer: false,
        antiCrawler: false,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
        nsfw: true,
    },
    name: 'Keyword',
    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 keyword = ctx.req.param('keyword');
    const order = ctx.req.param('order') || 'date';
    const mode = ctx.req.param('mode');
    const includeAI = ctx.req.param('include_ai');

    const token = await getToken();
    if (!token) {
        throw new ConfigNotFoundError('pixiv not login');
    }

    const response = await (order === 'popular' ? searchPopularIllust(keyword, token) : searchIllust(keyword, token));

    let illusts = response.data.illusts;
    if (mode === 'safe' || mode === '1') {
        illusts = illusts.filter((item) => item.x_restrict === 0);
    } else if (mode === 'r18' || mode === '2') {

View on GitHub (pinned to bed535e087)

Solutions

  1. Configure PIXIV_REFRESHTOKEN and restart.
  2. Confirm config.pixiv.refreshToken is populated at runtime.
  3. Remember that even mode=safe search requires auth in this route.
  4. Validate the env var name casing and source.

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 canSearchPixiv(): boolean {
  return Boolean(config.pixiv && config.pixiv.refreshToken);
}
if (!canSearchPixiv()) {
  // surface config notice; search needs auth even for safe mode
}

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 {
  // search handler body
} catch (e) {
  if (e instanceof ConfigNotFoundError && /relevant config/.test(e.message)) {
    // advise configuring PIXIV_REFRESHTOKEN
  }
}

Prevention

When it happens

Trigger: Calling /pixiv/search/:keyword/:order?/:mode?/:include_ai? with PIXIV_REFRESHTOKEN unset or empty; handler aborts before parsing the keyword.

Common situations: New deployment without pixiv credentials; env var removed during config refactor; operator assumed safe-mode search needs no auth.

Related errors


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