alibaba/Sentinel · error · IllegalArgumentException
Bad argument: groupId=[%s], dataId=[%s]
Error message
Bad argument: groupId=[%s], dataId=[%s]
What it means
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.
Source
Thrown at sentinel-extension/sentinel-datasource-nacos/src/main/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java:87
* @param parser customized data parser, cannot be empty
*/
public NacosDataSource(final String serverAddr, final String groupId, final String dataId,
Converter<String, T> parser) {
this(NacosDataSource.buildProperties(serverAddr), groupId, dataId, parser);
}
/**
*
* @param properties properties for construct {@link ConfigService} using {@link NacosFactory#createConfigService(Properties)}
* @param groupId group ID, cannot be empty
* @param dataId data ID, cannot be empty
* @param parser customized data parser, cannot be empty
*/
public NacosDataSource(final Properties properties, final String groupId, final String dataId,
Converter<String, T> parser) {
super(parser);
if (StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {
throw new IllegalArgumentException(String.format("Bad argument: groupId=[%s], dataId=[%s]",
groupId, dataId));
}
AssertUtil.notNull(properties, "Nacos properties must not be null, you could put some keys from PropertyKeyConst");
this.groupId = groupId;
this.dataId = dataId;
this.properties = properties;
this.configListener = new Listener() {
@Override
public Executor getExecutor() {
return pool;
}
@Override
public void receiveConfigInfo(final String configInfo) {
RecordLog.info("[NacosDataSource] New property value received for (properties: {}) (dataId: {}, groupId: {}): {}",
properties, dataId, groupId, configInfo);
T newValue = NacosDataSource.this.parser.convert(configInfo);
// Update the new value to the property.View on GitHub (pinned to a3f40ba8e9)
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.
Example fix
// before
new NacosDataSource<>(props, null, "my-app-flow-rules", parser); // groupId missing
// after
String groupId = Objects.requireNonNull(env.getProperty("sentinel.nacos.group-id"));
new NacosDataSource<>(props, groupId, "my-app-flow-rules", parser); Defensive patterns
Strategy: validation
Validate before calling
if (StringUtil.isBlank(groupId) || StringUtil.isBlank(dataId)) {
throw new IllegalArgumentException("nacos groupId/dataId must be configured, got groupId=" + groupId);
}
new NacosDataSource<>(properties, groupId, dataId, parser); Try / catch
try {
new NacosDataSource<>(properties, groupId, dataId, parser);
} catch (IllegalArgumentException e) {
throw new IllegalStateException("NacosDataSource misconfigured: groupId=" + groupId + ", dataId=" + dataId, e);
} Prevention
- Log resolved groupId/dataId at startup to catch unresolved placeholders.
- Define these keys in a base profile so every environment has them.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- File can't be null or a directory
- charset can't be null
- Bad file
- Config encoder cannot be null
- Charset cannot be null
AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14).
Data as JSON: /api/errors/e6dbdde3b4f476dd.
Report an issue: GitHub.