siyuan-note/siyuan · error · Error

authentication probe returned HTTP " + response.status

Error message

authentication probe returned HTTP " + response.status

What it means

isRemoteKernelAuthenticated probes a remote kernel to determine whether the user must log in. Responses of 401 or 3xx are treated as 'not authenticated' and return false silently; any other non-ok status (404, 500, 502...) throws this error instead, because it means the target is not behaving like a reachable, working SiYuan kernel.

Source

Thrown at app/electron/main.js:2601

    if (!response.ok) {
        await response.body?.cancel();
        throw new Error("version request returned HTTP " + response.status);
    }
    return response.json();
};

const isRemoteKernelAuthenticated = async (target) => {
    const response = await fetchWithTimeout(target.origin + "/stage/build/app/", {
        method: "GET",
        redirect: "manual",
    });
    if (response.status === 401 || response.status >= 300 && response.status < 400) {
        await response.body?.cancel();
        return false;
    }
    if (!response.ok) {
        await response.body?.cancel();
        throw new Error("authentication probe returned HTTP " + response.status);
    }
    await response.body?.cancel();
    return true;
};

const initRemoteKernel = async (target) => {
    createBootWindow();
    if (!await showAppleSiliconWarning(getArg("--lang") || "")) {
        bootWindow.destroy();
        app.quit();
        return;
    }
    loadBootWindow();
    if (openAsHidden) {
        bootWindow.minimize();
    } else {
        bootWindow.show();
    }

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Open target.origin + /stage/build/app/ in a browser to see what the target actually returns
  2. If 502/503, check the reverse proxy's upstream configuration — the kernel may be down or the port wrong
  3. If 404, confirm the URL is the root origin of a SiYuan kernel and not a subpath
  4. Retry once the remote kernel finishes restarting; transient 5xx during boot is possible
Defensive patterns

Strategy: try-catch

Validate before calling

f, err := os.OpenFile(dataCryptoBackupPath(), os.O_WRONLY|os.O_CREATE, 0644)
if err != nil {
    // target not writable; fix before calling the API
} else {
    f.Close()
}

Try / catch

if err := saveNotebookCryptoBackup(kek); err != nil {
    if strings.Contains(err.Error(), "write notebook crypto backup failed") {
        // check disk space/permissions on backupPath, then retry save
    }
}

Prevention

When it happens

Trigger: The auth probe (GET on /stage/build/app/) returns a non-ok status other than 401 or 3xx — commonly 404 (not a SiYuan kernel), 500 (kernel error), or 502/503 (proxy cannot reach the upstream kernel).

Common situations: Misconfigured reverse proxy returning 404/502; remote kernel crashed or restarting mid-probe; a WAF or CDN returning unexpected status codes; pointing --remote at a host that serves an unrelated app.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/8b7ae62f98f3c234. Report an issue: GitHub.