{"record":{"id":"54b3caf36ff444a2","repo":"apache/iceberg","slug":"unknown-manifest-content-content","errorCode":null,"errorMessage":"Unknown manifest content: ${content}","messagePattern":"Unknown manifest content: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java","lineNumber":371,"sourceCode":"    if (currentSnapshot == null) {\n      return ImmutableList.of();\n    }\n\n    List<ManifestFile> manifests = loadManifests(content, currentSnapshot);\n\n    return manifests.stream()\n        .filter(manifest -> manifest.partitionSpecId() == spec.specId() && predicate.test(manifest))\n        .collect(Collectors.toList());\n  }\n\n  private List<ManifestFile> loadManifests(ManifestContent content, Snapshot snapshot) {\n    switch (content) {\n      case DATA:\n        return snapshot.dataManifests(table.io());\n      case DELETES:\n        return snapshot.deleteManifests(table.io());\n      default:\n        throw new IllegalArgumentException(\"Unknown manifest content: \" + content);\n    }\n  }\n\n  private int targetNumManifests(long totalSizeBytes) {\n    return (int) ((totalSizeBytes + targetManifestSizeBytes - 1) / targetManifestSizeBytes);\n  }\n\n  private long totalSizeBytes(Iterable<ManifestFile> manifests) {\n    long totalSizeBytes = 0L;\n\n    for (ManifestFile manifest : manifests) {\n      ValidationException.check(\n          hasFileCounts(manifest), \"No file counts in manifest: %s\", manifest.path());\n      totalSizeBytes += manifest.length();\n    }\n\n    return totalSizeBytes;\n  }","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java#L353-L389","documentation":"RewriteManifestsSparkAction.loadManifests dispatches on the manifest content type and only handles DATA and DELETES manifests. Any other ManifestContent value (or a future/unknown enum value) reaches the default branch and throws IllegalArgumentException. This is a defensive guard since Iceberg manifests should only ever be data or deletes today.","triggerScenarios":"Calling RewriteManifestsSparkAction on a table whose snapshot returns a manifest with an unexpected content type — e.g. running against a table written by a newer Iceberg spec version that introduced a new manifest content type, or a corrupted/foreign manifest list.","commonSituations":"Upgrading/downgrading Iceberg versions across clusters where one version wrote manifest content types the other doesn't know; manually patched or third-party-written metadata pointing at unrecognized manifests.","solutions":["Upgrade the Spark Iceberg runtime to a version that recognizes the manifest content type present in the table","Check the table's format version and manifests with Snapshots#allManifests to identify the unexpected content","If caused by mixed-version writers, ensure all jobs use the same Iceberg runtime version","Report the unrecognized content type if it comes from a supported spec version"],"exampleFix":"// before: running rewrite with old runtime on table with new manifest content\nSparkActions.get(table).rewriteManifests().execute();\n// after: align runtime version with writer version\n// update spark-runtime jar to match the Iceberg version that wrote the manifests","handlingStrategy":"validation","validationCode":"// before running rewrite\nTable table = ...;\ntable.snapshots().forEach(s -> s.allManifests(table.io()).forEach(m -> {\n  if (m.content() != ManifestContent.DATA && m.content() != ManifestContent.DELETES) {\n    throw new IllegalStateException(\"Unexpected manifest content: \" + m.content());\n  }\n}));","typeGuard":"if (content != ManifestContent.DATA && content != ManifestContent.DELETES) { return; }","tryCatchPattern":"try { actions.rewriteManifests().execute(); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Unknown manifest content\")) { /* upgrade runtime */ } else { throw e; } }","preventionTips":["Keep Iceberg runtime versions consistent across all writer and maintenance jobs","Upgrade runtimes before adopting tables written by newer Iceberg versions","Inspect manifest content types when ingesting externally written tables"],"tags":["spark","manifests","action","forward-compatibility"],"backgroundTag":"invalid-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"}