{"record":{"id":"d67fac26361a8587","repo":"apache/seatunnel","slug":"seatunnelapierrorcode-config-validation-failed-d67fac","errorCode":"SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED","errorMessage":"Single-table Pulsar source must configure 'subscription.name'.","messagePattern":"Single-table Pulsar source must configure 'subscription\\.name'\\.","errorType":"error_code","errorClass":"PulsarConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSourceFactory.java","lineNumber":115,"sourceCode":"    @Override\n    public <T, SplitT extends SourceSplit, StateT extends Serializable>\n            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {\n        validateSourceOptions(context.getOptions());\n        CatalogTable catalogTable;\n        if (context.getOptions().getOptional(PulsarSourceOptions.SCHEMA).isPresent()) {\n            catalogTable = CatalogTableUtil.buildWithConfig(context.getOptions());\n        } else {\n            catalogTable = CatalogTableUtil.buildSimpleTextTable();\n        }\n        return () ->\n                (SeaTunnelSource<T, SplitT, StateT>)\n                        new PulsarSource(context.getOptions(), catalogTable);\n    }\n\n    private void validateSourceOptions(ReadonlyConfig config) {\n        if (!config.getOptional(TableSchemaOptions.TABLE_CONFIGS).isPresent()\n                && !config.getOptional(PulsarSourceOptions.SUBSCRIPTION_NAME).isPresent()) {\n            throw new PulsarConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"Single-table Pulsar source must configure '%s'.\",\n                            PulsarSourceOptions.SUBSCRIPTION_NAME.key()));\n        }\n    }\n}\n","sourceCodeStart":97,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSourceFactory.java#L97-L123","documentation":"PulsarSourceFactory.validateSourceOptions enforces that a single-table Pulsar source (no multi-table 'table_configs' present) always declares a subscription name ('subscription.name'). Pulsar consumers need a subscription to track cursors, so without it the source cannot be built and this CONFIG_VALIDATION_FAILED error is thrown.","triggerScenarios":"Creating a Pulsar source via the factory without 'table_configs' AND without PulsarSourceOptions.SUBSCRIPTION_NAME configured — i.e. a single-table config missing 'subscription.name'.","commonSituations":"Users migrating from older SeaTunnel versions where the option key was different (older configs used 'consumer-group' style keys) or simply forgetting that Pulsar, unlike Kafka, requires an explicit subscription name.","solutions":["Add 'subscription.name = \"my-subscription\"' to the Pulsar source options.","If you intended multi-table mode, configure 'table_configs' instead and give each table its subscription.","Check for renamed/legacy option keys in old configs and update to the current 'subscription.name' key.","Also verify the subscription exists (or set subscription-level options like initial position) on the Pulsar side."],"exampleFix":"// before\nPulsar {\n  service.url = \"pulsar://localhost:6650\"\n  topic = \"persistent://public/default/my-topic\"\n}\n// after\nPulsar {\n  service.url = \"pulsar://localhost:6650\"\n  topic = \"persistent://public/default/my-topic\"\n  subscription.name = \"seatunnel-sub\"\n}","handlingStrategy":"validation","validationCode":"boolean multiTable = cfg.getOptional(\"table_configs\").isPresent();\nif (!multiTable && cfg.getOptional(\"subscription.name\").isEmpty())\n    throw new IllegalArgumentException(\"single-table Pulsar source needs 'subscription.name'\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat subscription.name as mandatory for single-table Pulsar sources.","Migrate legacy consumer-group style keys to subscription.name.","Validate config templates against the current connector option keys after upgrades."],"tags":["pulsar","config-validation","subscription","factory"],"backgroundTag":"missing-required-config-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"}