{"record":{"id":"75f8208c3c7193d8","repo":"apache/seatunnel","slug":"plugin-input-must-not-be-empty-when-configured","errorCode":null,"errorMessage":"plugin_input must not be empty when configured","messagePattern":"plugin_input must not be empty when configured","errorType":"validation","errorClass":"ConfigCheckException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigValidationUtils.java","lineNumber":404,"sourceCode":"                        sinks, ReadonlyConfig.fromConfig(sinkConfig), sinkClassLoader);\n            }\n        }\n    }\n\n    static ClassLoader getFactoryClassLoader(Factory factory, ClassLoader fallbackClassLoader) {\n        return factory == null ? fallbackClassLoader : factory.getClass().getClassLoader();\n    }\n\n    private static Optional<TableInfo> resolveInputTable(\n            Config pluginConfig, List<TableInfo> upstreamTables, String multiInputMessage) {\n        ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(pluginConfig);\n        if (!readonlyConfig.getOptional(PLUGIN_INPUT).isPresent()) {\n            return Optional.empty();\n        }\n\n        List<String> pluginInputIdentifiers = readonlyConfig.get(PLUGIN_INPUT);\n        if (pluginInputIdentifiers.isEmpty()) {\n            throw new ConfigCheckException(\"plugin_input must not be empty when configured\");\n        }\n        if (pluginInputIdentifiers.size() > 1) {\n            throw new ConfigCheckException(multiInputMessage);\n        }\n\n        String pluginInputIdentifier = pluginInputIdentifiers.get(0);\n        return Optional.of(\n                upstreamTables.stream()\n                        .filter(info -> pluginInputIdentifier.equals(info.getTableName()))\n                        .findFirst()\n                        .orElseThrow(\n                                () ->\n                                        new ConfigCheckException(\n                                                String.format(\n                                                        \"table %s not found\",\n                                                        pluginInputIdentifier))));\n    }\n","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigValidationUtils.java#L386-L422","documentation":"ConfigCheckException thrown by resolveInputTable in ConfigValidationUtils when the 'plugin_input' option is present in the job config but its value is an empty list. The library treats a configured-but-empty plugin_input as a config error rather than silently treating the sink/input as unfiltered, because an empty list is never a valid table identifier set.","triggerScenarios":"A job config contains `plugin_input = []` (empty array) for a source/sink supporting input-table resolution; resolveInputTable (via inputTable) reads PLUGIN_INPUT and finds it present but empty, throwing before any table resolution happens.","commonSituations":"Hand-edited HOCON/JSON configs where the table list was cleared but the key left behind; templated configs where a variable expanding to an empty list was substituted; tools generating configs that always emit the key.","solutions":["Remove the `plugin_input` key entirely if you do not want to filter tables","Populate `plugin_input` with at least one table identifier, e.g. `plugin_input = [\"my_db.my_table\"]`","Fix upstream config templating so the key is omitted when the value list is empty"],"exampleFix":"# before\nplugin_input = []\n# after\nplugin_input = [\"my_db.my_table\"]","handlingStrategy":"validation","validationCode":"List<String> inputs = config.getOptional(PLUGIN_INPUT).orElse(Collections.emptyList());\nif (!inputs.isEmpty() && inputs.size() != 1) {\n    throw new IllegalArgumentException(\"plugin_input must contain exactly one identifier\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolveInputTable(config);\n} catch (ConfigCheckException e) {\n    log.error(\"plugin_input misconfigured: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Omit plugin_input rather than setting it to an empty list in generated configs","Template configs should drop the key when no table filter is intended","Validate plugin_input length before job submission"],"tags":["config","validation","multi-table"],"backgroundTag":"empty-required-field","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"}