theonedev/onedev · error · ExplicitException

Pack blob missing or corrupted:

Error message

Pack blob missing or corrupted: 

What it means

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.

Source

Thrown at server-plugin/server-plugin-pack-cargo/src/main/java/io/onedev/server/plugin/pack/cargo/CargoPackHandler.java:200

	private void download(HttpServletResponse response, Long projectId, String name, String version) {
		sessionService.run(() -> {
			var project = checkProject(projectId, false);
			var pack = packService.findByNameAndVersion(project, TYPE, name, version);
			if (pack != null) {
				var data = (CargoData) pack.getData();
				PackBlob packBlob;
				if ((packBlob = packBlobService.checkPackBlob(projectId, data.getSha256BlobHash())) != null) {
					try {
						response.setContentType(MediaType.APPLICATION_OCTET_STREAM);
						response.setHeader("Content-Disposition", "attachment; filename=\"" + name + "-" + version + ".crate\"");
						packBlobService.downloadBlob(packBlob.getProject().getId(), packBlob.getSha256Hash(), response.getOutputStream());
						response.setStatus(SC_OK);
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				} else {
					throw new ExplicitException("Pack blob missing or corrupted: " + data.getSha256BlobHash());
				}
			} else {
				response.setStatus(SC_NOT_FOUND);
			}
		});
	}

	private void setYanked(HttpServletResponse response, Long projectId, String name, String version, boolean yanked) {
		LockUtils.run(getLockName(projectId, name), () -> transactionService.run(() -> {
			var project = checkProject(projectId, true);
			var pack = packService.findByNameAndVersion(project, TYPE, name, version);
			if (pack != null) {
				var data = (CargoData) pack.getData();
				data.setYanked(yanked);
				var packBlob = packBlobService.findBySha256Hash(projectId, data.getSha256BlobHash());
				if (packBlob == null)
					throw new ExplicitException("Pack blob missing or corrupted: " + data.getSha256BlobHash());
				packService.createOrUpdate(pack, List.of(packBlob), false);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Republish the package so the blob is re-uploaded.
  2. Check server storage health; the blob may have been lost or corrupted on disk.
Defensive patterns

Strategy: fallback

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/4e68a73c498c3d64. Report an issue: GitHub.