{"record":{"id":"55f2e52d58dde667","repo":"alibaba/nacos","slug":"param-groupname-is-illegal-groupname-is-blank","errorCode":null,"errorMessage":"Param 'groupName' is illegal, groupName is blank","messagePattern":"Param 'groupName' is illegal, groupName is blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/naming/utils/NamingUtils.java","lineNumber":67,"sourceCode":"     * Returns a combined string with serviceName and groupName. serviceName can not be nil.\n     *\n     * <p>In most cases, serviceName can not be nil. In other cases, for search or anything, See {@link\n     * com.alibaba.nacos.api.naming.utils.NamingUtils#getGroupedNameOptional(String, String)}\n     *\n     * <p>etc:\n     * <p>serviceName | groupName | result</p>\n     * <p>serviceA    | groupA    | groupA@@serviceA</p>\n     * <p>nil         | groupA    | threw IllegalArgumentException</p>\n     *\n     * @return 'groupName@@serviceName'\n     */\n    public static String getGroupedName(final String serviceName, final String groupName) {\n        if (StringUtils.isBlank(serviceName)) {\n            throw new IllegalArgumentException(\n                \"Param 'serviceName' is illegal, serviceName is blank\");\n        }\n        if (StringUtils.isBlank(groupName)) {\n            throw new IllegalArgumentException(\"Param 'groupName' is illegal, groupName is blank\");\n        }\n        final String resultGroupedName = groupName + Constants.SERVICE_INFO_SPLITER + serviceName;\n        return resultGroupedName.intern();\n    }\n    \n    public static String getServiceKey(String namespace, String group, String serviceName) {\n        if (StringUtils.isBlank(namespace)) {\n            namespace = DEFAULT_NAMESPACE_ID;\n        }\n        return namespace + Constants.SERVICE_INFO_SPLITER + group + Constants.SERVICE_INFO_SPLITER\n            + serviceName;\n    }\n    \n    /**\n     * parse service key items for serviceKey. item[0] for namespace item[1] for group item[2] for service name\n     *\n     * @param serviceKey serviceKey.\n     * @return","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/naming/utils/NamingUtils.java#L49-L85","documentation":"Sibling check to 542: getGroupedName also requires a non-blank groupName. Even with a valid serviceName, a blank groupName makes the composite key invalid because the group segment is mandatory in Nacos naming.","triggerScenarios":"Calling getGroupedName(serviceName, \"\") or with a null/whitespace groupName; defaulting groupName to empty when no group was configured.","commonSituations":"Client omitted the group argument expecting a default; misconfigured default group constant resolving to blank.","solutions":["Provide a non-blank groupName (e.g. Constants.DEFAULT_GROUP).","Default missing group to DEFAULT_GROUP before calling getGroupedName."],"exampleFix":"// before\nString key = NamingUtils.getGroupedName(\"svc\", \"\");  // throws 543\n\n// after\nString group = StringUtils.isBlank(groupName) ? Constants.DEFAULT_GROUP : groupName;\nString key = NamingUtils.getGroupedName(\"svc\", group);","handlingStrategy":"validation","validationCode":"String group = StringUtils.isBlank(groupName) ? Constants.DEFAULT_GROUP : groupName;\nNamingUtils.getGroupedName(serviceName, group);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default missing group to Constants.DEFAULT_GROUP before composing.","Validate group configuration at app startup."],"tags":["naming","validation","parameter","service-key"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}