{"record":{"id":"3353d48e0b854d18","repo":"apache/iceberg","slug":"unknown-manifest-content-content-3353d4","errorCode":null,"errorMessage":"Unknown manifest content: {content}","messagePattern":"Unknown manifest content: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.1/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.1/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java#L353-L389","documentation":"RewriteManifests must load the manifests belonging to the snapshot being rewritten. Manifests are typed (DATA, DELETES, etc.); if ManifestContent is not one of the handled values, loadManifests throws IllegalArgumentException because the action cannot fetch the right manifest list.","triggerScenarios":"loadManifests called (from manifests) with a ManifestContent other than DATA or DELETES — possible when a newer spec adds a content type this Spark version doesn't know about.","commonSituations":"Reading a table written by a newer Iceberg version/engine that introduced a new manifest content type; version mismatch between the Spark runtime extension and the table's metadata.","solutions":["Upgrade the Iceberg Spark runtime to a version that understands the manifest content type in the table","Check that the table was not written by a newer Iceberg spec than the client supports","If implementing, extend the switch to handle the new ManifestContent value"],"exampleFix":"// before: switch handles only DATA/DELETES, throws on unknown\n// after: upgrade iceberg-spark-runtime jar to match the writer's Iceberg version\nlibraryDependencies += \"org.apache.iceberg\" % \"iceberg-spark-runtime-4.1_2.13\" % \"1.6.0\"","handlingStrategy":"validation","validationCode":"snapshot.allManifests(table.io()).forEach(m ->\n    Preconditions.checkArgument(\n        m.content() == ManifestContent.DATA || m.content() == ManifestContent.DELETES,\n        \"Unsupported manifest content: \" + m.content()));","typeGuard":"if (content != ManifestContent.DATA && content != ManifestContent.DELETES) { throw new IllegalArgumentException(\"Unsupported content, upgrade Iceberg: \" + content); }","tryCatchPattern":"try { action.execute(); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown manifest content\")) { /* upgrade iceberg runtime */ } }","preventionTips":["Keep the Iceberg Spark runtime version at or above the writer version","Check table format/composer versions before rewriting manifests","Pin cluster Iceberg versions consistently across writers and maintenance jobs"],"tags":["spark","iceberg","manifest","version-mismatch"],"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"}