{"record":{"id":"0fdacb46adb6a428","repo":"apache/pulsar","slug":"namespace-and-bundle-must-be-provided-together","errorCode":null,"errorMessage":"namespace and bundle must be provided together.","messagePattern":"namespace and bundle must be provided together\\.","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdResourceQuotas.java","lineNumber":51,"sourceCode":"    private class GetResourceQuota extends CliCommand {\n\n        @Option(names = { \"--namespace\",\n                \"-n\" }, description = \"tenant/namespace, must be specified together with '--bundle'\")\n        private String namespaceName;\n\n        @Option(names = { \"--bundle\",\n                \"-b\" }, description = \"{start-boundary}_{end-boundary}, must be specified together with '--namespace'\")\n        private String bundle;\n\n        @Override\n        void run() throws PulsarAdminException, ParameterException {\n            if (bundle == null && namespaceName == null) {\n                print(getAdmin().resourceQuotas().getDefaultResourceQuota());\n            } else if (bundle != null && namespaceName != null) {\n                String namespace = validateNamespace(namespaceName);\n                print(getAdmin().resourceQuotas().getNamespaceBundleResourceQuota(namespace, bundle));\n            } else {\n                throw new ParameterException(\"namespace and bundle must be provided together.\");\n            }\n        }\n    }\n\n    @Command(description = \"Set the resource quota for specified namespace bundle, \"\n            + \"or default quota if no namespace/bundle specified.\")\n    private class SetResourceQuota extends CliCommand {\n\n        @Option(names = { \"--namespace\",\n                \"-n\" }, description = \"tenant/namespace, must be specified together with '--bundle'\")\n        private String namespaceName;\n\n        @Option(names = { \"--bundle\",\n                \"-b\" }, description = \"{start-boundary}_{end-boundary}, must be specified together with '--namespace'\")\n        private String bundle;\n\n        @Option(names = { \"--msgRateIn\",\n                \"-mi\" }, description = \"expected incoming messages per second\", required = true)","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdResourceQuotas.java#L33-L69","documentation":"`pulsar-admin resource-quotas get` either takes no arguments (to show the default quota) or both --namespace and --bundle. Passing exactly one of them is ambiguous, so the CLI throws a ParameterException telling you they must be provided together.","triggerScenarios":"Running `pulsar-admin resource-quotas get` with only --namespace my-tenant/my-ns or only --bundle '0x00000000_0xffffffff'.","commonSituations":"Users assuming namespace alone is enough, forgetting bundles are the unit of quota; scripts where the bundle variable is unset so only namespace is passed.","solutions":["Provide both flags: --namespace <tenant/ns> --bundle <start_end>","Or omit both flags to view the default resource quota","Compute the bundle range (e.g. via `pulsar-admin namespaces topics` or namespace-bundle commands) if unknown"],"exampleFix":"// before\npulsar-admin resource-quotas get --namespace my-tenant/my-ns\n// after\npulsar-admin resource-quotas get --namespace my-tenant/my-ns --bundle 0x00000000_0xffffffff","handlingStrategy":"validation","validationCode":"if ((namespace == null) != (bundle == null)) {\n    throw new IllegalArgumentException(\"--namespace and --bundle must be provided together\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    ResourceQuota quota = admin.resourceQuotas().getNamespaceBundleResourceQuota(ns, bundle);\n} catch (org.apache.pulsar.client.admin.PulsarAdminException e) {\n    // fall back to default quota\n}","preventionTips":["Treat namespace and bundle as a single pair in scripts","Fetch the bundle range from namespace-bundle listing commands","Omit both flags when you actually want the default quota"],"tags":["cli","resource-quota","validation"],"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-14T00:17:10.932Z"}