{"record":{"id":"480ac42c58c3484d","repo":"GoogleContainerTools/jib","slug":"unknown-mediatype-mediatype","errorCode":null,"errorMessage":"Unknown mediaType: + mediaType","messagePattern":"Unknown mediaType: \\+ mediaType","errorType":"exception","errorClass":"UnknownManifestFormatException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/registry/AbstractManifestPuller.java","lineNumber":185,"sourceCode":"\n      String mediaType = mediaTypeNode.asText();\n      if (OciManifestTemplate.MANIFEST_MEDIA_TYPE.equals(mediaType)) {\n        return manifestTemplateClass.cast(\n            JsonTemplateMapper.readJson(jsonString, OciManifestTemplate.class));\n      }\n      if (V22ManifestTemplate.MANIFEST_MEDIA_TYPE.equals(mediaType)) {\n        return manifestTemplateClass.cast(\n            JsonTemplateMapper.readJson(jsonString, V22ManifestTemplate.class));\n      }\n      if (V22ManifestListTemplate.MANIFEST_MEDIA_TYPE.equals(mediaType)) {\n        return manifestTemplateClass.cast(\n            JsonTemplateMapper.readJson(jsonString, V22ManifestListTemplate.class));\n      }\n      if (OciIndexTemplate.MEDIA_TYPE.equals(mediaType)) {\n        return manifestTemplateClass.cast(\n            JsonTemplateMapper.readJson(jsonString, OciIndexTemplate.class));\n      }\n      throw new UnknownManifestFormatException(\"Unknown mediaType: \" + mediaType);\n    }\n    throw new UnknownManifestFormatException(\n        \"Unknown schemaVersion: \" + schemaVersion + \" - only 1 and 2 are supported\");\n  }\n\n  @Override\n  public R handleHttpResponseException(ResponseException responseException)\n      throws ResponseException, RegistryErrorException {\n    throw responseException;\n  }\n}\n","sourceCodeStart":167,"sourceCodeEnd":197,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/registry/AbstractManifestPuller.java#L167-L197","documentation":"Thrown by AbstractManifestPuller.getManifestTemplateFromJson when a schemaVersion 2 manifest carries a mediaType that Jib does not recognize (not Docker manifest/list or OCI manifest/index). Jib only supports a fixed set of media types and rejects anything else. It surfaces as UnknownManifestFormatException containing the offending mediaType string.","triggerScenarios":"Registry returns a manifest whose mediaType field is a custom value, an artifact (e.g. an attestation, SBOM, or cosign signature manifest), or a newer format not supported by this Jib version.","commonSituations":"Pulling a tag that resolves to a non-image artifact (cosign attestations, Helm charts stored as OCI artifacts), or using an old Jib version against a registry that serves newer OCI media types.","solutions":["Verify the image reference points to a container image, not an OCI artifact (signature, SBOM, attestation).","Upgrade Jib to the latest version, which recognizes more media types.","Check the registry's mediaType in the raw manifest and confirm it is one of the supported Docker/OCI types.","If your own registry serves custom media types, change them to standard image manifest types."],"exampleFix":"// before\n\"mediaType\": \"application/vnd.example.custom.manifest\"\n// after\n\"mediaType\": \"application/vnd.oci.image.manifest.v1+json\"","handlingStrategy":"validation","validationCode":"// preflight: check the mediaType the tag resolves to\n// curl -s <manifest-url> | jq -r '.mediaType'\n// must be one of:\n// application/vnd.docker.distribution.manifest.v2+json\n// application/vnd.docker.distribution.manifest.list.v2+json\n// application/vnd.oci.image.manifest.v1+json\n// application/vnd.oci.image.index.v1+json","typeGuard":null,"tryCatchPattern":"// catch and explain unsupported media types\ntry {\n    jibContainerBuilder.containerize();\n} catch (RegistryErrorException e) {\n    if (e.getMessage().contains(\"Unknown mediaType\")) {\n        throw new IllegalStateException(\"Tag points to a non-image artifact or unsupported media type — verify the reference\", e);\n    }\n    throw e;\n}","preventionTips":["Only reference tags that resolve to actual container images, not signatures/SBOMs/attestations.","Keep Jib up to date to pick up newly supported OCI media types.","Check resolved mediaType with `docker manifest inspect` before building."],"tags":["docker-registry","manifest","media-type","oci"],"backgroundTag":"unsupported-enum-value","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"}