DIYgod/RSSHub · error · ConfigNotFoundError

Instagram RSS is disabled due to the lack of <a href="https:

Error message

Instagram 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 as `ConfigNotFoundError` by the Instagram private-API login helper when `config.instagram` is missing or lacks `username`/`password`. The private API requires authenticated (username+password) login against Instagram's private endpoints — there is no anonymous mode. Without these the route cannot create an `IgApiClient` session, so it aborts immediately.

Source

Thrown at lib/routes/instagram/private-api/utils.ts:11

import { IgApiClient } from 'instagram-private-api';

import { config } from '@/config';
import ConfigNotFoundError from '@/errors/types/config-not-found';
import logger from '@/utils/logger';

const ig = new IgApiClient();

async function login(ig, cache) {
    if (!config.instagram || !config.instagram.username || !config.instagram.password) {
        throw new ConfigNotFoundError('Instagram RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }
    const LOGIN_CACHE_KEY = 'instagram:login';
    const { username, password } = config.instagram;
    const state = await cache.get(LOGIN_CACHE_KEY);
    if (state) {
        ig.state.deserialize(state);
    } else {
        ig.state.generateDevice(username);
        // try {
        //     await ig.simulate.preLoginFlow();
        // } catch (error) {
        //     logger.info('Instagram preLoginFlow fail: ' + error);
        // }
        await ig.account.login(username, password);
        queueMicrotask(() => ig.simulate.postLoginFlow());
        logger.debug('Instagram login success.');
    }
    // Post request hook

View on GitHub (pinned to bed535e087)

Solutions

  1. Set `INSTAGRAM_USERNAME` and `INSTAGRAM_PASSWORD` in the RSSHub environment (or the `instagram` block of config) and restart.
  2. If you cannot supply credentials, switch to the web-API variant (`/instagram/user/...` via web-api/index.ts) which can work with a cookie instead, or run anonymously where supported.
  3. Verify the env vars are actually loaded by the process (check `config.instagram` is truthy).

Example fix

// before: no env
// after: in .env
INSTAGRAM_USERNAME=your_account
INSTAGRAM_PASSWORD=your_app_password
Defensive patterns

Strategy: validation

Validate before calling

function hasIgCreds(): boolean {
  return Boolean(config.instagram?.username && config.instagram?.password);
}
// gate the route registration or short-circuit with a friendly message if !hasIgCreds()

Type guard

const igConfigOk = (c?: {username?:string;password?:string}): c is {username:string;password:string} =>
    Boolean(c && c.username && c.password);

Prevention

When it happens

Trigger: Self-hosted RSSHub instance where the operator has not set the `IG_USERNAME`/`IG_PASSWORD` (or `INSTAGRAM_USERNAME`/`INSTAGRAM_PASSWORD`) environment variables; a request hits the private-API Instagram route before any config is supplied.

Common situations: Fresh deploy without env vars; `.env` missing the Instagram block; the variables were renamed or unset during a redeploy; running on the public rsshub.app instance which intentionally does not provide credentials (so these routes are effectively self-host-only).

Related errors


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