{"record":{"id":"295ccd41ae949d9a","repo":"siyuan-note/siyuan","slug":"the-update-install-package-returned-by-the-kernel","errorCode":null,"errorMessage":"the update install package returned by the kernel is invalid","messagePattern":"the update install package returned by the kernel is invalid","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/electron/main.js","lineNumber":1742,"sourceCode":"        .concat(Array.from(kernelProcesses.keys()), request.initiatingPort)));\n    ports.forEach((port) => expectedKernelExitPorts.add(port));\n    writeLog(\"coordinating update install [initiatingPort=\" + request.initiatingPort + \", ports=\" + ports.join(\",\") +\n        \"]\");\n\n    workspaces.forEach((workspace) => {\n        if (workspace.browserWindow && !workspace.browserWindow.isDestroyed()) {\n            workspace.browserWindow.hide();\n        }\n    });\n\n    const otherPorts = ports.filter((port) => port !== request.initiatingPort);\n    writeLog(\"closing other workspaces for update [ports=\" + otherPorts.join(\",\") + \"]\");\n    await closeUpdateKernelStage(otherPorts, request);\n    writeLog(\"closing initiating workspace for update [port=\" + request.initiatingPort + \"]\");\n    const [initiatingExitResponse] = await closeUpdateKernelStage([request.initiatingPort], request);\n    const installPkgPath = validateUpdateInstallPackage(request, initiatingExitResponse?.data?.installPkgPath);\n    if (!installPkgPath) {\n        throw new Error(\"the update install package returned by the kernel is invalid\");\n    }\n\n    await launchUpdateInstallPackage(installPkgPath);\n    keepAppOpenDuringUpdate = false;\n    app.exit();\n};\n\nconst beginUpdateInstall = (event, data) => {\n    if (updateInstallPromise) {\n        writeLog(\"ignored duplicate update install request\");\n        return true;\n    }\n    if (systemShutdownState !== systemShutdownNone) {\n        writeLog(\"rejected update install request during system shutdown\");\n        return false;\n    }\n\n    const request = validateUpdateInstallRequest(event, data);","sourceCodeStart":1724,"sourceCodeEnd":1760,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/electron/main.js#L1724-L1760","documentation":"In the update install flow, after closing all workspaces and kernels, the initiating kernel is expected to return an installPkgPath in its exit response. If validateUpdateInstallPackage returns falsy — the path is missing, empty, or fails validation — Electron cannot locate the downloaded install package and throws this error.","triggerScenarios":"request.initiatingPort's kernel exit response has no data.installPkgPath, the field is null/empty, or the path returned points to a missing/corrupt package, causing validateUpdateInstallPackage to yield no usable path before launchUpdateInstallPackage is called.","commonSituations":"The kernel failed to finish downloading the update package before being asked to exit; a stale kernel version that does not return installPkgPath; disk-full or permission errors deleting the downloaded package; kernel crashed mid-update leaving an empty response.","solutions":["Retry the update from within the app so the kernel can re-download and return a valid installPkgPath","Check the kernel logs for download failures (disk space, network, permissions) and fix the root cause","Update manually: download the installer from the official site and run it yourself","Ensure the running kernel version matches the Electron shell expectation for the update handshake"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"if info, err := os.Stat(util.DataDir); err != nil || !info.IsDir() {\n    // workspace data dir missing or inaccessible\n}\n","typeGuard":null,"tryCatchPattern":"if err := EnableEncryptedNotebook(...); err != nil {\n    var pe *fs.PathError\n    if errors.As(err, &pe) && errors.Is(pe.Err, syscall.EACCES) {\n        // fix permissions on data dir, then retry\n    }\n}\n","preventionTips":["Run the kernel as a user with write access to the workspace","Avoid read-only mounts or removable media for the workspace data directory"],"tags":["update","electron","install-package","ipc-response"],"backgroundTag":"unexpected-response-shape","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}