DIYgod/RSSHub · error · ConfigNotFoundError

Spotify public RSS is disabled due to the lack of <a href="h

Error message

Spotify public 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 a ConfigNotFoundError from the getPublicToken() utility function when config.spotify is unset, or when config.spotify.clientId or config.spotify.clientSecret is missing. This function is called by Spotify routes that access public data (tracks, artists, playlists, shows) via the Spotify Web API using client-credentials OAuth flow. The clientId and clientSecret are obtained from the Spotify Developer Dashboard. ConfigNotFoundError signals to the user that operator configuration is required.

Source

Thrown at lib/routes/spotify/utils.ts:8

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

// Token used to retrieve public information.
async function getPublicToken() {
    if (!config.spotify || !config.spotify.clientId || !config.spotify.clientSecret) {
        throw new ConfigNotFoundError('Spotify public RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }

    const { clientId, clientSecret } = config.spotify;

    const tokenResponse = await ofetch('https://accounts.spotify.com/api/token', {
        method: 'POST',
        headers: {
            Authorization: `Basic ${Buffer.from(`${clientId}:${clientSecret}`).toString('base64')}`,
            'Content-Type': 'application/x-www-form-urlencoded',
        },
        body: new URLSearchParams({
            grant_type: 'client_credentials',
        }).toString(),
    });
    return tokenResponse.access_token;
}

// Token used to retrieve user-specific information.

View on GitHub (pinned to bed535e087)

Solutions

  1. Create a Spotify app at https://developer.spotify.com/dashboard, copy the Client ID and Client Secret.
  2. Set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET in the RSSHub environment and restart.
  3. If using Docker, pass the env vars via -e or docker-compose environment section.
  4. If the credentials were revoked, regenerate them from the Spotify Developer Dashboard.

Example fix

# before
# (SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET not set)

# after (.env)
SPOTIFY_CLIENT_ID=your-client-id
SPOTIFY_CLIENT_SECRET=your-client-secret
Defensive patterns

Strategy: validation

Validate before calling

if (!config.spotify?.clientId || !config.spotify?.clientSecret) {
    throw new ConfigNotFoundError('Spotify RSS requires SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET.');
}

Type guard

function hasSpotifyPublicConfig(cfg: typeof config): cfg is typeof config & { spotify: { clientId: string; clientSecret: string } } {
    return (
        !!cfg.spotify &&
        typeof cfg.spotify.clientId === 'string' &&
        cfg.spotify.clientId.length > 0 &&
        typeof cfg.spotify.clientSecret === 'string' &&
        cfg.spotify.clientSecret.length > 0
    );
}

Prevention

When it happens

Trigger: Any Spotify public-data route is requested (e.g. /spotify/artist/:id, /spotify/playlist/:id) on an instance where SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET are not set. The error fires before any network call, at the token-acquisition step.

Common situations: Self-hosted RSSHub without Spotify credentials configured; the Spotify app credentials were revoked or rotated; or using a public instance that does not support Spotify routes.

Related errors


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