{"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/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/updater_release.go#L370-L406","documentation":"Returned by getGitHubManifestChecksum when the HTTP GET for the manifest asset's BrowserDownloadURL succeeds without transport error but the response object or its underlying response.Response is nil. This is a defensive null-check on the httpclient wrapper's response shape — a non-nil error but unusable response.","triggerScenarios":"The httpclient wrapper (NewCloudRequest30s) returned a non-nil response envelope whose inner *http.Response is nil, which can happen with certain transport/redirect edge cases or a custom interceptor that short-circuits. Extremely rare in normal operation.","commonSituations":"A misconfigured custom HTTP transport or proxy plugin injected into httpclient. An httpclient version regression. A redirect loop that the client resolved to an empty response.","solutions":["Retry the request; transient transport anomalies usually clear.","Switch to the stable channel to bypass the GitHub manifest download entirely.","If reproducible, inspect the httpclient configuration and any registered transport interceptors."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Retry once on a nil-response transport anomaly.\nchecksum, err := getGitHubManifestChecksum(ctx, release, pkgName)\nif err != nil && strings.Contains(err.Error(), \"response is empty\") {\n    time.Sleep(5 * time.Second)\n    checksum, err = getGitHubManifestChecksum(ctx, release, pkgName)\n}","preventionTips":["Treat a nil response as a transient transport glitch and retry.","Switch to the stable channel if GitHub asset downloads are systematically broken.","Inspect httpclient transport configuration if this recurs."],"tags":["update","checksum","manifest","network","http-client"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}