apache/pulsar · error · ParameterException

namespace and bundle must be provided together.

Error message

namespace and bundle must be provided together.

What it means

`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.

Source

Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdResourceQuotas.java:51

    private class GetResourceQuota extends CliCommand {

        @Option(names = { "--namespace",
                "-n" }, description = "tenant/namespace, must be specified together with '--bundle'")
        private String namespaceName;

        @Option(names = { "--bundle",
                "-b" }, description = "{start-boundary}_{end-boundary}, must be specified together with '--namespace'")
        private String bundle;

        @Override
        void run() throws PulsarAdminException, ParameterException {
            if (bundle == null && namespaceName == null) {
                print(getAdmin().resourceQuotas().getDefaultResourceQuota());
            } else if (bundle != null && namespaceName != null) {
                String namespace = validateNamespace(namespaceName);
                print(getAdmin().resourceQuotas().getNamespaceBundleResourceQuota(namespace, bundle));
            } else {
                throw new ParameterException("namespace and bundle must be provided together.");
            }
        }
    }

    @Command(description = "Set the resource quota for specified namespace bundle, "
            + "or default quota if no namespace/bundle specified.")
    private class SetResourceQuota extends CliCommand {

        @Option(names = { "--namespace",
                "-n" }, description = "tenant/namespace, must be specified together with '--bundle'")
        private String namespaceName;

        @Option(names = { "--bundle",
                "-b" }, description = "{start-boundary}_{end-boundary}, must be specified together with '--namespace'")
        private String bundle;

        @Option(names = { "--msgRateIn",
                "-mi" }, description = "expected incoming messages per second", required = true)

View on GitHub (pinned to 820761864e)

Solutions

  1. Provide both flags: --namespace <tenant/ns> --bundle <start_end>
  2. Or omit both flags to view the default resource quota
  3. Compute the bundle range (e.g. via `pulsar-admin namespaces topics` or namespace-bundle commands) if unknown

Example fix

// before
pulsar-admin resource-quotas get --namespace my-tenant/my-ns
// after
pulsar-admin resource-quotas get --namespace my-tenant/my-ns --bundle 0x00000000_0xffffffff
Defensive patterns

Strategy: validation

Validate before calling

if ((namespace == null) != (bundle == null)) {
    throw new IllegalArgumentException("--namespace and --bundle must be provided together");
}

Try / catch

try {
    ResourceQuota quota = admin.resourceQuotas().getNamespaceBundleResourceQuota(ns, bundle);
} catch (org.apache.pulsar.client.admin.PulsarAdminException e) {
    // fall back to default quota
}

Prevention

When it happens

Trigger: Running `pulsar-admin resource-quotas get` with only --namespace my-tenant/my-ns or only --bundle '0x00000000_0xffffffff'.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/0fdacb46adb6a428. Report an issue: GitHub.