{"record":{"id":"611c7a874f4d814a","repo":"apache/pulsar","slug":"discovery-triggerer-not-specified","errorCode":null,"errorMessage":"Discovery Triggerer not specified","messagePattern":"Discovery Triggerer not specified","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java","lineNumber":550,"sourceCode":"            if (!Utils.isFunctionPackageUrlSupported(sourceConfig.getArchive())\n                    && !sourceConfig.getArchive().startsWith(Utils.BUILTIN)) {\n                if (!new File(sourceConfig.getArchive()).exists()) {\n                    throw new IllegalArgumentException(String.format(\"Source Archive %s does not exist\",\n                            sourceConfig.getArchive()));\n                }\n            }\n            if (isBlank(sourceConfig.getName())) {\n                throw new IllegalArgumentException(\"Source name not specified\");\n            }\n\n            if (sourceConfig.getBatchSourceConfig() != null) {\n                validateBatchSourceConfigs(sourceConfig.getBatchSourceConfig());\n            }\n        }\n\n        protected void validateBatchSourceConfigs(BatchSourceConfig batchSourceConfig) {\n            if (isBlank(batchSourceConfig.getDiscoveryTriggererClassName())) {\n                throw new IllegalArgumentException(\"Discovery Triggerer not specified\");\n            }\n        }\n\n        protected String validateSourceType(String sourceType) throws IOException {\n            Set<String> availableSources;\n            try {\n                availableSources = getAdmin().sources().getBuiltInSources().stream()\n                        .map(ConnectorDefinition::getName).collect(Collectors.toSet());\n            } catch (PulsarAdminException e) {\n                throw new IOException(e);\n            }\n\n            if (!availableSources.contains(sourceType)) {\n                throw new ParameterException(\n                        \"Invalid source type '\" + sourceType + \"' -- Available sources are: \" + availableSources);\n            }\n\n            // Source type is a valid built-in connector type","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java#L532-L568","documentation":"Thrown by validateBatchSourceConfigs when a SourceConfig includes a BatchSourceConfig whose discoveryTriggererClassName is blank. A Pulsar batch source needs a DiscoveryTriggerer class that discovers which batches to process; without it the batch source cannot be scheduled. The CLI rejects the config before submitting it.","triggerScenarios":"Creating/updating a source with --batch-source-config (or a config file containing batchSourceConfig) where the discoveryTriggererClassName field is empty or missing.","commonSituations":"Hand-writing the batch source config JSON and omitting discoveryTriggererClassName, copying a template with the field left blank, or setting batchSourceConfig on a regular (non-batch) source by mistake.","solutions":["Set discoveryTriggererClassName in the batch source config to a class implementing DiscoveryTriggerer available on the archive's classpath","Remove the batchSourceConfig block if the source is not intended to be a batch source","Verify the class name spelling and package"],"exampleFix":"// before\n{\"batchSourceConfig\": {\"discoveryTriggererClassName\": \"\"}}\n// after\n{\"batchSourceConfig\": {\"discoveryTriggererClassName\": \"org.example.MyDiscoveryTriggerer\"}}","handlingStrategy":"validation","validationCode":"if (sourceConfig.getBatchSourceConfig() != null\n        && (sourceConfig.getBatchSourceConfig().getDiscoveryTriggererClassName() == null\n            || sourceConfig.getBatchSourceConfig().getDiscoveryTriggererClassName().isBlank())) {\n    throw new IllegalArgumentException(\"batchSourceConfig requires discoveryTriggererClassName\");\n}","typeGuard":"boolean hasDiscoveryTriggerer(BatchSourceConfig cfg) {\n    return cfg != null && cfg.getDiscoveryTriggererClassName() != null\n        && !cfg.getDiscoveryTriggererClassName().trim().isEmpty();\n}","tryCatchPattern":"try {\n    admin.sources().createSource(sourceConfig);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"Batch source config incomplete: \" + e.getMessage());\n}","preventionTips":["Only set batchSourceConfig when intentionally creating a batch source","Keep a template batch config with discoveryTriggererClassName filled","Verify the triggerer class exists in the archive"],"tags":["pulsar-admin","cli","batch-source","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}