louislam/uptime-kuma · error · Error

Nextcloud Talk Error ${result?.status ?? "Unknown"}

Error message

Nextcloud Talk Error ${result?.status ?? "Unknown"}

What it means

The Nextcloud Talk provider POSTs a signed message to the Talk bot URL and strictly requires result.status === 201 (Created). Any other status — including 200 OK — is treated as failure and this Error is thrown, then immediately caught and re-processed through throwGeneralAxiosError. The request includes a custom X-Nextcloud-Talk-Bot-Signature header and OCS-APIRequest header, so auth/signing problems surface here.

Source

Thrown at server/notification-providers/nextcloudtalk.js:53

        };

        const options = {
            ...config,
            headers: {
                "X-Nextcloud-Talk-Bot-Random": talkRandom,
                "X-Nextcloud-Talk-Bot-Signature": talkSignature,
                "OCS-APIRequest": true,
            },
        };

        try {
            let result = await axios.post(url, data, options);

            if (result?.status === 201) {
                return okMsg;
            }

            throw new Error("Nextcloud Talk Error " + (result?.status ?? "Unknown"));
        } catch (error) {
            this.throwGeneralAxiosError(error);
        }
    }
}

module.exports = NextcloudTalk;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Re-copy the Bot URL and the Bot secret exactly from Nextcloud Talk -> Conversation -> Add bot / Settings.
  2. Confirm the signature is computed over the raw request body with the correct algorithm the Talk bot expects.
  3. If the server legitimately returns 200 on success, widen the success check to accept 200 and 201.
  4. Check Nextcloud logs (data/nextcloud.log) for the rejected request to see the real reason.

Example fix

// before
if (result?.status === 201) {
    return okMsg;
}
throw new Error("Nextcloud Talk Error " + (result?.status ?? "Unknown"));

// after - accept the documented success codes
if (result?.status === 200 || result?.status === 201) {
    return okMsg;
}
throw new Error(`Nextcloud Talk Error ${result?.status ?? "Unknown"}: ${JSON.stringify(result?.data)}`);
Defensive patterns

Strategy: try-catch

Validate before calling

if (!notification.nextcloudtalkURL || !notification.nextcloudtalkSecret) {
    throw new Error("Nextcloud Talk bot URL and secret are required");
}

Try / catch

try {
    const result = await axios.post(url, data, options);
    if (result?.status === 200 || result?.status === 201) return okMsg;
    throw new Error(`Nextcloud Talk rejected: HTTP ${result?.status}`);
} catch (error) {
    if (error.response && error.response.status === 401) {
        throw new Error("Nextcloud Talk signature/auth rejected - check bot secret");
    }
    throw error;
}

Prevention

When it happens

Trigger: Nextcloud Talk returns 200 instead of 201 (older/different Talk version), 401 when the bot token/secret is wrong so the signature mismatches, 403 if the bot is not enabled in the chat, 404 for a wrong URL room token, or 400 for a malformed request body.

Common situations: Bot secret (used to compute talkSignature) incorrect or rotated; URL points to a room that no longer exists; Nextcloud Talk version returns non-201 success codes; reverse proxy rewriting the path.

Related errors


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