GoogleContainerTools/jib · error · LayerPropertyNotFoundException

Diff ID not available for reference layer without diff ID

Error message

Diff ID not available for reference layer without diff ID

What it means

ReferenceNoDiffIdLayer has no diff ID by definition — it is built only from a BlobDescriptor. getDiffId() throws LayerPropertyNotFoundException to signal this property is unavailable for this layer type.

Source

Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/image/ReferenceNoDiffIdLayer.java:54

   */
  public ReferenceNoDiffIdLayer(BlobDescriptor blobDescriptor) {
    this.blobDescriptor = blobDescriptor;
  }

  @Override
  public Blob getBlob() throws LayerPropertyNotFoundException {
    throw new LayerPropertyNotFoundException(
        "Blob not available for reference layer without diff ID");
  }

  @Override
  public BlobDescriptor getBlobDescriptor() {
    return blobDescriptor;
  }

  @Override
  public DescriptorDigest getDiffId() throws LayerPropertyNotFoundException {
    throw new LayerPropertyNotFoundException(
        "Diff ID not available for reference layer without diff ID");
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Read diff IDs from the ContainerConfigurationTemplate (getDiffIds()) rather than from the layers
  2. Ensure the container configuration was fetched and passed to JsonToImageTranslator.toImage so diff IDs get paired with layers
  3. Catch LayerPropertyNotFoundException around getDiffId()

Example fix

// before
DescriptorDigest diffId = layer.getDiffId();
// after
List<DescriptorDigest> diffIds = containerConfigurationTemplate.getDiffIds(); // paired by index with manifest layers
Defensive patterns

Strategy: validation

Validate before calling

if (containerConfigurationTemplate == null || containerConfigurationTemplate.getDiffIds().size() != manifestTemplate.getLayers().size()) { throw new IllegalStateException("need container config diff IDs"); }

Try / catch

try { DescriptorDigest d = layer.getDiffId(); } catch (LayerPropertyNotFoundException e) { /* obtain from container config instead */ }

Prevention

When it happens

Trigger: Calling Layer.getDiffId() on layers returned by JsonToImageTranslator.toImage when only manifest data existed; iterating Image.getLayers() and requesting diff IDs.

Common situations: Reading a registry manifest without its accompanying container configuration blob (config missing or not fetched); building an image-to-manifest pipeline that assumes diff IDs exist on manifest-sourced layers.

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


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/571cefe36ceea804. Report an issue: GitHub.