{"record":{"id":"f9437f4044578ad7","repo":"apache/seatunnel","slug":"unknown-metalakeclient-type","errorCode":null,"errorMessage":"Unknown MetalakeClient type: ","messagePattern":"Unknown MetalakeClient type: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metalake/MetaLakeFactory.java","lineNumber":49,"sourceCode":"    private static final Map<String, Supplier<MetaLakeTableSchemaConvertor>> MAPPER_REGISTRY =\n            new HashMap<>();\n\n    static {\n        register(MetaLakeType.GRAVITINO.getType());\n    }\n\n    private MetaLakeFactory() {}\n\n    public static void register(String type) {\n        CLIENT_REGISTRY.put(type.toLowerCase(), GravitinoClient::new);\n        MAPPER_REGISTRY.put(type.toLowerCase(), GravitinoTableSchemaConvertor::new);\n    }\n\n    public static MetalakeClient createClient(MetaLakeType metaLakeType) {\n        String type = metaLakeType.name().toLowerCase();\n        Supplier<MetalakeClient> constructor = CLIENT_REGISTRY.get(type.toLowerCase());\n        if (constructor == null) {\n            throw new IllegalArgumentException(\"Unknown MetalakeClient type: \" + type);\n        }\n        return constructor.get();\n    }\n\n    public static MetaLakeTableSchemaConvertor createTypeMapper(MetaLakeType metaLakeType) {\n        String type = metaLakeType.name().toLowerCase();\n        Supplier<MetaLakeTableSchemaConvertor> constructor =\n                MAPPER_REGISTRY.get(type.toLowerCase());\n        if (constructor == null) {\n            throw new IllegalArgumentException(\"Unknown MetaLakeTypeMapper type: \" + type);\n        }\n        return constructor.get();\n    }\n}\n","sourceCodeStart":31,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metalake/MetaLakeFactory.java#L31-L64","documentation":"IllegalArgumentException thrown by MetaLakeFactory.createClient when the given MetaLakeType has no registered constructor in CLIENT_REGISTRY. Since metaLakeType is an enum, this indicates the enum value's lowercase name is not present in the registry (registry/enum mismatch, e.g. after adding a new enum value without registering it).","triggerScenarios":"Calling createClient(MetaLakeType.X) where X.name().toLowerCase() is not a key in CLIENT_REGISTRY — typically a newly added MetaLakeType missing its registry entry, or a registry key typo.","commonSituations":"Upgrading SeaTunnel where a new metalake type was added but the factory registry was not updated; plugin/classpath mismatch loading an older MetaLakeFactory; custom enum values contributed by extensions.","solutions":["Check CLIENT_REGISTRY in MetaLakeFactory and register a Supplier for the missing type.","Ensure the enum value name (lowercased) exactly matches the registry key string.","Rebuild/redeploy so the MetaLakeFactory version matches the MetaLakeType version on the classpath.","Add a unit test iterating all MetaLakeType values against createClient to catch drift."],"exampleFix":"// before\nprivate static final Map<String, Supplier<MetalakeClient>> CLIENT_REGISTRY =\n        Map.of(\"gravitino\", GravitinoClient::new);\n// after\nprivate static final Map<String, Supplier<MetalakeClient>> CLIENT_REGISTRY =\n        Map.of(\"gravitino\", GravitinoClient::new, \"newtype\", NewTypeClient::new);","handlingStrategy":"validation","validationCode":"// registry-coverage test\ntest void allTypesHaveClients() {\n    for (MetaLakeType t : MetaLakeType.values()) {\n        assertNotNull(MetaLakeFactory.createClient(t));\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    return MetaLakeFactory.createClient(type);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Metalake type \" + type + \" not registered in CLIENT_REGISTRY; upgrade mismatch?\", e);\n}","preventionTips":["Register every new MetaLakeType in CLIENT_REGISTRY at the same time the enum value is added.","Keep MetaLakeType and MetaLakeFactory in the same module/version.","Add an exhaustive unit test over enum values."],"tags":["enum","registry","gravitino","configuration"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}