{"record":{"id":"2f537efbed39ec3a","repo":"siyuan-note/siyuan","slug":"boot-progress-request-returned-http-response-s","errorCode":null,"errorMessage":"boot progress request returned HTTP \" + response.status","messagePattern":"boot progress request returned HTTP \" \\+ response\\.status","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/electron/main.js","lineNumber":2668,"sourceCode":"    }\n    writeLog(\"got remote kernel version [\" + versionData.data + \"]\");\n    if (versionStatus === \"mismatch\") {\n        const remoteVersion = escapeHTML(versionData.data);\n        showErrorWindow(\"远程内核版本不匹配\", \"Remote kernel version mismatch\",\n            \"<div>客户端版本 \" + appVer + \" 与远程内核版本 \" + remoteVersion + \" 不一致。</div>\" +\n            \"<div>Client version \" + appVer + \" does not match remote kernel version \" + remoteVersion + \".</div>\");\n        bootWindow.destroy();\n        return;\n    }\n\n    const bootShowStart = Date.now();\n    let booted = false;\n    while (Date.now() - bootShowStart <= 300000) {\n        try {\n            const response = await fetchWithTimeout(target.origin + \"/api/system/bootProgress\");\n            if (!response.ok) {\n                await response.body?.cancel();\n                throw new Error(\"boot progress request returned HTTP \" + response.status);\n            }\n            const progressData = await response.json();\n            if (progressData?.data?.progress >= 100) {\n                booted = true;\n                break;\n            }\n        } catch (error) {\n            writeLog(\"get remote boot progress failed: \" + error.message);\n        }\n        await sleep(500);\n    }\n    if (!booted) {\n        showErrorWindow(\"连接远程内核超时\", \"Remote kernel connection timed out\",\n            \"<div>等待远程内核完成启动超时。</div><div>Timed out waiting for the remote kernel to finish booting.</div>\");\n        bootWindow.destroy();\n        return;\n    }\n","sourceCodeStart":2650,"sourceCodeEnd":2686,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/electron/main.js#L2650-L2686","documentation":"While waiting up to 5 minutes for a remote kernel to finish booting, the loop polls /api/system/bootProgress. If a poll response is not ok, the error is thrown (inside the try, so it may be retried by the surrounding loop depending on its structure). It indicates the remote kernel's HTTP endpoint failed during the boot-wait window.","triggerScenarios":"fetchWithTimeout(target.origin + \"/api/system/bootProgress\") returns response.ok === false during the 300-second boot-wait loop — e.g. the kernel restarts mid-boot, a proxy returns 502/503, or the kernel returns 4xx/5xx after boot progress started.","commonSituations":"Remote kernel is still starting and its reverse proxy returns 503 until upstream is up; kernel crashed during startup; proxy timeouts or rate limiting kicking in during the wait; the remote host rebooted mid-connection.","solutions":["Wait for the remote kernel to fully start and retry the connection","Check the remote kernel's logs/server console for startup errors if the failure persists","Configure the reverse proxy to tolerate the boot window (longer upstream timeouts, retry on 503)","Verify the target origin is still correct and the kernel port did not change"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The boot-wait loop already retries within the try; wrap the outer call:\ntry {\n  await waitForRemoteKernelBoot(target);\n} catch (e) {\n  if (String(e.message).startsWith(\"boot progress request returned HTTP\")) {\n    // check remote kernel logs / proxy health before reconnecting\n  }\n}","preventionTips":["Start the remote kernel before attempting to connect","Configure proxy 503-retry/timeout settings to cover the boot window","Investigate kernel startup failures if bootProgress repeatedly errors"],"tags":["network","http","boot-progress","remote-kernel","polling"],"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"}