{"record":{"id":"79575583f8b586e6","repo":"alibaba/nacos","slug":"invalid-protocolversion-protocolversion","errorCode":null,"errorMessage":"Invalid protocolVersion: {protocolVersion}","messagePattern":"Invalid protocolVersion: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java","lineNumber":148,"sourceCode":"     * @throws IllegalArgumentException when invalid\n     */\n    public static void validateProtocol(String protocol) {\n        if (protocol == null || protocol.length() > MAX_PROTOCOL_LENGTH\n            || !PROTOCOL_PATTERN.matcher(protocol).matches()) {\n            throw new IllegalArgumentException(\"Invalid protocol: \" + protocol);\n        }\n    }\n    \n    /**\n     * Validate an optional protocol-version value when present.\n     *\n     * @param protocolVersion protocol-version value\n     * @throws IllegalArgumentException when invalid\n     */\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    /**","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java#L130-L166","documentation":"Error \"Invalid protocolVersion: {protocolVersion}\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java:148 when the library encounters an invalid state.","commonSituations":"Validating an endpoint with an invalid protocolVersion value.","solutions":["Correct the invalid value for protocolVersion 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"}