{"record":{"id":"a8a3d9095af7339c","repo":"theonedev/onedev","slug":"pack-blob-missing-or-corrupted-sha256","errorCode":null,"errorMessage":"Pack blob missing or corrupted: ${sha256}","messagePattern":"Pack blob missing or corrupted: (.+?)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"critical","filePath":"server-plugin/server-plugin-pack-nuget/src/main/java/io/onedev/server/plugin/pack/nuget/NugetPackHandler.java","lineNumber":510,"sourceCode":"\t\t\t\t\tif (pack != null) {\n\t\t\t\t\t\tvar data = (NugetData) pack.getData();\n\t\t\t\t\t\tif (fileName.endsWith(\".nuspec\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse.getOutputStream().write(data.getMetadata());\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPackBlob packBlob;\n\t\t\t\t\t\t\tif ((packBlob = packBlobService.checkPackBlob(projectId, data.getNupkgBlobSha256Hash())) != null) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tpackBlobService.downloadBlob(packBlob.getProject().getId(), \n\t\t\t\t\t\t\t\t\t\t\tpackBlob.getSha256Hash(), response.getOutputStream());\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Pack blob missing or corrupted: \" + data.getNupkgBlobSha256Hash());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresponse.setStatus(SC_OK);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponse.setStatus(SC_NOT_FOUND);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tresponse.setStatus(SC_NOT_FOUND);\n\t\t}\n\t}\n\t\n\tprivate Map<String, Object> getLeafValue(Pack pack, SAXReader saxReader, String baseUrl) {\n\t\tvar leafValue = new HashMap<String, Object>();\n\t\tleafValue.put(\"@id\", getRegistrationLeafUrl(baseUrl, pack.getName(), pack.getVersion()));\n\t\tleafValue.put(\"packageContent\", getPackageDownloadUrl(baseUrl, pack.getName(), pack.getVersion()));\n","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-nuget/src/main/java/io/onedev/server/plugin/pack/nuget/NugetPackHandler.java#L492-L528","documentation":"The package record exists but its registered nupkg blob (looked up by SHA-256 hash) is missing or fails the integrity check, so the handler throws ExplicitException('Pack blob missing or corrupted: <sha256>') — an internal inconsistency between the pack metadata and the blob store.","triggerScenarios":"GET package/{id}/{version}/{file>.nupkg} where packBlobService.checkPackBlob(projectId, data.getNupkgBlobSha256Hash()) returns null: the blob row/file is absent or its hash no longer matches (corruption).","commonSituations":"Manual deletion or cleanup of the server's blob storage directory; failed/incomplete backups and restores; disk corruption or accidental pruning jobs; DB rows kept while underlying blob files were wiped (or vice versa).","solutions":["Re-publish the affected package version to regenerate the blob and repair the reference","Restore the missing blob from backup (server site/blob storage) matching the reported sha256 hash","Audit any storage cleanup jobs/scripts that delete files under OneDev's site directory","Check server logs around the time blob storage was modified; run integrity checks on the storage volume","If the record is unrecoverable, delete the pack entry and republish"],"exampleFix":"// server-side remediation\n// before: GET .../package/My.Package/1.2.3/My.Package.1.2.3.nupkg -> 500 Pack blob missing or corrupted: abc123...\n// after:\n# restore the blob file for sha256 abc123... from backup into OneDev's site/blob store, or\ncurl -u user:token -X PUT --upload-file My.Package.1.2.3.nupkg https://onedev.example.com/~nuget/project-x/   # republish\n","handlingStrategy":"fallback","validationCode":"# detect corruption before relying on the feed\nurl=$(registration-leaf-url for pkg/version)\ncurl -fsSI \"$url\" || echo \"package content unavailable — plan republish\"\n","typeGuard":null,"tryCatchPattern":"try {\n  await download(nupkgUrl);\n} catch (e) {\n  if (/Pack blob missing or corrupted/.test(String(e))) {\n    await republishPackage(pkg); // restore from your .nupkg artifact cache\n  } else throw e;\n}","preventionTips":["Never manually delete files under OneDev's site/blob storage","Include blob storage in backups and verify restores","Keep original .nupkg artifacts in CI for easy republish","Run periodic integrity checks on the blob store"],"tags":["data-corruption","blob-storage","nuget","internal-error"],"backgroundTag":"checksum-mismatch","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}