{"record":{"id":"04bbf8917a4d05b7","repo":"apache/iceberg","slug":"cannot-read-unknown-manifest-type-s-04bbf8","errorCode":null,"errorMessage":"Cannot read unknown manifest type: %s","messagePattern":"Cannot read unknown manifest type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/ManifestFiles.java","lineNumber":424,"sourceCode":"   *\n   * @param manifestData the binary data.\n   * @return a {@link ManifestFile}. To be precise, it's a {@link GenericManifestFile} which don't\n   *     expose to public.\n   * @throws IOException if encounter any IO error when decoding.\n   */\n  public static ManifestFile decode(byte[] manifestData) throws IOException {\n    return AvroEncoderUtil.decode(manifestData);\n  }\n\n  static ManifestReader<?> open(\n      ManifestFile manifest, FileIO io, Map<Integer, PartitionSpec> specsById) {\n    switch (manifest.content()) {\n      case DATA:\n        return ManifestFiles.read(manifest, io, specsById);\n      case DELETES:\n        return ManifestFiles.readDeleteManifest(manifest, io, specsById);\n    }\n    throw new UnsupportedOperationException(\n        \"Cannot read unknown manifest type: \" + manifest.content());\n  }\n\n  static ManifestFile copyAppendManifest(\n      int formatVersion,\n      int specId,\n      InputFile toCopy,\n      Map<Integer, PartitionSpec> specsById,\n      EncryptedOutputFile outputFile,\n      long snapshotId,\n      SnapshotSummary.Builder summaryBuilder) {\n    // use metadata that will add the current snapshot's ID for the rewrite\n    // read first_row_id as null because this copies the incoming manifest before commit\n    InheritableMetadata inheritableMetadata = InheritableMetadataFactory.forCopy(snapshotId);\n    try (ManifestReader<DataFile> reader =\n        new ManifestReader<>(\n            toCopy, specId, specsById, inheritableMetadata, null, FileType.DATA_FILES)) {\n      return copyManifestInternal(","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/ManifestFiles.java#L406-L442","documentation":"ManifestFiles.open() dispatches on the manifest's content type and only handles DATA and DELETES manifests. Any other ManifestContent value (or null from a stale/older reader that does not know the type) falls through to this UnsupportedOperationException.","triggerScenarios":"Calling ManifestFiles.open(manifest, io, specsById) where manifest.content() is not DATA or DELETES — typically a manifest whose content enum was written by a newer spec version or whose content field is missing/unparseable.","commonSituations":"Reading manifests written by a newer Iceberg version introducing a new content type; reading manifest list entries where the content field was dropped by forward-compatibility rules (unknown enum values become null in older clients).","solutions":["Upgrade the Iceberg library to one that understands the manifest content type in the table","Verify the manifest list file was not produced/corrupted by external tooling","If integrating with custom code, map unknown content types explicitly instead of relying on the switch fallthrough"],"exampleFix":"// before\nManifestReader<?> reader = ManifestFiles.open(manifest, io, specsById);\n// after\nif (manifest.content() == null) {\n  throw new IllegalArgumentException(\"Unknown manifest content, upgrade iceberg to read: \" + manifest.location());\n}\nManifestReader<?> reader = ManifestFiles.open(manifest, io, specsById);","handlingStrategy":"validation","validationCode":"if (manifest.content() != ManifestContent.DATA && manifest.content() != ManifestContent.DELETES) {\n  throw new IllegalStateException(\"Unrecognized manifest content \" + manifest.content() + \"; upgrade iceberg\");\n}","typeGuard":"boolean isOpenable(ManifestFile m) { return m.content() == ManifestContent.DATA || m.content() == ManifestContent.DELETES; }","tryCatchPattern":"try {\n  reader = ManifestFiles.open(manifest, io, specsById);\n} catch (UnsupportedOperationException e) {\n  throw new IllegalStateException(\"Manifest content unknown to this client version: \" + manifest.location(), e);\n}","preventionTips":["Keep clients on versions that support the table's format version","Do not consume manifest lists with external tools that drop enum fields","Handle null content() defensively when reading forward-compatible data"],"tags":["unsupported-operation","enum","manifest-reader"],"backgroundTag":"unsupported-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}