GoogleContainerTools/jib · error · LayerPropertyNotFoundException
Blob not available for digest-only layer
Error message
Blob not available for digest-only layer
What it means
DigestOnlyLayer represents a layer known only by its digest (no blob content). Jib throws this LayerPropertyNotFoundException from getBlob() because there is no Blob backing a digest-only layer — only the digest is stored. Callers must not request content they never supplied.
Source
Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/image/DigestOnlyLayer.java:40
/** A {@link Layer} reference that only has its {@link DescriptorDigest}. */
public class DigestOnlyLayer implements Layer {
/** The {@link BlobDescriptor} of the compressed layer content. */
private final BlobDescriptor blobDescriptor;
/**
* Instantiate with a {@link DescriptorDigest}.
*
* @param digest the digest to instantiate the {@link DigestOnlyLayer} from
*/
public DigestOnlyLayer(DescriptorDigest digest) {
blobDescriptor = new BlobDescriptor(digest);
}
@Override
public Blob getBlob() throws LayerPropertyNotFoundException {
throw new LayerPropertyNotFoundException("Blob not available for digest-only layer");
}
@Override
public BlobDescriptor getBlobDescriptor() {
return blobDescriptor;
}
@Override
public DescriptorDigest getDiffId() throws LayerPropertyNotFoundException {
throw new LayerPropertyNotFoundException("Diff ID not available for digest-only layer");
}
}
View on GitHub (pinned to fb949e2676)
Solutions
- Do not call getBlob() on digest-only layers; check the concrete Layer type first and use getBlobDescriptor().getDigest() instead
- Use the layer cache (CachedLayer) or a Layer built from an actual Blob when blob content is needed
- Catch LayerPropertyNotFoundException around getBlob() when iterating heterogeneous layers
Example fix
// before Blob blob = layer.getBlob(); // after BlobDescriptor desc = layer.getBlobDescriptor(); // use desc.getDigest() for digest-only layers; only call getBlob() on cached layers
Defensive patterns
Strategy: type-guard
Validate before calling
// Java boolean hasBlob = !(layer instanceof DigestOnlyLayer) && !(layer instanceof ReferenceLayer);
Type guard
boolean hasBlob(Layer l) { return l instanceof CachedLayer || l instanceof CountingDigestOutputWriter-bearing classes; } Try / catch
try { Blob b = layer.getBlob(); } catch (LayerPropertyNotFoundException e) { /* fall back to getBlobDescriptor().getDigest() */ } Prevention
- Know the concrete Layer type before calling property accessors
- Use getBlobDescriptor() for digest/size on manifest-derived layers
- Fetch blobs via the registry client, not the in-memory Image
When it happens
Trigger: Calling Layer.getBlob() on a layer obtained from an Image that was built with digests only (e.g. via JsonToImageTranslator.toImage or an Image built from a manifest), rather than a cached/compressed layer that carries blob data.
Common situations: Reading layers back from a parsed registry manifest and assuming each Layer exposes content; serializing/copying an image and attempting to re-upload layer blobs from the in-memory image; unit tests probing Layer API uniformly.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Diff ID not available for digest-only layer
- Blob not available for reference layer
- Blob not available for reference layer without diff ID
- Diff ID not available for reference layer without diff ID
- Path does not start with forward slash (/): ${unixPath}
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/998bae43aeb1293f.
Report an issue: GitHub.