{"record":{"id":"f4312ab992e41f87","repo":"alibaba/nacos","slug":"too-long-tag-over-16","errorCode":null,"errorMessage":"too long tag, over 16","messagePattern":"too long tag, over 16","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java","lineNumber":140,"sourceCode":"        }\n        if (StringUtils.isBlank(group) || !isValid(group)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"invalid group : \" + group);\n        }\n        checkTenantV2(namespaceId);\n    }\n    \n    /**\n     * Check the tag for [v1].\n     */\n    public static void checkParam(String tag) {\n        if (StringUtils.isNotBlank(tag)) {\n            if (!isValid(tag.trim())) {\n                throw new IllegalArgumentException(\"invalid tag : \" + tag);\n            }\n            if (tag.length() > TAG_MAX_LEN) {\n                throw new IllegalArgumentException(\"too long tag, over 16\");\n            }\n        }\n    }\n    \n    /**\n     * Check the config info for [v1] and [v2].\n     */\n    public static void checkParam(Map<String, Object> configAdvanceInfo) throws NacosException {\n        for (Map.Entry<String, Object> configAdvanceInfoTmp : configAdvanceInfo.entrySet()) {\n            if (CONFIG_TAGS.equals(configAdvanceInfoTmp.getKey())) {\n                if (configAdvanceInfoTmp.getValue() != null) {\n                    String[] tagArr = ((String) configAdvanceInfoTmp.getValue()).split(\",\");\n                    if (tagArr.length > 5) {\n                        throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                            ErrorCode.PARAMETER_VALIDATE_ERROR,\n                            \"too much config_tags, over 5\");\n                    }\n                    for (String tag : tagArr) {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java#L122-L158","documentation":"Thrown by the v1 single-tag overload ParamUtils.checkParam(String tag) as an IllegalArgumentException when tag.length() exceeds TAG_MAX_LEN (16). It is an unchecked runtime exception with no error code/HTTP status. Enforces short, machine-friendly tags for indexing and push filtering.","triggerScenarios":"A v1 config operation passing a tag whose length is greater than 16 characters (after the charset check passes).","commonSituations":"Using a descriptive sentence or UUID as a tag, concatenating env+version+region into one tag field.","solutions":["Shorten the tag to at most 16 characters.","Move long descriptive metadata into the 'desc' advance-info field (max 128) instead of the tag.","Use a compact encoding (e.g. abbreviated codes) for composite tag values."],"exampleFix":"// before\nParamUtils.checkParam(\"production-blue-cluster\"); // 24 chars\n\n// after\nParamUtils.checkParam(\"prod-blue\"); // 9 chars, fits TAG_MAX_LEN=16","handlingStrategy":"validation","validationCode":"boolean validTagLength(String tag) {\n    return tag == null || tag.length() <= 16;\n}","typeGuard":null,"tryCatchPattern":"try {\n    ParamUtils.checkParam(tag);\n} catch (IllegalArgumentException e) {\n    handleInvalidTag(e.getMessage());\n}","preventionTips":["Keep tags to short tokens (<=16 chars).","Move long descriptive metadata into 'desc'.","Use the v2 API for structured error responses."],"tags":["config","validation","tag","v1","length-limit","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}