{"record":{"id":"e6dbdde3b4f476dd","repo":"alibaba/Sentinel","slug":"bad-argument-groupid-s-dataid-s","errorCode":null,"errorMessage":"Bad argument: groupId=[%s], dataId=[%s]","messagePattern":"Bad argument: groupId=\\[(.+?)\\], dataId=\\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sentinel-extension/sentinel-datasource-nacos/src/main/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java","lineNumber":87,"sourceCode":"     * @param parser     customized data parser, cannot be empty\n     */\n    public NacosDataSource(final String serverAddr, final String groupId, final String dataId,\n                           Converter<String, T> parser) {\n        this(NacosDataSource.buildProperties(serverAddr), groupId, dataId, parser);\n    }\n\n    /**\n     *\n     * @param properties properties for construct {@link ConfigService} using {@link NacosFactory#createConfigService(Properties)}\n     * @param groupId    group ID, cannot be empty\n     * @param dataId     data ID, cannot be empty\n     * @param parser     customized data parser, cannot be empty\n     */\n    public NacosDataSource(final Properties properties, final String groupId, final String dataId,\n                           Converter<String, T> parser) {\n        super(parser);\n        if (StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {\n            throw new IllegalArgumentException(String.format(\"Bad argument: groupId=[%s], dataId=[%s]\",\n                groupId, dataId));\n        }\n        AssertUtil.notNull(properties, \"Nacos properties must not be null, you could put some keys from PropertyKeyConst\");\n        this.groupId = groupId;\n        this.dataId = dataId;\n        this.properties = properties;\n        this.configListener = new Listener() {\n            @Override\n            public Executor getExecutor() {\n                return pool;\n            }\n\n            @Override\n            public void receiveConfigInfo(final String configInfo) {\n                RecordLog.info(\"[NacosDataSource] New property value received for (properties: {}) (dataId: {}, groupId: {}): {}\",\n                    properties, dataId, groupId, configInfo);\n                T newValue = NacosDataSource.this.parser.convert(configInfo);\n                // Update the new value to the property.","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/alibaba/Sentinel/blob/a3f40ba8e900c8489bd520274739f17235a7721c/sentinel-extension/sentinel-datasource-nacos/src/main/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java#L69-L105","documentation":"Thrown by the NacosDataSource constructor when groupId or dataId is blank (null, empty, or whitespace-only). These two strings identify the config entry in Nacos that the data source subscribes to; a blank one makes the subscription meaningless, so Sentinel refuses construction.","triggerScenarios":"new NacosDataSource(properties, groupId, dataId, parser) where either string is blank — typically a placeholder like \"${nacos.group}\" that was never substituted, or a typo'd property key returning null.","commonSituations":"Spring property placeholder not resolved (value literally \"${sentinel.nacos.group-id}\"); env-specific config missing the group/dataId keys in one environment; copy-paste from a Nacos example leaving the sample constants blank.","solutions":["Set concrete non-blank values for groupId and dataId (defaults are often \"SENTINEL_GROUP\" and e.g. \"${appName}-flow-rules\").","Verify the property keys actually exist in the environment/application.yml; log both values before constructing.","If using placeholders, ensure the config files defining them are loaded; fail your own startup check when either is blank so the error names the property."],"exampleFix":"// before\nnew NacosDataSource<>(props, null, \"my-app-flow-rules\", parser); // groupId missing\n\n// after\nString groupId = Objects.requireNonNull(env.getProperty(\"sentinel.nacos.group-id\"));\nnew NacosDataSource<>(props, groupId, \"my-app-flow-rules\", parser);","handlingStrategy":"validation","validationCode":"if (StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {\n    throw new IllegalArgumentException(\"nacos groupId/dataId must be configured, got groupId=\" + groupId);\n}\nnew NacosDataSource<>(properties, groupId, dataId, parser);","typeGuard":null,"tryCatchPattern":"try {\n    new NacosDataSource<>(properties, groupId, dataId, parser);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"NacosDataSource misconfigured: groupId=\" + groupId + \", dataId=\" + dataId, e);\n}","preventionTips":["Log resolved groupId/dataId at startup to catch unresolved placeholders.","Define these keys in a base profile so every environment has them."],"tags":["sentinel","datasource","nacos","constructor-validation","java"],"backgroundTag":null,"analyzedSha":"a3f40ba8e900c8489bd520274739f17235a7721c","analyzedAt":"2026-08-14T11:10:30.678Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}