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 hookView on GitHub (pinned to bed535e087)
Solutions
- Set `INSTAGRAM_USERNAME` and `INSTAGRAM_PASSWORD` in the RSSHub environment (or the `instagram` block of config) and restart.
- 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.
- 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
- Set Instagram credentials via env vars at deploy time and assert them on boot.
- Use ConfigNotFoundError so RSSHub reports it as a config issue, not a crash.
- Keep credentials in a secret manager, not in code.
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
- Invalid cookie
- Iwara subscription RSS is disabled due to the lack of <a hre
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
- 对应 loginUid 的 Bilibili 用户的 Cookie 已过期
- Discord RSS is disabled due to the lack of <a href="https://
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/1a37369a8a659f4b.
Report an issue: GitHub.