louislam/uptime-kuma · error · Error

No WxPusher SPT is configured

Error message

No WxPusher SPT is configured

What it means

Thrown by the WxPusher provider when, after splitting notification.wxpusherSPT on commas, trimming, and filtering empty strings, the resulting sptList has length 0. WxPusher's simple-push API requires at least one SPT (Simple Push Token) per request, so an empty list is rejected before any HTTP call.

Source

Thrown at server/notification-providers/wxpusher.js:25

    // WxPusher's simple-push accepts at most 10 SPTs per request.
    static SPT_PER_REQUEST = 10;

    /**
     * @inheritdoc
     */
    async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
        const okMsg = "Sent Successfully.";

        // Accept one or multiple SPTs, comma-separated.
        const sptList = String(notification.wxpusherSPT || "")
            .split(",")
            .map((spt) => spt.trim())
            .filter((spt) => spt.length > 0);

        try {
            if (sptList.length === 0) {
                throw new Error("No WxPusher SPT is configured");
            }

            const summary = this.checkStatus(heartbeatJSON, monitorJSON).slice(0, 100);
            const config = this.getAxiosConfigWithProxy({});

            // Send in batches so more than 10 SPTs are all delivered, never silently dropped.
            for (let i = 0; i < sptList.length; i += WxPusher.SPT_PER_REQUEST) {
                const context = {
                    content: msg,
                    summary,
                    contentType: 1,
                    sptList: sptList.slice(i, i + WxPusher.SPT_PER_REQUEST),
                };
                const result = await axios.post(
                    "https://wxpusher.zjiecode.com/api/send/message/simple-push",
                    context,
                    config
                );

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Open the WxPusher app/website, copy the SPT (Simple Push Token) for the target user, and paste it into the wxpusherSPT field.
  2. For multiple recipients, paste comma-separated SPTs; the provider batches them 10 per request.
  3. Save and click Test to confirm delivery.
  4. If the SPT contains leading/trailing spaces, the trim() handles it — no manual cleanup needed.
Defensive patterns

Strategy: validation

Validate before calling

// Validate SPT presence before entering the request loop
const sptList = String(notification.wxpusherSPT || "")
    .split(",").map((s) => s.trim()).filter(Boolean);
if (sptList.length === 0) {
    throw new Error("No WxPusher SPT is configured");
}

Type guard

/** True when the SPT list has at least one non-empty token. */
function hasWxPusherSpt(notification) {
    return String(notification.wxpusherSPT || "").split(",").some((s) => s.trim().length > 0);
}

Try / catch

if (!hasWxPusherSpt(notification)) {
    throw new Error("No WxPusher SPT is configured");
}
try {
    for (let i = 0; i < sptList.length; i += WxPusher.SPT_PER_REQUEST) {
        const result = await axios.post(url, context, config);
        if (result.data.code !== 1000) throw result.data.msg;
    }
} catch (err) { this.throwGeneralAxiosError(err); }

Prevention

When it happens

Trigger: wxpusherSPT field blank, whitespace-only, or set to a string of commas only. Also occurs if the field was never populated after creating the notification.

Common situations: User created the WxPusher notification but did not paste the app SPT, or the SPT was cleared during an edit and saved empty.

Related errors


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