{"record":{"id":"9d2b8a92573e6025","repo":"alibaba/nacos","slug":"invalid-label-label","errorCode":null,"errorMessage":"Invalid label: {label}","messagePattern":"Invalid label: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java","lineNumber":162,"sourceCode":"     */\n    public static void validateProtocolVersion(String protocolVersion) {\n        if (protocolVersion == null || protocolVersion.isEmpty()\n            || protocolVersion.length() > MAX_PROTOCOL_VERSION_LENGTH) {\n            throw new IllegalArgumentException(\"Invalid protocolVersion: \" + protocolVersion);\n        }\n        validatePrintableAscii(protocolVersion, \"protocolVersion\");\n    }\n    \n    /**\n     * Validate a version label, including the server-managed {@code latest} label.\n     *\n     * @param label version label\n     * @throws IllegalArgumentException when invalid\n     */\n    public static void validateLabel(String label) {\n        if (label == null || label.length() > MAX_LABEL_LENGTH\n            || !LABEL_PATTERN.matcher(label).matches()) {\n            throw new IllegalArgumentException(\"Invalid label: \" + label);\n        }\n    }\n    \n    /**\n     * Validate a client-writable version label.\n     *\n     * @param label version label\n     * @throws IllegalArgumentException when invalid or reserved\n     */\n    public static void validateNonLatestLabel(String label) {\n        validateLabel(label);\n        if (\"latest\".equals(label)) {\n            throw new IllegalArgumentException(\"The latest label is server-managed\");\n        }\n    }\n    \n    /**\n     * Validate a transport token without changing its case.","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java#L144-L180","documentation":"Error \"Invalid label: {label}\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java:162 when the library encounters an invalid state.","commonSituations":"Binding or updating a version label that fails the label syntax rules.","solutions":["Correct the invalid value for label validation to match the expected format or allowed set, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}