{"record":{"id":"977c15cda075412e","repo":"quarkusio/quarkus","slug":"failed-to-read-imageid","errorCode":null,"errorMessage":"Failed to read imageId","messagePattern":"Failed to read imageId","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java","lineNumber":1052,"sourceCode":"            @Override\n            public long getSize() {\n                return delegate.getSize();\n            }\n\n            // this is method we actually need to override\n            @Override\n            public DescriptorDigest getImageId() throws DigestException {\n                return fromDigestOrHash(getPrivateImageId());\n            }\n\n            private String getPrivateImageId() {\n                try {\n                    Field field = DockerImageDetails.class.getDeclaredField(\"imageId\");\n                    field.setAccessible(true);\n                    return (String) field.get(delegate);\n\n                } catch (NoSuchFieldException | IllegalAccessException e) {\n                    throw new RuntimeException(\"Failed to read imageId\", e);\n                }\n            }\n\n            @Override\n            public List<DescriptorDigest> getDiffIds() throws DigestException {\n                return delegate.getDiffIds();\n            }\n        }\n    }\n}\n","sourceCodeStart":1034,"sourceCodeEnd":1063,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java#L1034-L1063","documentation":"The patched DockerImageDetails implementation reads the private 'imageId' field of Jib's DockerImageDetails via reflection. If Jib's internal field is renamed/moved (version drift) or access is blocked, Quarkus throws RuntimeException(\"Failed to read imageId\", e). It is a compatibility failure between Quarkus' reflection shim and the bundled Jib version, not a docker problem.","triggerScenarios":"Docker-daemon build mode (builder=jib, docker strategy) where the image details are inspected and getDigests/getImageId delegation falls back to the reflective private-field read; triggered by NoSuchFieldException or IllegalAccessException.","commonSituations":"Quarkus and Jib versions out of sync (custom dependencyManagement pinning jib-core), security manager or module restrictions blocking setAccessible, Quarkus upgrade regression.","solutions":["Align the Jib version with the one Quarkus manages — remove any jib-core/jib-maven-plugin version overrides from your pom","Upgrade Quarkus to a patch release where the reflection shim matches the bundled Jib","Check the cause: NoSuchFieldException 'imageId' ⇒ version drift; IllegalAccessException ⇒ module/SecurityManager restriction","Workaround: build without daemon inspection (push straight to a registry or use builder=docker without digest lookups)"],"exampleFix":"// before: pom.xml pins jib-core to an older/newer version than Quarkus expects\n<jib-core.version>0.27.0</jib-core.version>\n// after: remove the property so the Quarkus BOM manages it\n<!-- delete the jib-core.version property override -->","handlingStrategy":"try-catch","validationCode":"// fail fast on Jib version drift: assert the expected private field exists\ntry {\n    Class<?> d = Class.forName(\"com.google.cloud.tools.jib.frontend.DockerImageDetails\");\n    d.getDeclaredField(\"imageId\");\n} catch (ReflectiveOperationException e) {\n    throw new IllegalStateException(\"Jib version incompatible with Quarkus image-details shim\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    dockerBuildWithDetails();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Failed to read imageId\")) {\n        throw new IllegalStateException(\"Quarkus/Jib incompatibility — remove custom jib-core version pins\", e);\n    }\n    throw e;\n}","preventionTips":["Never pin jib-core to a custom version; let the Quarkus BOM manage it","Upgrade Quarkus and container-image extensions atomically","Avoid SecurityManager/JDK module setups that block setAccessible"],"tags":["jib","reflection","version-mismatch","docker"],"backgroundTag":"reflective-field-access-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}