{"record":{"id":"6c2d88a3cfd238a3","repo":"apache/seatunnel","slug":"unable-to-create-a-sink-for-identifier-multitable","errorCode":null,"errorMessage":"Unable to create a sink for identifier 'MultiTableSink'.","messagePattern":"Unable to create a sink for identifier 'MultiTableSink'\\.","errorType":"exception","errorClass":"FactoryException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/FactoryUtil.java","lineNumber":282,"sourceCode":"                            \"Unable to create a sink for identifier '%s'.\", factoryIdentifier),\n                    t);\n        }\n    }\n\n    public static <IN, StateT, CommitInfoT, AggregatedCommitInfoT>\n            SeaTunnelSink<IN, StateT, CommitInfoT, AggregatedCommitInfoT> createMultiTableSink(\n                    Map<TablePath, SeaTunnelSink> sinks,\n                    ReadonlyConfig options,\n                    ClassLoader classLoader) {\n        try {\n            TableSinkFactory<IN, StateT, CommitInfoT, AggregatedCommitInfoT> factory =\n                    new MultiTableSinkFactory();\n            MultiTableFactoryContext context =\n                    new MultiTableFactoryContext(options, classLoader, sinks);\n            ConfigValidator.of(context.getOptions()).validate(factory.optionRule());\n            return factory.createSink(context).createSink();\n        } catch (Throwable t) {\n            throw new FactoryException(\n                    \"Unable to create a sink for identifier 'MultiTableSink'.\", t);\n        }\n    }\n\n    public static Optional<Catalog> createOptionalCatalog(\n            String catalogName,\n            ReadonlyConfig readonlyConfig,\n            ClassLoader classLoader,\n            String factoryIdentifier) {\n        Optional<CatalogFactory> optionalFactory =\n                discoverOptionalFactory(classLoader, CatalogFactory.class, factoryIdentifier);\n\n        return optionalFactory.map(\n                catalogFactory -> {\n                    ConfigValidator.of(readonlyConfig).validate(catalogFactory.optionRule());\n                    return catalogFactory.createCatalog(catalogName, readonlyConfig);\n                });\n    }","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/FactoryUtil.java#L264-L300","documentation":"FactoryUtil.createMultiTableSink wraps any Throwable raised while creating the built-in MultiTableSink (used to write to multiple tables) in a FactoryException. The hard-coded identifier 'MultiTableSink' is always present, so failure is almost always inside the factory's option validation or createSink() call.","triggerScenarios":"Calling FactoryUtil.createMultiTableSink(options, classLoader, sinks) when ConfigValidator rejects the supplied options or the MultiTableSinkFactory.createSink() throws while wrapping the underlying sinks.","commonSituations":"Invalid multi-table sink options in the job config; underlying sink list contains misconfigured sinks; classloader issues in SeaTunnel Web/cluster deployments.","solutions":["Examine the wrapped cause for the exact option-validation or creation error.","Check the multi-table sink options against MultiTableSinkFactory's option rule.","Ensure the underlying sink instances passed in were created successfully."],"exampleFix":"// before\nMap<String, Object> opts = new HashMap<>(); // empty, fails validation\n// after\nMap<String, Object> opts = new HashMap<>();\nopts.put(\"multi_table_sink.fields_change\", \"EXCEPT\"); // options matching the option rule","handlingStrategy":"try-catch","validationCode":"ConfigValidator.of(options).validate(new MultiTableSinkFactory().optionRule()); // run before createMultiTableSink","typeGuard":null,"tryCatchPattern":"try {\n    sink = FactoryUtil.createMultiTableSink(options, classLoader, sinks);\n} catch (FactoryException e) {\n    LOG.error(\"MultiTableSink creation failed\", e.getCause());\n    throw e;\n}","preventionTips":["Run ConfigValidator with MultiTableSinkFactory.optionRule() before creating.","Ensure each underlying sink was already created successfully.","Use the application classloader that can see all connector classes."],"tags":["factory","multi-table-sink","wrapper"],"backgroundTag":"resource-not-found","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"}