louislam/uptime-kuma · error · Error

Steam API Key not found

Error message

Steam API Key not found

What it means

Thrown when this.getSteamAPIKey() resolves to a falsy value. The default provider reads Settings.get('steamAPIKey'); a missing key means the Uptime-Kuma instance has never stored a Steam Web API key, so the request to IGameServersService/GetServerList cannot be authenticated and the check aborts before any network call.

Source

Thrown at server/monitor-types/steam.js:45

     */
    constructor(options = {}) {
        super();

        this.steamApiClient = options.steamApiClient || axios;
        this.lookup = options.lookup || dns.lookup;
        this.getSteamAPIKey = options.getSteamAPIKey || (() => Settings.get("steamAPIKey"));
        this.ping = options.ping || ping;
    }

    /**
     * @inheritdoc
     */
    async check(monitor, heartbeat) {
        const steamApiUrl = "https://api.steampowered.com/IGameServersService/GetServerList/v1/";
        const steamAPIKey = await this.getSteamAPIKey();

        if (!steamAPIKey) {
            throw new Error("Steam API Key not found");
        }

        const filter = await this.buildServerFilter(monitor.hostname, monitor.port);

        let res = await this.steamApiClient.get(steamApiUrl, {
            timeout: monitor.timeout * 1000,
            headers: {
                Accept: "*/*",
            },
            httpsAgent: new https.Agent({
                maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)
                rejectUnauthorized: !monitor.getIgnoreTls(),
                secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
            }),
            httpAgent: new http.Agent({
                maxCachedSessions: 0,
            }),
            maxRedirects: monitor.maxredirects,

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Obtain a Steam Web API key from Steamworks and enter it in Uptime-Kuma Settings → Steam API Key.
  2. Restart/re-trigger the monitor after saving the key so Settings.get('steamAPIKey') returns the new value.
  3. If the key was rejected by Steam (403), generate a new one and replace it.
  4. In tests, inject options.getSteamAPIKey so it resolves to a non-empty string.
Defensive patterns

Strategy: validation

Validate before calling

async function requireSteamKey(getKey) {
  const key = await getKey();
  if (!key || typeof key !== "string") throw new Error("Steam API Key not found");
  return key;
}

Type guard

function hasSteamKey(v) { return typeof v === "string" && v.trim().length > 0; }

Try / catch

const key = await this.getSteamAPIKey();
if (!hasSteamKey(key)) { heartbeat.status = DOWN; heartbeat.msg = "Steam API key missing"; return; }

Prevention

When it happens

Trigger: Triggered at the start of SteamMonitorType.check() when the 'steamAPIKey' settings row is absent, empty, or was cleared. The guard prevents sending an unauthenticated request that Steam would reject with HTTP 403/400.

Common situations: Fresh install where the operator never entered a Steam Web API key in Settings; the key was registered against a different Uptime-Kuma instance; Steam revoked/expired the key; or a test environment where getSteamAPIKey was stubbed to return undefined.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/719db8ea88ee6199. Report an issue: GitHub.