apache/pulsar · error · IllegalArgumentException
Need to specify `metadataStoreUrl` or `zookeeperServers` in
Error message
Need to specify `metadataStoreUrl` or `zookeeperServers` in configuration file or specify configuration file path from command line. now configuration file path is=[%s]
What it means
Error "Need to specify `metadataStoreUrl` or `zookeeperServers` in configuration file or specify configuration file path from command line. now configuration file path is=[%s] " thrown in apache/pulsar.
Source
Thrown at pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java:181
// init broker config
if (isBlank(arguments.brokerConfigFile)) {
commander.usage(commander.getOut());
throw new IllegalArgumentException("Need to specify a configuration file for broker");
}
final String filepath = Path.of(arguments.brokerConfigFile).toAbsolutePath().normalize().toString();
log.info(String.format("read configuration file %s", filepath));
final ServiceConfiguration brokerConfig =
PulsarConfigurationLoader.create(filepath, ServiceConfiguration.class);
if (isBlank(brokerConfig.getMetadataStoreUrl())) {
final String message = String.format("""
Need to specify `metadataStoreUrl` or `zookeeperServers` in configuration file
or specify configuration file path from command line.
now configuration file path is=[%s]
""", filepath);
throw new IllegalArgumentException(message);
}
@Cleanup(value = "shutdownNow")
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(
new ThreadFactoryBuilder().setNameFormat("compaction-%d").setDaemon(true).build());
@Cleanup
MetadataStoreExtended store = MetadataStoreExtended.create(brokerConfig.getMetadataStoreUrl(),
MetadataStoreConfig.builder()
.sessionTimeoutMillis((int) brokerConfig.getMetadataStoreSessionTimeoutMillis())
.metadataStoreName(MetadataStoreConfig.METADATA_STORE)
.build());
@Cleanup
BookKeeperClientFactory bkClientFactory = new BookKeeperClientFactoryImpl();
@Cleanup(value = "shutdownGracefully")
EventLoopGroup eventLoopGroup = EventLoopUtil.newEventLoopGroup(1, false,View on GitHub (pinned to 820761864e)
Solutions
- Set metadataStoreUrl or zookeeperServers in the broker configuration file
- Pass the correct config file path via the command line option
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java:181 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/4316b45bdaaec75e.
Report an issue: GitHub.