{"record":{"id":"87874af77d00a3ec","repo":"apache/iceberg","slug":"unknown-metadata-table-type-s-for-s","errorCode":null,"errorMessage":"Unknown metadata table type: %s for %s","messagePattern":"Unknown metadata table type: (.+?) for (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/MetadataTableUtils.java","lineNumber":92,"sourceCode":"        return new RefsTable(baseTable, metadataTableName);\n      case MANIFESTS:\n        return new ManifestsTable(baseTable, metadataTableName);\n      case PARTITIONS:\n        return new PartitionsTable(baseTable, metadataTableName);\n      case ALL_DATA_FILES:\n        return new AllDataFilesTable(baseTable, metadataTableName);\n      case ALL_DELETE_FILES:\n        return new AllDeleteFilesTable(baseTable, metadataTableName);\n      case ALL_FILES:\n        return new AllFilesTable(baseTable, metadataTableName);\n      case ALL_MANIFESTS:\n        return new AllManifestsTable(baseTable, metadataTableName);\n      case ALL_ENTRIES:\n        return new AllEntriesTable(baseTable, metadataTableName);\n      case POSITION_DELETES:\n        return new PositionDeletesTable(baseTable, metadataTableName);\n      default:\n        throw new NoSuchTableException(\n            \"Unknown metadata table type: %s for %s\", type, metadataTableName);\n    }\n  }\n\n  public static Table createMetadataTableInstance(\n      TableOperations ops,\n      String catalogName,\n      TableIdentifier baseTableIdentifier,\n      TableIdentifier metadataTableIdentifier,\n      MetadataTableType type) {\n    String baseTableName = BaseMetastoreCatalog.fullTableName(catalogName, baseTableIdentifier);\n    String metadataTableName =\n        BaseMetastoreCatalog.fullTableName(catalogName, metadataTableIdentifier);\n    return createMetadataTableInstance(ops, baseTableName, metadataTableName, type);\n  }\n\n  private static String metadataTableName(String tableName, MetadataTableType type) {\n    return tableName + (tableName.contains(\"/\") ? \"#\" : \".\") + type.name().toLowerCase(Locale.ROOT);","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/MetadataTableUtils.java#L74-L110","documentation":"NoSuchTableException thrown when the requested metadata table type is not recognized in the switch over MetadataTableType. The metadata table name parsed to a type that has no corresponding implementation table, so instance creation fails. This typically results from a version mismatch or an invalid/unknown metadata table name suffix.","triggerScenarios":"Calling createMetadataTableInstance(ops, name, metadataTableName, type) with a MetadataTableType that has no case (e.g., a newly added type used against an older Iceberg runtime), or constructing a metadata table name with an unrecognized suffix.","commonSituations":"Mixing Iceberg versions (engine runtime older than the catalog/client that referenced a new metadata table type); typo in metadata table name like 'tbl.filess'; custom tooling emitting unsupported type identifiers.","solutions":["Upgrade the Iceberg runtime to a version that supports the requested metadata table type.","Check the metadata table name suffix against supported types (snapshots, files, history, refs, manifests, all_*, entries, position_deletes, partitions, metadata_log_entries).","Catch NoSuchTableException and fall back to a supported metadata table type.","Regenerate/fix tooling that constructs metadata table names programmatically."],"exampleFix":"// before\nTable t = MetadataTableUtils.createMetadataTableInstance(ops, \"db.tbl\", \"db.tbl.filess\", type); // NoSuchTableException\n// after\nTable t = MetadataTableUtils.createMetadataTableInstance(ops, \"db.tbl\", \"db.tbl.files\", MetadataTableType.FILES);","handlingStrategy":"validation","validationCode":"// ensure the type is a known MetadataTableType and name matches\nString name = tableName + \".\" + type.displayName();","typeGuard":null,"tryCatchPattern":"try {\n  Table meta = MetadataTableUtils.createMetadataTableInstance(ops, baseName, metaName, type);\n} catch (NoSuchTableException e) {\n  // fall back to a supported metadata table type or upgrade runtime\n}","preventionTips":["Keep Iceberg runtime versions aligned across catalog/client/engine","Validate metadata table name suffixes against supported types","Catch NoSuchTableException when probing metadata table names"],"tags":["metadata-table","unknown-type","no-such-table","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-23T08:17:48.524Z"}