alibaba/Sentinel · error · IllegalArgumentException
namespace set cannot be null
Error message
namespace set cannot be null
What it means
Third validation in ClusterConfigService.modifyClusterServerConfig: the namespaceSet (the set of app namespaces this token server serves) must be provided. A null namespaceSet throws IllegalArgumentException before the four chained modify calls to the target machine are issued.
Source
Thrown at sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterConfigService.java:85
private boolean notClientRequestValid(/*@NonNull */ ClusterClientModifyRequest request) {
ClusterClientConfig config = request.getClientConfig();
return config == null || StringUtil.isEmpty(config.getServerHost())
|| config.getServerPort() == null || config.getServerPort() <= 0
|| config.getRequestTimeout() == null || config.getRequestTimeout() <= 0;
}
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet)
.thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig))
.thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig))
.thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
/**
* Get cluster state list of all available machines of provided application.
*
* @param app application name
* @return cluster state list of all available machines of the application
* @since 1.4.1
*/
public CompletableFuture<List<ClusterUniversalStatePairVO>> getClusterUniversalState(String app) {View on GitHub (pinned to a3f40ba8e9)
Solutions
- Set namespaceSet explicitly, usually to the set of application names the server serves, e.g. Collections.singleton(appName).
- Include a namespaceSet array in the JSON payload (empty set is accepted, null is not).
- Verify your custom client code calls setNamespaceSet after upgrading the dashboard, which made this field mandatory.
Example fix
// before req.setFlowConfig(new ServerFlowConfig()); // namespaceSet not set clusterConfigService.modifyClusterServerConfig(req); // after req.setNamespaceSet(Collections.singleton(appName)); clusterConfigService.modifyClusterServerConfig(req);
Defensive patterns
Strategy: validation
Validate before calling
if (request.getNamespaceSet() == null) {
request.setNamespaceSet(Collections.singleton(appName));
}
clusterConfigService.modifyClusterServerConfig(request); Type guard
boolean hasNamespaceSet(ClusterServerModifyRequest r) {
return r.getNamespaceSet() != null;
} Prevention
- Serialize namespaceSet as an explicit (possibly empty) array in JSON payloads — never omit it.
- Bind the namespace selector to the current app list so it is always populated.
When it happens
Trigger: ClusterServerModifyRequest where namespaceSet was never set (null), e.g. JSON body lacking the namespaceSet array.
Common situations: Custom dashboards or automation scripts posting partial cluster-server payloads; frontend bugs that skip the namespace selection step.
Related errors
- Invalid request
- Invalid transport config in request
- Invalid flow config in request
- Invalid intervalUnit: {}
- BAD_REQUEST
AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14).
Data as JSON: /api/errors/cfc7293d078654a8.
Report an issue: GitHub.