{"record":{"id":"3d826f190d785c1c","repo":"quarkusio/quarkus","slug":"invalid-digest-or-hash","errorCode":null,"errorMessage":"Invalid digest or hash: ","messagePattern":"Invalid digest or hash: ","errorType":"console","errorClass":"DigestException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java","lineNumber":1025,"sourceCode":"\n        private static class PatchedDockerImageDetails extends DockerImageDetails {\n\n            /** Pattern matches a SHA-256 hash - 32 bytes in lowercase hexadecimal. */\n            private static final String HASH_REGEX = String.format(\"[a-f0-9]{%d}\", 64);\n\n            /** The algorithm prefix for the digest string. */\n            private static final String DIGEST_PREFIX = \"sha256:\";\n\n            /** Pattern matches a SHA-256 digest - a SHA-256 hash prefixed with \"sha256:\". */\n            private static final String DIGEST_REGEX = DIGEST_PREFIX + HASH_REGEX;\n\n            private static DescriptorDigest fromDigestOrHash(String digestOrHash) throws DigestException {\n                if (digestOrHash.matches(DIGEST_REGEX)) {\n                    return fromDigest(digestOrHash);\n                } else if (digestOrHash.matches(HASH_REGEX)) {\n                    return fromHash(digestOrHash);\n                }\n                throw new DigestException(\"Invalid digest or hash: \" + digestOrHash);\n            }\n\n            private final DockerImageDetails delegate;\n\n            public PatchedDockerImageDetails(DockerImageDetails delegate) {\n                this.delegate = delegate;\n            }\n\n            @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            }","sourceCodeStart":1007,"sourceCodeEnd":1043,"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#L1007-L1043","documentation":"When inspecting an image already present in the local docker daemon, Quarkus patches Jib's DockerImageDetails and parses digests/diff-IDs. fromDigestOrHash accepts either a full digest (sha256:...) or a bare hex hash; anything else throws DigestException(\"Invalid digest or hash: \" + value). This indicates malformed digest data coming from the docker daemon metadata, not user input directly.","triggerScenarios":"quarkus.container-image.build with docker builder where Jib queries the local daemon for the base image and the daemon returns a RepoDigest/DiffId that matches neither the digest regex (sha256:<64 hex>) nor the hash regex (<64 hex>) — e.g. corrupted local image metadata, unusual registries, or nonstandard image stores.","commonSituations":"Corrupted/partially pulled images in the local docker cache, images from obscure registries with malformed digests, containerd image store or podman shim returning unexpected metadata formats, docker version mismatches.","solutions":["Inspect the reported value in the message to see the malformed digest source","Remove and re-pull the offending image: docker rmi <image> && docker pull <image>","If using podman/containerd image store, switch to the classic docker store or update docker","Upgrade Quarkus — patched DockerImageDetails parsing has been adjusted across versions"],"exampleFix":"// before: corrupted cached base image\n$ docker build ... # DigestException: Invalid digest or hash: sha256:zzz...\n// after: purge and re-pull the base image\n$ docker rmi registry.example.com/base:latest\n$ docker pull registry.example.com/base:latest","handlingStrategy":"validation","validationCode":"// validate digests reported by the local daemon before image-details processing\nboolean isValidDigestOrHash(String v) {\n    return v != null && (v.matches(\"sha256:[a-f0-9]{64}\") || v.matches(\"[a-f0-9]{64}\"));\n}","typeGuard":"boolean isWellFormedDigest(String v) {\n    return v != null && v.matches(\"sha256:[a-f0-9]{64}\");\n}","tryCatchPattern":"try {\n    inspectDaemonImage();\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof com.google.cloud.tools.jib.api.DescriptorDigest.DigestException) {\n        // corrupted local image metadata — purge and re-pull\n        throw new IllegalStateException(\"Re-pull the base image: docker rmi <img> && docker pull <img>\", e);\n    }\n    throw e;\n}","preventionTips":["Re-pull base images when daemon metadata looks corrupted","Avoid mixing podman/containerd image stores with jib docker builds","Keep docker daemon up to date","Prefer pulling from the registry during the build rather than relying on stale local images"],"tags":["jib","docker","digest","image-metadata"],"backgroundTag":"invalid-image-digest","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}