{"record":{"id":"efe3569f3b44e025","repo":"alibaba/Sentinel","slug":"bad-argument-serveraddr-s-authinfos-s-gro","errorCode":null,"errorMessage":"Bad argument: serverAddr=[%s], authInfos=[%s], groupId=[%s], dataId=[%s]","messagePattern":"Bad argument: serverAddr=\\[(.+?)\\], authInfos=\\[(.+?)\\], 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":80,"sourceCode":"    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);\n    }\n\n    private void init(final String serverAddr, final List<AuthInfo> authInfos) {\n        initZookeeperListener(serverAddr, authInfos);\n        loadInitialConfig();\n    }\n\n    private void loadInitialConfig() {\n        try {\n            T newValue = loadConfig();\n            if (newValue == null) {\n                RecordLog.warn(\"[ZookeeperDataSource] WARN: initial config is null, you may have to check your data source\");\n            }\n            getProperty().updateValue(newValue);","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/alibaba/Sentinel/blob/a3f40ba8e900c8489bd520274739f17235a7721c/sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java#L62-L98","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\nnew ZookeeperDataSource<>(zkAddr, auths, groupId, null, parser); // dataId blank\n\n// after\nnew ZookeeperDataSource<>(\"zk.prod:2181\", auths, \"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 (authInfos optional)\");\n}\nnew ZookeeperDataSource<>(serverAddr, authInfos, groupId, dataId, parser);","typeGuard":null,"tryCatchPattern":"try {\n    new ZookeeperDataSource<>(serverAddr, authInfos, groupId, dataId, parser);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"ZooKeeper datasource misconfigured: \" + serverAddr + \"/\" + groupId + \"/\" + dataId, e);\n}","preventionTips":["When switching constructor overloads (e.g. adding auth), re-verify all identifier properties.","Validate AuthInfo entries separately if the cluster requires digest auth."],"tags":["sentinel","datasource","zookeeper","constructor-validation","java"],"backgroundTag":null,"analyzedSha":"a3f40ba8e900c8489bd520274739f17235a7721c","analyzedAt":"2026-08-14T11:10:30.678Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}