{"record":{"id":"0d3486ab49a54ab3","repo":"siyuan-note/siyuan","slug":"checksum-manifest-response-is-empty","errorCode":null,"errorMessage":"checksum manifest response is empty","messagePattern":"checksum manifest response is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/updater_release.go","lineNumber":388,"sourceCode":"\tif \"\" != manifestDigest {\n\t\tmanifestCacheKey = manifestAsset.BrowserDownloadURL + \"#\" + manifestDigest\n\t}\n\tif \"\" != manifestCacheKey {\n\t\tcached, ok := githubManifestCache.Load(manifestCacheKey)\n\t\tif ok {\n\t\t\tif checksum := parseChecksumManifest(cached.(string), pkgName); \"\" != checksum {\n\t\t\t\treturn checksum, nil\n\t\t\t}\n\t\t\treturn \"\", errors.New(\"package checksum is unavailable\")\n\t\t}\n\t}\n\n\tresponse, err := httpclient.NewCloudRequest30s().SetContext(ctx).Get(manifestAsset.BrowserDownloadURL)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif nil == response || nil == response.Response {\n\t\treturn \"\", errors.New(\"checksum manifest response is empty\")\n\t}\n\tdefer response.Body.Close()\n\tif 200 != response.StatusCode {\n\t\treturn \"\", fmt.Errorf(\"get checksum manifest failed: %d\", response.StatusCode)\n\t}\n\tdata, err := io.ReadAll(io.LimitReader(response.Body, maxChecksumManifestSize+1))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif maxChecksumManifestSize < int64(len(data)) {\n\t\treturn \"\", errors.New(\"checksum manifest is too large\")\n\t}\n\tif \"\" != manifestDigest {\n\t\tactualDigest := fmt.Sprintf(\"%x\", sha256.Sum256(data))\n\t\tif manifestDigest != actualDigest {\n\t\t\treturn \"\", errors.New(\"checksum manifest digest mismatch\")\n\t\t}\n\t}","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/updater_release.go#L370-L406","documentation":"When downloading SHA256SUMS.txt via httpclient.NewCloudRequest30s(), the code validates that both the response wrapper and the underlying http.Response are non-nil before reading the body. If either is nil — the client returned no usable HTTP response despite no transport error — this error is thrown rather than panicking on a nil pointer later.","triggerScenarios":"GET of manifestAsset.BrowserDownloadURL returning err==nil but a nil response or nil response.Response — an edge case of the HTTP client layer (aborted/already-consumed response, misconfigured transport).","commonSituations":"HTTP client internal failures that neither set an error nor a response; bugs or version quirks in the httpclient library; extremely unusual proxy behavior terminating the exchange without a status line.","solutions":["Retry the update check — this is usually transient; the result is cached on success","Upgrade SiYuan / the siyuan-note/httpclient dependency if it reproduces, since a nil response with nil error indicates a client-layer bug","Bypass suspicious proxies/VPN that may abort responses mid-handshake","Manually download the installer and verify SHA-256 against SHA256SUMS.txt as a workaround"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"resp, err := client.Get(url)\nif err == nil && (resp == nil || resp.Response == nil) {\n    // client-layer anomaly: treat as transport failure and retry\n}","typeGuard":null,"tryCatchPattern":"checksum, err := getGitHubManifestChecksum(ctx, release, pkg)\nif err != nil {\n    logging.LogWarnf(\"manifest fetch failed: %s\", err)\n    // retry once, then continue without checksum\n}","preventionTips":["Retry transient nil-response failures before surfacing them to users","Keep siyuan-note/httpclient up to date; nil response with nil error is a client-layer bug","Bypass flaky proxies/VPN that can abort exchanges without a status line","Verify the installer manually when checksum fetch keeps failing"],"tags":["http","checksum","nil-response"],"backgroundTag":"empty-response-body","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}