{"record":{"id":"fed48b9818197f31","repo":"apache/iceberg","slug":"unknown-manifest-content","errorCode":null,"errorMessage":"Unknown manifest content: ","messagePattern":"Unknown manifest content: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/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/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java#L353-L389","documentation":"RewriteManifestsSparkAction.loadManifests switches on the snapshot's manifest content type (DATA or DELETES). Any other ManifestContent value falls into the default branch and throws IllegalArgumentException 'Unknown manifest content: '. This is a defensive check for manifest content types the Spark action does not recognize (e.g. a newer spec content type).","triggerScenarios":"Calling rewriteManifests(table) on a table whose snapshot contains manifests with a content type outside {DATA, DELETES} — practically only possible with tables written by a newer Iceberg/engine version introducing a new manifest content type.","commonSituations":"See trigger scenarios.","solutions":["Upgrade the Iceberg runtime (iceberg-spark-runtime) on the Spark cluster to a version that supports the manifest content type present in the snapshot.","Pin readers and writers to the same Iceberg version to avoid mixed-version tables.","Rewrite manifests against the table with a newer runtime, or choose a snapshot/rewrite scope that only includes DATA/DELETES manifests.","If seen with a stock release, file a bug with the printed content value — it indicates an unexpected enum."],"exampleFix":"// before\n<use iceberg-spark-runtime-3.5_2.13:1.4.0 against tables written by 1.6+ writers>\n// after\nUpgrade both driver and executors to iceberg-spark-runtime-3.5_2.13 matching the writer version.","handlingStrategy":"try-catch","validationCode":"// Verify all snapshots only use known manifest contents before rewriting\nboolean knownOnly = Arrays.stream(table.snapshots())\n    .allMatch(s -> s.allManifests(table.io()).stream()\n        .allMatch(m -> m.content() == ManifestContent.DATA || m.content() == ManifestContent.DELETES));","typeGuard":null,"tryCatchPattern":"try {\n  rewriteManifests.execute();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown manifest content\")) {\n    throw new IllegalStateException(\"Runtime too old for this table's manifests; upgrade iceberg-spark-runtime\", e);\n  } else throw e;\n}","preventionTips":["Keep the Iceberg runtime version on drivers and executors >= the version of any writer that touched the table.","Avoid mixed-version deployments where new engines write and old engines rewrite.","Pin table format and runtime versions in your deployment manifest."],"tags":["spark","rewrite-manifests","manifest-content","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"}