{"record":{"id":"8b93082b9e23ce6a","repo":"apache/pulsar","slug":"need-to-specify-a-configuration-file-for-broker-8b9308","errorCode":null,"errorMessage":"Need to specify a configuration file for broker","messagePattern":"Need to specify a configuration file for broker","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java","lineNumber":167,"sourceCode":"        CommandLine commander = new CommandLine(arguments);\n        commander.setCommandName(\"PulsarTopicCompactor\");\n        commander.parseArgs(args);\n        if (arguments.help) {\n            commander.usage(commander.getOut());\n            System.exit(0);\n        }\n\n        if (arguments.generateDocs) {\n            CmdGenerateDocs cmd = new CmdGenerateDocs(\"pulsar\");\n            cmd.addCommand(\"compact-topic\", arguments);\n            cmd.run(null);\n            System.exit(0);\n        }\n\n        // init broker config\n        if (isBlank(arguments.brokerConfigFile)) {\n            commander.usage(commander.getOut());\n            throw new IllegalArgumentException(\"Need to specify a configuration file for broker\");\n        }\n\n        final String filepath = Path.of(arguments.brokerConfigFile).toAbsolutePath().normalize().toString();\n        log.info(String.format(\"read configuration file %s\", filepath));\n        final ServiceConfiguration brokerConfig =\n                PulsarConfigurationLoader.create(filepath, ServiceConfiguration.class);\n\n        if (isBlank(brokerConfig.getMetadataStoreUrl())) {\n            final String message = String.format(\"\"\"\n                    Need to specify `metadataStoreUrl` or `zookeeperServers` in configuration file\n                    or specify configuration file path from command line.\n                    now configuration file path is=[%s]\n                    \"\"\", filepath);\n            throw new IllegalArgumentException(message);\n        }\n\n        @Cleanup(value = \"shutdownNow\")\n        ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java#L149-L185","documentation":"CLI bootstrap guard in CompactorTool.main: the --broker-config option was blank, and because the compactor tool runs embedded broker components it requires a valid broker.conf path to initialize; usage is printed and the tool exits instead of proceeding with no configuration.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass -c/--broker-config pointing to a valid broker.conf"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}