DIYgod/RSSHub · warning

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

Error message

Fanfou 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

Thrown by the fanfou favorites route when any of config.fanfou.consumer_key, consumer_secret, username, or password is missing. Fanfou's OAuth1-style API requires all four, so RSSHub disables the route rather than fail at request time.

Source

Thrown at lib/routes-deprecated/fanfou/favorites.js:6

const config = require('@/config').value;
const utils = require('./utils');

module.exports = async (ctx) => {
    if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
        throw new Error('Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }

    const uid = ctx.params.uid;
    const fanfou = await utils.getFanfou();
    const timeline = await fanfou.get(`/favorites/${encodeURIComponent(uid)}`, { id: uid, mode: 'lite', format: 'html' });

    const result = timeline.map((item) => {
        let img_html = '';
        if (item.photo) {
            img_html = `<br/><img src="${item.photo.largeurl}" alt="饭否动态图片"/>`;
        }
        return {
            title: item.text,
            author: item.user.name,
            description: item.text + img_html,
            pubDate: item.created_at,
            link: `https://fanfou.com/statuses/${item.id}`,
        };

View on GitHub (pinned to bed535e087)

Solutions

  1. Set all four FANFOU_* env vars (consumer_key, consumer_secret, username, password) and restart.
  2. If you do not use fanfou, remove the route from any client subscriptions.

Example fix

# before
# (partial or no fanfou config)
# after
FANFOU_CONSUMER_KEY=...
FANFOU_CONSUMER_SECRET=...
FANFOU_USERNAME=...
FANFOU_PASSWORD=...
Defensive patterns

Strategy: validation

Validate before calling

const f = config.fanfou;
const ok = f && f.consumer_key && f.consumer_secret && f.username && f.password;
if (!ok) throw new Error('Fanfou RSS is disabled ...');

Type guard

const isFanfouConfigured = (c: any): boolean =>
  !!c?.fanfou?.consumer_key && !!c?.fanfou?.consumer_secret &&
  !!c?.fanfou?.username && !!c?.fanfou?.password;

Prevention

When it happens

Trigger: Any FANFOU_CONSUMER_KEY / FANFOU_CONSUMER_SECRET / FANFOU_USERNAME / FANFOU_PASSWORD env var is unset on the instance.

Common situations: Optional fanfou config never added; partial config (only some vars set); env renamed in a deploy.

Related errors


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