apache/iceberg · error · IllegalArgumentException

Unknown manifest content: {content}

Error message

Unknown manifest content: {content}

What it means

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.

Source

Thrown at spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java:371

    if (currentSnapshot == null) {
      return ImmutableList.of();
    }

    List<ManifestFile> manifests = loadManifests(content, currentSnapshot);

    return manifests.stream()
        .filter(manifest -> manifest.partitionSpecId() == spec.specId() && predicate.test(manifest))
        .collect(Collectors.toList());
  }

  private List<ManifestFile> loadManifests(ManifestContent content, Snapshot snapshot) {
    switch (content) {
      case DATA:
        return snapshot.dataManifests(table.io());
      case DELETES:
        return snapshot.deleteManifests(table.io());
      default:
        throw new IllegalArgumentException("Unknown manifest content: " + content);
    }
  }

  private int targetNumManifests(long totalSizeBytes) {
    return (int) ((totalSizeBytes + targetManifestSizeBytes - 1) / targetManifestSizeBytes);
  }

  private long totalSizeBytes(Iterable<ManifestFile> manifests) {
    long totalSizeBytes = 0L;

    for (ManifestFile manifest : manifests) {
      ValidationException.check(
          hasFileCounts(manifest), "No file counts in manifest: %s", manifest.path());
      totalSizeBytes += manifest.length();
    }

    return totalSizeBytes;
  }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Upgrade the Iceberg Spark runtime to a version that understands the manifest content type in the table
  2. Check that the table was not written by a newer Iceberg spec than the client supports
  3. If implementing, extend the switch to handle the new ManifestContent value

Example fix

// before: switch handles only DATA/DELETES, throws on unknown
// after: upgrade iceberg-spark-runtime jar to match the writer's Iceberg version
libraryDependencies += "org.apache.iceberg" % "iceberg-spark-runtime-4.1_2.13" % "1.6.0"
Defensive patterns

Strategy: validation

Validate before calling

snapshot.allManifests(table.io()).forEach(m ->
    Preconditions.checkArgument(
        m.content() == ManifestContent.DATA || m.content() == ManifestContent.DELETES,
        "Unsupported manifest content: " + m.content()));

Type guard

if (content != ManifestContent.DATA && content != ManifestContent.DELETES) { throw new IllegalArgumentException("Unsupported content, upgrade Iceberg: " + content); }

Try / catch

try { action.execute(); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unknown manifest content")) { /* upgrade iceberg runtime */ } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/3353d48e0b854d18. Report an issue: GitHub.