{"record":{"id":"fd52a9ccd300ecf6","repo":"apache/iceberg","slug":"cannot-write-manifest-list-for-table-version-s","errorCode":null,"errorMessage":"Cannot write manifest list for table version: %s","messagePattern":"Cannot write manifest list for table version: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/ManifestLists.java","lineNumber":97,"sourceCode":"            manifestListFile, encryptionManager, snapshotId, parentSnapshotId, sequenceNumber);\n      case 3:\n        return new ManifestListWriter.V3Writer(\n            manifestListFile,\n            encryptionManager,\n            snapshotId,\n            parentSnapshotId,\n            sequenceNumber,\n            firstRowId);\n      case 4:\n        return new ManifestListWriter.V4Writer(\n            manifestListFile,\n            encryptionManager,\n            snapshotId,\n            parentSnapshotId,\n            sequenceNumber,\n            firstRowId);\n    }\n    throw new UnsupportedOperationException(\n        \"Cannot write manifest list for table version: \" + formatVersion);\n  }\n}\n","sourceCodeStart":79,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/ManifestLists.java#L79-L101","documentation":"Thrown when ManifestLists.write is asked to write a manifest list for a table format version that has no registered writer. The switch over formatVersion only covers implemented spec versions; anything else reaches the fall-through UnsupportedOperationException.","triggerScenarios":"Calling ManifestLists.write(formatVersion, ...) with a format version not supported by this Iceberg build (e.g., a newer spec version than the library supports, or an invalid value like 0 or a garbage int).","commonSituations":"A table written by a newer Iceberg/Spark runtime being processed by an older runtime; hand-rolled code passing a wrong version constant; custom catalogs forwarding spec versions from metadata not understood by the current client.","solutions":["Upgrade the Iceberg library to a version supporting the table's format version.","Check TableMetadata.formatVersion() to see which version the table actually uses.","Fix code that passes a hardcoded or invalid format-version constant (valid values start at 1).","Do not downgrade the client library below the spec version of the table."],"exampleFix":"// before\nManifestLists.write(unsupportedVersion, fileIO, path, spec, ...);\n// after\nint v = table.operations().current().formatVersion();\nif (v > MAX_SUPPORTED_FORMAT_VERSION) {\n  throw new IllegalStateException(\"Upgrade iceberg to write format-version \" + v);\n}\nManifestLists.write(v, fileIO, path, spec, ...);","handlingStrategy":"validation","validationCode":"int v = table.operations().current().formatVersion();\nif (v > SUPPORTED_MAX_FORMAT_VERSION) {\n  throw new IllegalStateException(\"Iceberg build supports up to format-version \" + SUPPORTED_MAX_FORMAT_VERSION + \", table is \" + v);\n}","typeGuard":"boolean supportedFormat(int formatVersion) {\n  return formatVersion >= 1 && formatVersion <= MAX_SUPPORTED_FORMAT_VERSION;\n}","tryCatchPattern":null,"preventionTips":["Keep all clients/runtimes on Iceberg versions supporting the table's format version","Never hardcode format-version constants; read from TableMetadata","Check release notes before pointing older engines at newer tables"],"tags":["format-version","unsupported","spec"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}