{"record":{"id":"54211aad4d7f7618","repo":"alibaba/nacos","slug":"invalid-param-54211a","errorCode":"INVALID_PARAM","errorMessage":"Unsupported request type %s","messagePattern":"Unsupported request type (.+?)","errorType":"validation","errorClass":"NacosException","httpStatus":null,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/handler/NamingFuzzyWatchRequestHandler.java","lineNumber":95,"sourceCode":"                \n                boolean reachToUpLimit =\n                    namingFuzzyWatchContextService.reachToUpLimit(groupKeyPattern);\n                if (reachToUpLimit) {\n                    NamingFuzzyWatchResponse namingFuzzyWatchResponse =\n                        new NamingFuzzyWatchResponse();\n                    namingFuzzyWatchResponse.setErrorInfo(\n                        FUZZY_WATCH_PATTERN_MATCH_COUNT_OVER_LIMIT.getCode(),\n                        FUZZY_WATCH_PATTERN_MATCH_COUNT_OVER_LIMIT.getMsg());\n                    return namingFuzzyWatchResponse;\n                }\n                \n                return NamingFuzzyWatchResponse.buildSuccessResponse();\n            case WATCH_TYPE_CANCEL_WATCH:\n                namingFuzzyWatchContextService.removeFuzzyWatchContext(groupKeyPattern,\n                    meta.getConnectionId());\n                return NamingFuzzyWatchResponse.buildSuccessResponse();\n            default:\n                throw new NacosException(NacosException.INVALID_PARAM,\n                    String.format(\"Unsupported request type %s\", request.getWatchType()));\n        }\n    }\n}\n","sourceCodeStart":77,"sourceCodeEnd":100,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/handler/NamingFuzzyWatchRequestHandler.java#L77-L100","documentation":"Thrown by NamingFuzzyWatchRequestHandler.handle() when a fuzzy-watch gRPC request has a watchType other than INIT_WATCH or CANCEL_WATCH. The switch covers only those two; any other value hits default and raises NacosException.INVALID_PARAM with the bad watchType. Usually a client/server version mismatch on the fuzzy-watch feature.","triggerScenarios":"Client sends a NamingFuzzyWatchRequest whose watchType is not a recognized constant.","commonSituations":"Client SDK and server on different versions where fuzzy-watch constants diverged; an old client against a new server (or vice versa) that does not know the watchType values; a custom gRPC client sending the wrong enum/integer.","solutions":["Set watchType to a supported value (INIT_WATCH to start, CANCEL_WATCH to stop).","Upgrade/align client and server to the same Nacos version.","Confirm the fuzzy-watch feature is enabled on the server before using it."],"exampleFix":"// before\nNamingFuzzyWatchRequest req = new NamingFuzzyWatchRequest(pattern, 99);\n// after\nNamingFuzzyWatchRequest req = new NamingFuzzyWatchRequest(pattern,\n    NamingFuzzyWatchRequest.WatchType.INIT_WATCH);","handlingStrategy":"type-guard","validationCode":"int w = request.getWatchType();\nif (w != NamingFuzzyWatchRequest.WatchType.INIT_WATCH.getType()\n    && w != NamingFuzzyWatchRequest.WatchType.CANCEL_WATCH.getType()) {\n    throw new IllegalArgumentException(\"Unsupported fuzzy-watch watchType: \" + w);\n}","typeGuard":"static boolean isSupportedWatchType(int t) {\n    return t == NamingFuzzyWatchRequest.WatchType.INIT_WATCH.getType()\n        || t == NamingFuzzyWatchRequest.WatchType.CANCEL_WATCH.getType();\n}","tryCatchPattern":"try {\n    client.fuzzyWatch(pattern, listener);\n} catch (NacosException e) {\n    if (e.getErrCode() == NacosException.INVALID_PARAM\n        && e.getMessage().contains(\"Unsupported request type\")) {\n        // verify server supports fuzzy-watch and versions match\n    } else {\n        throw e;\n    }\n}","preventionTips":["Confirm the server version supports fuzzy-watch before using it.","Align client/server versions.","Use the SDK fuzzy-watch API rather than hand-built requests."],"tags":["naming","grpc","validation","invalid-param","fuzzy-watch"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}