{"record":{"id":"d2599f90eb005c1b","repo":"GoogleContainerTools/jib","slug":"registry-may-not-support-pushing-oci-manifest-or-d","errorCode":null,"errorMessage":"Registry may not support pushing OCI Manifest or Docker Image Manifest Version 2, Schema 2","messagePattern":"Registry may not support pushing OCI Manifest or Docker Image Manifest Version 2, Schema 2","errorType":"exception","errorClass":"RegistryErrorException","httpStatus":400,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/registry/ManifestPusher.java","lineNumber":115,"sourceCode":"    // docker registry 2.0 and 2.1 returns:\n    //   400 Bad Request\n    //   {\"errors\":[{\"code\":\"TAG_INVALID\",\"message\":\"manifest tag did not match URI\"}]}\n    // docker registry:2.2 returns:\n    //   400 Bad Request\n    //   {\"errors\":[{\"code\":\"MANIFEST_INVALID\",\"message\":\"manifest invalid\",\"detail\":{}}]}\n    // quay.io returns:\n    //   415 UNSUPPORTED MEDIA TYPE\n    //   {\"errors\":[{\"code\":\"MANIFEST_INVALID\",\"detail\":\n    //   {\"message\":\"manifest schema version not supported\"},\"message\":\"manifest invalid\"}]}\n\n    if (responseException.getStatusCode() != HttpStatus.SC_BAD_REQUEST\n        && responseException.getStatusCode() != HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE) {\n      throw responseException;\n    }\n\n    ErrorCodes errorCode = ErrorResponseUtil.getErrorCode(responseException);\n    if (errorCode == ErrorCodes.MANIFEST_INVALID || errorCode == ErrorCodes.TAG_INVALID) {\n      throw new RegistryErrorExceptionBuilder(getActionDescription(), responseException)\n          .addReason(\n              \"Registry may not support pushing OCI Manifest or \"\n                  + \"Docker Image Manifest Version 2, Schema 2\")\n          .build();\n    }\n    // rethrow: unhandled error response code.\n    throw responseException;\n  }\n\n  @Override\n  public DescriptorDigest handleResponse(Response response) throws IOException {\n    // Checks if the image digest is as expected.\n    DescriptorDigest expectedDigest = Digests.computeJsonDigest(manifestTemplate);\n\n    List<String> receivedDigests = response.getHeader(RESPONSE_DIGEST_HEADER);\n    if (receivedDigests.size() == 1) {\n      try {\n        DescriptorDigest receivedDigest = DescriptorDigest.fromDigest(receivedDigests.get(0));","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/registry/ManifestPusher.java#L97-L133","documentation":"ManifestPusher converts certain registry HTTP error responses into a RegistryErrorException explaining that the registry likely does not support OCI manifests or Docker Image Manifest Version 2, Schema 2. When the registry responds with a MANIFEST_INVALID or TAG_INVALID error code, Jib surfaces this hint because those codes commonly indicate schema-version incompatibility rather than a malformed manifest.","triggerScenarios":"Pushing a manifest via ManifestPusher.handleHttpResponseException where the registry's error response carries error code MANIFEST_INVALID or TAG_INVALID (and the original status was UNAUTHORIZED, FORBIDDEN, or UNSUPPORTED_MEDIA_TYPE filtered upstream).","commonSituations":"Pushing to an old or minimal registry (e.g., a legacy Docker registry or an old Quay/portus version) that only supports Schema 1 manifests; pushing OCI image index/manifest to a registry that only accepts Docker v2; registry misconfiguration disabling media type application/vnd.docker.distribution.manifest.v2+json.","solutions":["Configure Jib to use a manifest format the registry supports (e.g., Docker V2.2 instead of OCI) via the image format/build setting","Upgrade the target registry to a version supporting Schema 2 / OCI manifests","Verify the registry is not behind a proxy that strips or rejects the manifest media type","Inspect the full registry error response for the underlying reason"],"exampleFix":"// before: OCI format pushed to legacy registry\njibContainerBuilder.containerize(Containerizer.to(RegistryImage.name(\"legacy.example.com/app\")).setFormat(ImageFormat.OCI));\n// after: use Docker manifest format\njibContainerBuilder.containerize(Containerizer.to(RegistryImage.name(\"legacy.example.com/app\")).setFormat(ImageFormat.Docker));","handlingStrategy":"fallback","validationCode":"// check registry capability before pushing with OCI format\ncurl -s https://registry.example.com/v2/ | head  // confirm v2 API reachable","typeGuard":null,"tryCatchPattern":"try { client.pushManifest(manifest, tag); } catch (RegistryErrorException e) { // fall back to Docker V2.2 format\n  pushAsDockerV22(); }","preventionTips":["Check the target registry supports Schema 2 / OCI before enabling those formats","Upgrade legacy registries","Test pushes to staging registries with the same version"],"tags":["registry","manifest-push","compatibility"],"backgroundTag":"http-error-response","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}