{"record":{"id":"571cefe36ceea804","repo":"GoogleContainerTools/jib","slug":"diff-id-not-available-for-reference-layer-without","errorCode":null,"errorMessage":"Diff ID not available for reference layer without diff ID","messagePattern":"Diff ID not available for reference layer without diff ID","errorType":"exception","errorClass":"LayerPropertyNotFoundException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/image/ReferenceNoDiffIdLayer.java","lineNumber":54,"sourceCode":"   */\n  public ReferenceNoDiffIdLayer(BlobDescriptor blobDescriptor) {\n    this.blobDescriptor = blobDescriptor;\n  }\n\n  @Override\n  public Blob getBlob() throws LayerPropertyNotFoundException {\n    throw new LayerPropertyNotFoundException(\n        \"Blob not available for reference layer without diff ID\");\n  }\n\n  @Override\n  public BlobDescriptor getBlobDescriptor() {\n    return blobDescriptor;\n  }\n\n  @Override\n  public DescriptorDigest getDiffId() throws LayerPropertyNotFoundException {\n    throw new LayerPropertyNotFoundException(\n        \"Diff ID not available for reference layer without diff ID\");\n  }\n}\n","sourceCodeStart":36,"sourceCodeEnd":58,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/image/ReferenceNoDiffIdLayer.java#L36-L58","documentation":"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.","triggerScenarios":"Calling Layer.getDiffId() on layers returned by JsonToImageTranslator.toImage when only manifest data existed; iterating Image.getLayers() and requesting diff IDs.","commonSituations":"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.","solutions":["Read diff IDs from the ContainerConfigurationTemplate (getDiffIds()) rather than from the layers","Ensure the container configuration was fetched and passed to JsonToImageTranslator.toImage so diff IDs get paired with layers","Catch LayerPropertyNotFoundException around getDiffId()"],"exampleFix":"// before\nDescriptorDigest diffId = layer.getDiffId();\n// after\nList<DescriptorDigest> diffIds = containerConfigurationTemplate.getDiffIds(); // paired by index with manifest layers","handlingStrategy":"validation","validationCode":"if (containerConfigurationTemplate == null || containerConfigurationTemplate.getDiffIds().size() != manifestTemplate.getLayers().size()) { throw new IllegalStateException(\"need container config diff IDs\"); }","typeGuard":null,"tryCatchPattern":"try { DescriptorDigest d = layer.getDiffId(); } catch (LayerPropertyNotFoundException e) { /* obtain from container config instead */ }","preventionTips":["Always fetch the image's container configuration alongside the manifest","Diff IDs come from the config, digests from the manifest","Check counts match before pairing by index"],"tags":["jib","docker-image","diff-id","container-config"],"backgroundTag":"unsupported-operation","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}