{"record":{"id":"e0430b4bb31cf0db","repo":"alibaba/nacos","slug":"invalid-group","errorCode":null,"errorMessage":"invalid group","messagePattern":"invalid group","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java","lineNumber":55,"sourceCode":"    \n    public static String getKey(String dataId, String group) {\n        return getKey(dataId, group, \"\");\n    }\n    \n    public static String getKey(String dataId, String group, String datumStr) {\n        return doGetKey(dataId, group, datumStr);\n    }\n    \n    public static String getKeyTenant(String dataId, String group, String tenant) {\n        return doGetKey(dataId, group, tenant);\n    }\n    \n    private static String doGetKey(String dataId, String group, String datumStr) {\n        if (StringUtils.isBlank(dataId)) {\n            throw new IllegalArgumentException(\"invalid dataId\");\n        }\n        if (StringUtils.isBlank(group)) {\n            throw new IllegalArgumentException(\"invalid group\");\n        }\n        StringBuilder sb = new StringBuilder();\n        urlEncode(dataId, sb);\n        sb.append(PLUS);\n        urlEncode(group, sb);\n        if (StringUtils.isNotEmpty(datumStr)) {\n            sb.append(PLUS);\n            urlEncode(datumStr, sb);\n        }\n        \n        return sb.toString();\n    }\n    \n    /**\n     * Parse key.\n     *\n     * @param groupKey group key\n     * @return parsed key","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java#L37-L73","documentation":"Thrown as IllegalArgumentException by GroupKey.doGetKey() when the group parameter is null or blank (StringUtils.isBlank). doGetKey() is called by getKey() and getKeyTenant(). The group is a required component of the config composite key — a blank group makes the key ambiguous and is rejected.","triggerScenarios":"Any call to GroupKey.getKey() or GroupKey.getKeyTenant() with a null, empty, or whitespace-only group. Common in config operations where the developer omitted the group or passed an uninitialized variable. Note: Nacos uses Constants.DEFAULT_GROUP (\"DEFAULT_GROUP\") when group is not specified by the user, so hitting this means the default was not applied upstream.","commonSituations":"ConfigService calls where group was explicitly set to null instead of omitted (which would default to DEFAULT_GROUP). Internal code that extracts group from a parsed source that returned null. Config listener registration with a null group field.","solutions":["Default group to Constants.DEFAULT_GROUP when the caller does not specify one, before calling GroupKey.getKey().","Validate group is non-blank at the API boundary.","Trace upstream to find where the null group originated."],"exampleFix":"// before\nString key = GroupKey.getKey(dataId, group); // throws if group is null\n\n// after: apply default group\nString resolvedGroup = StringUtils.isBlank(group) ? Constants.DEFAULT_GROUP : group;\nString key = GroupKey.getKey(dataId, resolvedGroup);","handlingStrategy":"validation","validationCode":"// Default group to DEFAULT_GROUP when not specified\nString resolvedGroup = StringUtils.isBlank(group)\n    ? Constants.DEFAULT_GROUP\n    : group;\nString key = GroupKey.getKey(dataId, resolvedGroup);","typeGuard":null,"tryCatchPattern":"try {\n    String key = GroupKey.getKey(dataId, group);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"invalid group\")) {\n        log.error(\"group is blank — apply Constants.DEFAULT_GROUP as fallback\");\n    }\n    throw e;\n}","preventionTips":["Default group to Constants.DEFAULT_GROUP when the caller omits it.","Validate group at the API boundary.","Never pass null or empty string as group to config operations."],"tags":["nacos","config-client","group-key","validation","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}