{"record":{"id":"51fc00226e46b21a","repo":"apache/dolphinscheduler","slug":"cannot-find-method-rpcname-from-service-service","errorCode":null,"errorMessage":"cannot find method <rpcName> from service <serviceName> with method list: [methods]","messagePattern":"cannot find method <rpcName> from service <serviceName> with method list: \\[methods\\]","errorType":"exception","errorClass":"GrpcParserException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/protobufjs/GrpcDynamicService.java","lineNumber":62,"sourceCode":"    Descriptors.FileDescriptor fileDescriptor;\n    ManagedChannel channel;\n\n    public GrpcDynamicService(ManagedChannel channel, Descriptors.FileDescriptor fileDesc) {\n        this.fileDescriptor = fileDesc;\n        this.channel = channel;\n    }\n\n    public DynamicMessage call(String methodNameWithService, String messageJSON, long timeout) {\n        MethodName methodNameData = new MethodName(methodNameWithService);\n        Descriptors.ServiceDescriptor pServiceDescriptor =\n                fileDescriptor.findServiceByName(methodNameData.getServiceName());\n        if (isNull(pServiceDescriptor))\n            throw new GrpcParserException(\n                    \"cannot find service <\" + methodNameData.getServiceName() + \"> from service definition\");\n        Descriptors.MethodDescriptor pMethodDescriptor =\n                pServiceDescriptor.findMethodByName(methodNameData.getRpcName());\n        if (isNull(pMethodDescriptor))\n            throw new GrpcParserException(\"cannot find method <\" + methodNameData.getRpcName() + \"> from service <\"\n                    + methodNameData.getServiceName() + \"> with method list: \" + Arrays.toString(pServiceDescriptor\n                            .getMethods().stream().map(Descriptors.MethodDescriptor::getName).toArray()));\n        MethodDescriptor<DynamicMessage, DynamicMessage> methodDescriptor =\n                methodFromProtobuf(pServiceDescriptor, pMethodDescriptor);\n        Descriptors.Descriptor requestMessageType = pMethodDescriptor.getInputType();\n        Descriptors.Descriptor responseMessageType = pMethodDescriptor.getOutputType();\n        DynamicMessage.Builder requestBuilder = DynamicMessage.newBuilder(requestMessageType);\n        DynamicMessage.Builder responseBuilder = DynamicMessage.newBuilder(responseMessageType);\n        try {\n            JsonFormat.parser().ignoringUnknownFields().merge(messageJSON, requestBuilder);\n        } catch (InvalidProtocolBufferException ipbe) {\n            throw new GrpcParserException(\n                    \"cannot merge json message to protobuf definition type <\" + requestMessageType.getName() + \">\",\n                    ipbe);\n        }\n        DynamicMessage request = requestBuilder.build();\n        CallOptions callOptions = timeout > 0 ? CallOptions.DEFAULT.withDeadlineAfter(timeout, TimeUnit.MILLISECONDS)\n                : CallOptions.DEFAULT;","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/protobufjs/GrpcDynamicService.java#L44-L80","documentation":"After the service descriptor is found, call() looks up the RPC method on it with findMethodByName(). If the rpc part of 'Service.rpc' does not match any method declared in that service, GrpcParserException is thrown and the message helpfully includes the list of valid method names.","triggerScenarios":"Calling GrpcDynamicService.call('ServiceName.rpcName', ...) where serviceName resolves but rpcName is misspelled, wrong case, or simply not an rpc defined inside that service.","commonSituations":"Calling the rpc name instead of the fully-qualified name convention expected (or vice versa); proto was regenerated and the rpc was renamed; copy-pasted method string from a different service; case mismatch (e.g. getuser vs GetUser).","solutions":["Read the method list printed in the exception message and use one of those exact names.","Fix the rpc name spelling/casing in the methodNameWithService string to match the 'rpc X (...)' declaration in the .proto.","Confirm the rpc belongs to the service you specified — you may have the right method on a different service.","If the rpc was renamed in a newer proto, update the task configuration accordingly."],"exampleFix":"// before\ngrpcTask.call(\"UserService.getUsr\", json, 3000);\n// after\ngrpcTask.call(\"UserService.getUser\", json, 3000);","handlingStrategy":"validation","validationCode":"Descriptors.ServiceDescriptor svc = fileDescriptor.findServiceByName(serviceName);\nif (svc != null && svc.findMethodByName(rpcName) == null) {\n    throw new IllegalArgumentException(\"Unknown rpc \" + rpcName + \" in \" + serviceName\n        + \"; available: \" + Arrays.toString(svc.getMethods().stream()\n            .map(Descriptors.MethodDescriptor::getName).toArray()));\n}","typeGuard":null,"tryCatchPattern":"try {\n    dynamicService.call(methodNameWithService, json, timeout);\n} catch (GrpcParserException e) {\n    if (e.getMessage().contains(\"cannot find method\")) {\n        // parse the method list from the message and suggest the closest name\n    }\n    throw e;\n}","preventionTips":["Copy the rpc name directly from the .proto file instead of typing it from memory.","Match exact casing — proto rpc names are case-sensitive.","When the proto changes, grep configs for the old rpc name and update them."],"tags":["grpc","protobuf","method-not-found","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}