{"record":{"id":"8b7ae62f98f3c234","repo":"siyuan-note/siyuan","slug":"authentication-probe-returned-http-response-st","errorCode":null,"errorMessage":"authentication probe returned HTTP \" + response.status","messagePattern":"authentication probe returned HTTP \" \\+ response\\.status","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/electron/main.js","lineNumber":2601,"sourceCode":"    if (!response.ok) {\n        await response.body?.cancel();\n        throw new Error(\"version request returned HTTP \" + response.status);\n    }\n    return response.json();\n};\n\nconst isRemoteKernelAuthenticated = async (target) => {\n    const response = await fetchWithTimeout(target.origin + \"/stage/build/app/\", {\n        method: \"GET\",\n        redirect: \"manual\",\n    });\n    if (response.status === 401 || response.status >= 300 && response.status < 400) {\n        await response.body?.cancel();\n        return false;\n    }\n    if (!response.ok) {\n        await response.body?.cancel();\n        throw new Error(\"authentication probe returned HTTP \" + response.status);\n    }\n    await response.body?.cancel();\n    return true;\n};\n\nconst initRemoteKernel = async (target) => {\n    createBootWindow();\n    if (!await showAppleSiliconWarning(getArg(\"--lang\") || \"\")) {\n        bootWindow.destroy();\n        app.quit();\n        return;\n    }\n    loadBootWindow();\n    if (openAsHidden) {\n        bootWindow.minimize();\n    } else {\n        bootWindow.show();\n    }","sourceCodeStart":2583,"sourceCodeEnd":2619,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/electron/main.js#L2583-L2619","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open target.origin + /stage/build/app/ in a browser to see what the target actually returns","If 502/503, check the reverse proxy's upstream configuration — the kernel may be down or the port wrong","If 404, confirm the URL is the root origin of a SiYuan kernel and not a subpath","Retry once the remote kernel finishes restarting; transient 5xx during boot is possible"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"f, err := os.OpenFile(dataCryptoBackupPath(), os.O_WRONLY|os.O_CREATE, 0644)\nif err != nil {\n    // target not writable; fix before calling the API\n} else {\n    f.Close()\n}\n","typeGuard":null,"tryCatchPattern":"if err := saveNotebookCryptoBackup(kek); err != nil {\n    if strings.Contains(err.Error(), \"write notebook crypto backup failed\") {\n        // check disk space/permissions on backupPath, then retry save\n    }\n}\n","preventionTips":["Ensure adequate free space and quota on the workspace volume","Do not lock or open the backup file exclusively in other tools (sync/backup/AV)"],"tags":["network","http","authentication","remote-kernel","probe"],"backgroundTag":"http-error-response","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}