{"record":{"id":"4e68a73c498c3d64","repo":"theonedev/onedev","slug":"pack-blob-missing-or-corrupted","errorCode":null,"errorMessage":"Pack blob missing or corrupted: ","messagePattern":"Pack blob missing or corrupted: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-plugin/server-plugin-pack-cargo/src/main/java/io/onedev/server/plugin/pack/cargo/CargoPackHandler.java","lineNumber":200,"sourceCode":"\n\tprivate void download(HttpServletResponse response, Long projectId, String name, String version) {\n\t\tsessionService.run(() -> {\n\t\t\tvar project = checkProject(projectId, false);\n\t\t\tvar pack = packService.findByNameAndVersion(project, TYPE, name, version);\n\t\t\tif (pack != null) {\n\t\t\t\tvar data = (CargoData) pack.getData();\n\t\t\t\tPackBlob packBlob;\n\t\t\t\tif ((packBlob = packBlobService.checkPackBlob(projectId, data.getSha256BlobHash())) != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresponse.setContentType(MediaType.APPLICATION_OCTET_STREAM);\n\t\t\t\t\t\tresponse.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + name + \"-\" + version + \".crate\\\"\");\n\t\t\t\t\t\tpackBlobService.downloadBlob(packBlob.getProject().getId(), packBlob.getSha256Hash(), response.getOutputStream());\n\t\t\t\t\t\tresponse.setStatus(SC_OK);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ExplicitException(\"Pack blob missing or corrupted: \" + data.getSha256BlobHash());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresponse.setStatus(SC_NOT_FOUND);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate void setYanked(HttpServletResponse response, Long projectId, String name, String version, boolean yanked) {\n\t\tLockUtils.run(getLockName(projectId, name), () -> transactionService.run(() -> {\n\t\t\tvar project = checkProject(projectId, true);\n\t\t\tvar pack = packService.findByNameAndVersion(project, TYPE, name, version);\n\t\t\tif (pack != null) {\n\t\t\t\tvar data = (CargoData) pack.getData();\n\t\t\t\tdata.setYanked(yanked);\n\t\t\t\tvar packBlob = packBlobService.findBySha256Hash(projectId, data.getSha256BlobHash());\n\t\t\t\tif (packBlob == null)\n\t\t\t\t\tthrow new ExplicitException(\"Pack blob missing or corrupted: \" + data.getSha256BlobHash());\n\t\t\t\tpackService.createOrUpdate(pack, List.of(packBlob), false);","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-cargo/src/main/java/io/onedev/server/plugin/pack/cargo/CargoPackHandler.java#L182-L218","documentation":"CargoPackHandler.download looks up the pack blob by the stored sha256 hash via packBlobService.checkPackBlob; a null result means the underlying blob file is missing or fails integrity checking, so the crate cannot be served and a 404-style error naming the blob is raised.","triggerScenarios":"Thrown at server-plugin/server-plugin-pack-cargo/src/main/java/io/onedev/server/plugin/pack/cargo/CargoPackHandler.java:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Republish the package so the blob is re-uploaded.","Check server storage health; the blob may have been lost or corrupted on disk."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}