{"record":{"id":"174ea636bb77f519","repo":"apache/iceberg","slug":"unsupported-content-type-for-manifests","errorCode":null,"errorMessage":"Unsupported content type for manifests: ","messagePattern":"Unsupported content type for manifests: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java","lineNumber":451,"sourceCode":"    public long length() {\n      return file.fileSizeInBytes();\n    }\n\n    @Override\n    public int partitionSpecId() {\n      throw new UnsupportedOperationException(\n          \"v4 manifests are not bound to a single partition spec\");\n    }\n\n    @Override\n    public ManifestContent content() {\n      switch (file.contentType()) {\n        case DATA_MANIFEST:\n          return ManifestContent.DATA;\n        case DELETE_MANIFEST:\n          return ManifestContent.DELETES;\n        default:\n          throw new UnsupportedOperationException(\n              \"Unsupported content type for manifests: \" + file.contentType());\n      }\n    }\n\n    @Override\n    public long sequenceNumber() {\n      return file.tracking().dataSequenceNumber();\n    }\n\n    @Override\n    public long minSequenceNumber() {\n      return file.manifestInfo().minSequenceNumber();\n    }\n\n    @Override\n    public Long snapshotId() {\n      return file.tracking().snapshotId();\n    }","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java#L433-L469","documentation":"The legacy ManifestFile adapter maps a v4 manifest's contentType() enum to the two-value ManifestContent (DATA/DELETES). The switch is exhaustive over the known kinds; a default branch throws UnsupportedOperationException in case a future or unexpected content type appears, signaling a spec version the current code doesn't understand.","triggerScenarios":"Calling content() on the v4 ManifestFileAdapter when file.contentType() returns a value other than DATA_MANIFEST or DELETE_MANIFEST — e.g. a newly introduced manifest content type from a newer spec, or corrupted/unknown enum value read from the manifest.","commonSituations":"Reading manifests written by a newer Iceberg release that defines additional manifest content types; forward-compatibility failures where an older reader processes newer metadata; corrupted manifest metadata bytes decoding to an unknown enum.","solutions":["Upgrade Iceberg to a version whose ManifestContent/manifest enums cover the new content type","Re-write the manifests with a compatible writer version (e.g. via rewrite_manifests) to use known types","Filter out manifests with unrecognized content types before adapting if your workload can skip them","Inspect the table's metadata/format version to confirm which writer produced the manifests"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"boolean knownContentType(ManifestFile mf) {\n  return mf.contentType() == FileContent.DATA_MANIFEST\n      || mf.contentType() == FileContent.DELETE_MANIFEST;\n}","typeGuard":null,"tryCatchPattern":"try { content = adapter.content(); }\ncatch (UnsupportedOperationException e) {\n  LOG.warn(\"Unknown manifest content type {} from newer writer; skipping\", e.getMessage());\n}","preventionTips":["Keep reader Iceberg version >= writer version across clusters","Before downgrading Iceberg, rewrite manifests with the older writer","Validate manifest content types when listing manifests and skip unknown ones when safe","Watch Iceberg spec announcements for new manifest content types"],"tags":["manifest","content-type","forward-compatibility","iceberg"],"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-14T11:17:12.474Z"}