{"record":{"id":"db90d24772be2ca5","repo":"apache/pulsar","slug":"no-configuration-file-for-bookie","errorCode":null,"errorMessage":"No configuration file for Bookie","messagePattern":"No configuration file for Bookie","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java","lineNumber":228,"sourceCode":"                                              (exitCode) -> {\n                                                  log.info()\n                                                          .attr(\"exitCode\", exitCode)\n                                                          .log(\"Halting broker process\");\n                                                  ShutdownUtil.triggerImmediateForcefulShutdown(exitCode);\n                                              });\n\n            // if no argument to run bookie in cmd line, read from pulsar config\n            if (!starterArguments.runBookie) {\n                starterArguments.runBookie = brokerConfig.isEnableRunBookieTogether();\n            }\n            if (!starterArguments.runBookieAutoRecovery) {\n                starterArguments.runBookieAutoRecovery = brokerConfig.isEnableRunBookieAutoRecoveryTogether();\n            }\n\n            if ((starterArguments.runBookie || starterArguments.runBookieAutoRecovery)\n                    && isBlank(starterArguments.bookieConfigFile)) {\n                commander.usage(commander.getOut());\n                throw new IllegalArgumentException(\"No configuration file for Bookie\");\n            }\n\n            // init stats provider\n            if (starterArguments.runBookie || starterArguments.runBookieAutoRecovery) {\n                checkState(isNotBlank(starterArguments.bookieConfigFile),\n                    \"No configuration file for Bookie\");\n                final String filepath = Path.of(starterArguments.bookieConfigFile)\n                        .toAbsolutePath().normalize().toString();\n                bookieConfig = readBookieConfFile(filepath);\n                Class<? extends StatsProvider> statsProviderClass = bookieConfig.getStatsProviderClass();\n                bookieStatsProvider = ReflectionUtils.newInstance(statsProviderClass);\n            } else {\n                bookieConfig = null;\n                bookieStatsProvider = null;\n            }\n\n            // init bookie server\n            if (starterArguments.runBookie) {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java#L210-L246","documentation":"When the broker is launched with runBookie or runBookieAutoRecovery enabled (via flags or broker.conf's enableRunBookieTogether/enableRunBookieAutoRecoveryTogether), a Bookie configuration file is mandatory. If starterArguments.bookieConfigFile is blank, the usage is printed and this IllegalArgumentException is thrown.","triggerScenarios":"Starting 'pulsar broker' with --run-bookie or --run-bookie-auto-recovery (or broker config enabling co-run) but without --bookie-config/-bc.","commonSituations":"Enabling enableRunBookieAutoRecoveryTogether=true in broker.conf while the deployment script never passes a bookie config; migrating a single-process setup and forgetting the bookie args.","solutions":["Pass --bookie-config /path/to/bookie.conf (and/or --bookiehosts) when running bookie/auto-recovery with the broker","Or disable enableRunBookieTogether / enableRunBookieAutoRecoveryTogether in broker.conf and run bookies as separate processes","Provide a valid BookKeeper metadata-service configuration in the bookie config file"],"exampleFix":"// before\n./pulsar broker --run-bookie\n// after\n./pulsar broker --run-bookie --bookie-config conf/bookie.conf","handlingStrategy":"validation","validationCode":"boolean runBk = args.runBookie || args.runBookieAutoRecovery\n    || brokerConf.isEnableRunBookieTogether() || brokerConf.isEnableRunBookieAutoRecoveryTogether();\nif (runBk && (args.bookieConfigFile == null || args.bookieConfigFile.isBlank())) {\n    throw new IllegalArgumentException(\"--bookie-config required when running bookie/auto-recovery\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    int rc = starter.call();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"No configuration file for Bookie\")) {\n        commander.usage(commander.getOut());\n        System.exit(2);\n    }\n    throw e;\n}","preventionTips":["When enabling enableRunBookie(AutoRecovery)Together in broker.conf, update launch scripts to pass --bookie-config","Prefer running bookies as separate services if you don't manage bookie config with the broker"],"tags":["configuration","startup","cli"],"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"}