{"record":{"id":"218bee51b604c87a","repo":"alibaba/Sentinel","slug":"bad-argument-serveraddr-s-groupid-s-datai","errorCode":null,"errorMessage":"Bad argument: serverAddr=[%s], groupId=[%s], dataId=[%s]","messagePattern":"Bad argument: serverAddr=\\[(.+?)\\], groupId=\\[(.+?)\\], dataId=\\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java","lineNumber":66,"sourceCode":"\n    public ZookeeperDataSource(final String serverAddr, final String path, Converter<String, T> parser) {\n        super(parser);\n        if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(path)) {\n            throw new IllegalArgumentException(String.format(\"Bad argument: serverAddr=[%s], path=[%s]\", serverAddr, path));\n        }\n        this.path = path;\n\n        init(serverAddr, null);\n    }\n\n    /**\n     * This constructor is Nacos-style.\n     */\n    public ZookeeperDataSource(final String serverAddr, final String groupId, final String dataId,\n                               Converter<String, T> parser) {\n        super(parser);\n        if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {\n            throw new IllegalArgumentException(String.format(\"Bad argument: serverAddr=[%s], groupId=[%s], dataId=[%s]\", serverAddr, groupId, dataId));\n        }\n        this.path = getPath(groupId, dataId);\n\n        init(serverAddr, null);\n    }\n\n    /**\n     * This constructor adds authentication information.\n     */\n    public ZookeeperDataSource(final String serverAddr, final List<AuthInfo> authInfos, final String groupId, final String dataId,\n                               Converter<String, T> parser) {\n        super(parser);\n        if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {\n            throw new IllegalArgumentException(String.format(\"Bad argument: serverAddr=[%s], authInfos=[%s], groupId=[%s], dataId=[%s]\", serverAddr, authInfos, groupId, dataId));\n        }\n        this.path = getPath(groupId, dataId);\n\n        init(serverAddr, authInfos);","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/alibaba/Sentinel/blob/a3f40ba8e900c8489bd520274739f17235a7721c/sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java#L48-L84","documentation":"Thrown by the Nacos-style ZookeeperDataSource constructor when serverAddr, groupId, or dataId is blank. This overload composes the znode path from groupId and dataId (via getPath(groupId, dataId)) instead of taking an explicit path, so all three identifiers must be present.","triggerScenarios":"new ZookeeperDataSource(serverAddr, groupId, dataId, parser) where any argument is null/empty/whitespace — most often an unresolved placeholder or a property key defined in a different profile.","commonSituations":"Reusing Nacos config keys for ZooKeeper but the group/dataId properties are absent; placeholder substitution failing; whitespace-only values from YAML indentation mistakes.","solutions":["Provide all three values, e.g. (\"zk.prod:2181\", \"Sentinel_Group\", \"my-app-flow-rules\", parser).","Confirm the composed path (groupId/dataId per getPath()) matches where rules actually live in ZooKeeper.","Add a startup assertion on the three properties so a blank one fails with its name."],"exampleFix":"// before\nnew ZookeeperDataSource<>(zkAddr, \"\", \"my-app-flow-rules\", parser);\n\n// after\nnew ZookeeperDataSource<>(\"zk.prod:2181\", \"Sentinel_Group\", \"my-app-flow-rules\", parser);","handlingStrategy":"validation","validationCode":"if (StringUtil.isBlank(serverAddr) || StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {\n    throw new IllegalArgumentException(\"zookeeper serverAddr/groupId/dataId required\");\n}\nnew ZookeeperDataSource<>(serverAddr, groupId, dataId, parser);","typeGuard":null,"tryCatchPattern":"try {\n    new ZookeeperDataSource<>(serverAddr, groupId, dataId, parser);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"ZooKeeper datasource misconfigured: \" + serverAddr + \"/\" + groupId + \"/\" + dataId, e);\n}","preventionTips":["Ensure groupId/dataId compose to the znode path that actually holds the rules.","Define these keys in a base profile so no environment starts without them."],"tags":["sentinel","datasource","zookeeper","constructor-validation","java"],"backgroundTag":null,"analyzedSha":"a3f40ba8e900c8489bd520274739f17235a7721c","analyzedAt":"2026-08-14T11:10:30.678Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}