alibaba/Sentinel · error · IllegalArgumentException
Bad argument: serverAddr=[%s], authInfos=[%s], groupId=[%s],
Error message
Bad argument: serverAddr=[%s], authInfos=[%s], groupId=[%s], dataId=[%s]
What it means
Thrown by the auth-enabled ZookeeperDataSource constructor when serverAddr, groupId, or dataId is blank. This overload additionally takes a List<AuthInfo> for digest auth; the validation checks only the three identifiers (authInfos may legitimately be null/empty), and the message echoes authInfos for diagnosability.
Source
Thrown at sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java:80
public ZookeeperDataSource(final String serverAddr, final String groupId, final String dataId,
Converter<String, T> parser) {
super(parser);
if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {
throw new IllegalArgumentException(String.format("Bad argument: serverAddr=[%s], groupId=[%s], dataId=[%s]", serverAddr, groupId, dataId));
}
this.path = getPath(groupId, dataId);
init(serverAddr, null);
}
/**
* This constructor adds authentication information.
*/
public ZookeeperDataSource(final String serverAddr, final List<AuthInfo> authInfos, final String groupId, final String dataId,
Converter<String, T> parser) {
super(parser);
if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {
throw new IllegalArgumentException(String.format("Bad argument: serverAddr=[%s], authInfos=[%s], groupId=[%s], dataId=[%s]", serverAddr, authInfos, groupId, dataId));
}
this.path = getPath(groupId, dataId);
init(serverAddr, authInfos);
}
private void init(final String serverAddr, final List<AuthInfo> authInfos) {
initZookeeperListener(serverAddr, authInfos);
loadInitialConfig();
}
private void loadInitialConfig() {
try {
T newValue = loadConfig();
if (newValue == null) {
RecordLog.warn("[ZookeeperDataSource] WARN: initial config is null, you may have to check your data source");
}
getProperty().updateValue(newValue);View on GitHub (pinned to a3f40ba8e9)
Solutions
- Supply non-blank serverAddr, groupId, and dataId (authInfos is optional for the check but should contain valid AuthInfo entries if you need auth).
- Re-verify the three identifier properties after switching constructor overloads.
- Fail fast on blank values in your own wiring code with the property names in the message.
Example fix
// before
new ZookeeperDataSource<>(zkAddr, auths, groupId, null, parser); // dataId blank
// after
new ZookeeperDataSource<>("zk.prod:2181", auths, "Sentinel_Group", "my-app-flow-rules", parser); Defensive patterns
Strategy: validation
Validate before calling
if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {
throw new IllegalArgumentException("zookeeper serverAddr/groupId/dataId required (authInfos optional)");
}
new ZookeeperDataSource<>(serverAddr, authInfos, groupId, dataId, parser); Try / catch
try {
new ZookeeperDataSource<>(serverAddr, authInfos, groupId, dataId, parser);
} catch (IllegalArgumentException e) {
throw new IllegalStateException("ZooKeeper datasource misconfigured: " + serverAddr + "/" + groupId + "/" + dataId, e);
} Prevention
- When switching constructor overloads (e.g. adding auth), re-verify all identifier properties.
- Validate AuthInfo entries separately if the cluster requires digest auth.
When it happens
Trigger: new ZookeeperDataSource(serverAddr, authInfos, groupId, dataId, parser) with any of serverAddr/groupId/dataId blank — same root causes as the non-auth overload (unresolved placeholders, missing profile properties).
Common situations: Migrating from the 4-arg constructor to add ZooKeeper digest auth and a property goes missing in the refactor; environments where the groupId/dataId keys are defined only for the non-auth deployment.
Related errors
- Bad argument: serverAddr=[%s], path=[%s]
- Bad argument: serverAddr=[%s], groupId=[%s], dataId=[%s]
- File can't be null or a directory
- charset can't be null
- Bad file
AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14).
Data as JSON: /api/errors/efe3569f3b44e025.
Report an issue: GitHub.