DIYgod/RSSHub · error · ConfigNotFoundError

pixiv not login

Error message

pixiv not login

What it means

ConfigNotFoundError thrown by the user-activity handler when getToken() returns falsy. The config guard already passed, meaning the OAuth token refresh failed and no bearer token is available for getIllusts.

Source

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

    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 最新动态`,
        item: illusts.map((illust) => {
            const images = pixivUtils.getImgs(illust);
            return {
                title: illust.title,
                author: username,
                pubDate: parseDate(illust.create_date),

View on GitHub (pinned to bed535e087)

Solutions

  1. Regenerate PIXIV_REFRESHTOKEN and update config.
  2. Verify reachability to oauth.secure.pixiv.net (use a proxy if blocked).
  3. Flush the 'pixiv:accessToken' cache key.
  4. Check logs for the pixiv oauth response body.
Defensive patterns

Strategy: validation

Validate before calling

import { getToken } from './token';
const token = await getToken();
if (!token) {
  // abort; refresh-token invalid, prompt regeneration
}

Type guard

const isUsableToken = (t: unknown): t is string => typeof t === 'string' && t.length > 0;

Try / catch

try {
  const token = await getToken();
  if (!token) throw new ConfigNotFoundError('pixiv not login');
} catch (e) {
  if (e instanceof ConfigNotFoundError) {
    // refresh failed: clear cache, advise regenerating token
  }
}

Prevention

When it happens

Trigger: PIXIV_REFRESHTOKEN set but invalid/expired; oauth refresh rejected; region-blocked reachability; cached null token under 'pixiv:accessToken'.

Common situations: Expired refresh token; server moved to a blocked region; cache returning a previous failed refresh.

Related errors


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