{"record":{"id":"3c66627300b505c7","repo":"apache/pulsar","slug":"must-pass-one-of-the-params-bundle","errorCode":null,"errorMessage":"Must pass one of the params: --bundle ","messagePattern":"Must pass one of the params: --bundle ","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java","lineNumber":978,"sourceCode":"\n        @Option(\n                names = { \"--bundle\", \"-b\" },\n                description = \"{start-boundary}_{end-boundary} format namespace bundle\",\n                required = false)\n        private String bundle;\n\n        @Option(\n                names = { \"--topic-list\",  \"-tl\" },\n                description = \"The list of topics(both non-partitioned topic and partitioned topic) to get positions \"\n                        + \"in this bundle, if none topic provided, will get the positions of all topics in this bundle\",\n                required = false)\n        private List<String> topics;\n\n        @Override\n        void run() throws PulsarAdminException {\n            String namespace = validateNamespace(namespaceName);\n            if (StringUtils.isBlank(bundle)) {\n                throw new ParameterException(\"Must pass one of the params: --bundle \");\n            }\n            print(getAdmin().namespaces().getTopicHashPositions(namespace, bundle, topics));\n        }\n    }\n\n    @Command(description = \"Set message-dispatch-rate for all topics of the namespace\")\n    private class SetDispatchRate extends CliCommand {\n        @Parameters(description = \"tenant/namespace\", arity = \"1\")\n        private String namespaceName;\n\n        @Option(names = { \"--msg-dispatch-rate\",\n                \"-md\" }, description = \"message-dispatch-rate \"\n                + \"(default -1 will be overwrite if not passed)\", required = false)\n        private int msgDispatchRate = -1;\n\n        @Option(names = { \"--byte-dispatch-rate\",\n                \"-bd\" }, description = \"byte-dispatch-rate \"\n                + \"(default -1 will be overwrite if not passed)\", required = false)","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java#L960-L996","documentation":"The getTopicHashPositions command (topic hash-position lookup on a namespace bundle) needs the specific bundle whose hash positions you want. With a blank --bundle the CLI cannot proceed and throws this ParameterException.","triggerScenarios":"Running `pulsar-admin namespaces get-topic-hash-positions <namespace>` (or any invocation of this command's run()) with bundle blank/whitespace: StringUtils.isBlank(bundle) is true.","commonSituations":"Users omitting --bundle because the optional --topics list was the visible parameter; tooling that interpolates an empty bundle variable when the bundle wasn't discovered first.","solutions":["Pass --bundle <bundle-range>, e.g. --bundle '0x00000000_0xffffffff'","Obtain valid bundle ranges first via `pulsar-admin namespaces topics`-style bundle listing / get-bundles, then pass one"],"exampleFix":"// before\nBUNDLE=\"\"  # never populated\npulsar-admin namespaces get-topic-hash-positions my-tenant/my-ns --bundle \"$BUNDLE\"\n// after\nBUNDLE=$(pulsar-admin namespaces get-bundles my-tenant/my-ns | head -1)\npulsar-admin namespaces get-topic-hash-positions my-tenant/my-ns --bundle \"$BUNDLE\" --topics topic-1","handlingStrategy":"validation","validationCode":"// shell guard\nif [ -z \"$BUNDLE\" ]; then\n  BUNDLE=$(pulsar-admin namespaces get-bundles \"$NS\" | head -1)\nfi\npulsar-admin namespaces get-topic-hash-positions \"$NS\" --bundle \"$BUNDLE\"","typeGuard":"// pseudo\nboolean hasBundle = bundle != null && !bundle.isBlank();\nif (!hasBundle) throw new IllegalArgumentException(\"--bundle is required\");","tryCatchPattern":"try {\n    admin.namespaces().getTopicHashPositions(ns, bundle, topics);\n} catch (IllegalArgumentException e) {\n    // fetch bundle list and retry with a valid bundle\n}","preventionTips":["Fetch valid bundle ranges via get-bundles before calling","Never interpolate possibly-empty variables into --bundle","Enable shell `set -u` to catch unset variables"],"tags":["cli","parameter-validation","pulsar-admin","hash-positions"],"backgroundTag":"missing-required-cli-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"}