apache/pulsar · error · ParameterException
unable to parse namespaces parameter list:
Error message
unable to parse namespaces parameter list:
What it means
Thrown by the pulsar-admin CLI (createNamespaceIsolationData) when the --namespaces option parses to an empty list after validateList() processing. Namespace isolation policies require at least one namespace to match, so an empty list is rejected before any admin API call is made. It is a client-side argument validation error (JCommander ParameterException), not a broker error.
Source
Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaceIsolationPolicy.java:186
}
private List<String> validateList(List<String> list) {
return list.stream()
.filter(StringUtils::isNotEmpty)
.collect(Collectors.toList());
}
private NamespaceIsolationData createNamespaceIsolationData(List<String> namespaces,
List<String> primary,
List<String> secondary,
String autoFailoverPolicyTypeName,
Map<String, String> autoFailoverPolicyParams,
NamespaceIsolationPolicyUnloadScope unload) {
// validate
namespaces = validateList(namespaces);
if (namespaces.isEmpty()) {
throw new ParameterException("unable to parse namespaces parameter list: " + namespaces);
}
primary = validateList(primary);
if (primary.isEmpty()) {
throw new ParameterException("unable to parse primary parameter list: " + namespaces);
}
secondary = validateList(secondary);
// System.out.println("namespaces = " + namespaces);
// System.out.println("primary = " + primary);
// System.out.println("secondary = " + secondary);
// System.out.println("autoFailoverPolicyTypeName = " + autoFailoverPolicyTypeName);
// System.out.println("autoFailoverPolicyParams = " + autoFailoverPolicyParams);
NamespaceIsolationData.Builder nsIsolationDataBuilder = NamespaceIsolationData.builder();
if (namespaces != null) {View on GitHub (pinned to 820761864e)
Solutions
- Pass at least one namespace with --namespaces, e.g. --namespaces my-tenant/ns1
- For multiple namespaces use a comma-separated list: --namespaces 'tenant/ns1,tenant/ns2'
- Verify the shell variable containing the list is non-empty before invoking the CLI
- Check for accidental blank quotes or a trailing/duplicate comma that validateList strips, leaving nothing
Example fix
// before pulsar-admin ns-isolation-policy create policy1 --namespaces '' --primary 'my-tenant/ns1[0-9]' ... // after pulsar-admin ns-isolation-policy create policy1 --namespaces 'my-tenant/ns[0-9]' --primary 'my-tenant/ns1[0-9]' ...
Defensive patterns
Strategy: validation
Validate before calling
// shell check before invoking the CLI
if [ -z "$NS_LIST" ]; then echo "--namespaces must contain at least one namespace" >&2; exit 1; fi
# or in Java, before calling createNamespaceIsolationData:
if (validateList(namespaces).isEmpty()) { throw new IllegalArgumentException("namespaces required"); } Try / catch
// Java
try {
admin.namespacesIsolationPolicies().createNamespaceIsolationPolicy(name, data);
} catch (org.jcommander.ParameterException | IllegalArgumentException e) {
// treat as invalid input: log and abort, do not retry
} Prevention
- Always pass a non-empty comma-separated --namespaces value
- Quote namespace regex lists in shell
- Validate list variables are populated before composing the command
When it happens
Trigger: Running `pulsar-admin namespaces-isolation-policy create` with --namespaces omitted, or supplied only with empty/duplicate separators (e.g. `--namespaces ''` or `--namespaces ,`) so the comma-split+validateList result is empty.
Common situations: Shell variables holding namespace lists that are empty; quoting mistakes that swallow the value; copy-pasted examples where the namespaces option was dropped; scripting where a templated value renders blank.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Need to provide a persistent topic name
- Need to provide a non-persistent topic name
- Invalid message id (must be in format: ledgerId:entryId) val
- unable to parse primary parameter list:
- Unknown auto failover policy params specified :
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/777169f912561b8b.
Report an issue: GitHub.