apache/pulsar · error · ParameterException

Unknown auto failover policy type specified :

Error message

Unknown auto failover policy type specified : 

What it means

Thrown when the --auto-failover-policy-type value does not match any supported auto-failover policy type. Currently the CLI only recognizes 'minAvailable'; anything else (or a wrong casing like MinAvailable / minavailable) falls into the else branch and raises this ParameterException.

Source

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

            String[] expectParamKeys = { "min_limit", "usage_threshold" };

            if (autoFailoverPolicyParams.size() == expectParamKeys.length) {
                for (String paramKey : expectParamKeys) {
                    if (!autoFailoverPolicyParams.containsKey(paramKey)) {
                        break;
                    }
                }
                error = false;
            }

            if (error) {
                throw new ParameterException(
                        "Unknown auto failover policy params specified : " + autoFailoverPolicyParams);
            }

        } else {
            // either we don't handle the new type or user has specified a bad type
            throw new ParameterException("Unknown auto failover policy type specified : " + autoFailoverPolicyTypeName);
        }

        nsIsolationDataBuilder.unloadScope(unload);

        return nsIsolationDataBuilder.build();
    }

    public CmdNamespaceIsolationPolicy(Supplier<PulsarAdmin> admin) {
        super("ns-isolation-policy", admin);
        addCommand("set", new SetPolicy());
        addCommand("get", new GetPolicy());
        addCommand("list", new GetAllPolicies());
        addCommand("delete", new DeletePolicy());
        addCommand("brokers", new GetAllBrokersWithPolicies());
        addCommand("broker", new GetBrokerWithPolicies());
    }

}

View on GitHub (pinned to 820761864e)

Solutions

  1. Use exactly --auto-failover-policy-type minAvailable (lowercase)
  2. Check spelling and casing of the supplied type name
  3. Omit the --auto-failover-policy-* flags entirely if you do not want an auto failover policy
  4. Confirm against the Pulsar docs/CLI help for supported policy types in your version

Example fix

// before
--auto-failover-policy-type MinAvailable --auto-failover-policy-params min_limit=10
// after
--auto-failover-policy-type minAvailable --auto-failover-policy-params min_limit=10,usage_threshold=80
Defensive patterns

Strategy: validation

Validate before calling

case "$AUTO_FAILOVER_TYPE" in
  minAvailable) ;;
  *) echo "unsupported auto failover policy type: $AUTO_FAILOVER_TYPE"; exit 1;;
esac

Try / catch

try { ... } catch (ParameterException e) { /* bad policy type: fix to 'minAvailable', no retry */ }

Prevention

When it happens

Trigger: Running `pulsar-admin namespaces-isolation-policy create` with e.g. --auto-failover-policy-type maxAvailable, --auto-failover-policy-type MinAvailable (wrong case), or the flag omitted so a null type is compared.

Common situations: Guessing a policy type name that does not exist; inventing a type seen in another system; case-sensitivity mistakes; shell variable interpolation producing an empty or misspelled type.

Related errors


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