{"record":{"id":"65ad40c84bfdaca1","repo":"apache/hadoop","slug":"unknown-method-methodname-called-on-connectio","errorCode":null,"errorMessage":"Unknown method ${methodName} called on ${connectionProtocolName} protocol.","messagePattern":"Unknown method (.+?) called on (.+?) protocol\\.","errorType":"exception","errorClass":"RpcNoSuchMethodException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine2.java","lineNumber":620,"sourceCode":"        //Legacy protobuf implementation. Handle using legacy (Non-shaded)\n        // protobuf classes.\n        return ProtobufRpcEngine.Server\n            .processCall(server, connectionProtocolName, request, methodName,\n                protocolImpl);\n      }\n\n      private RpcWritable call(RPC.Server server,\n          String connectionProtocolName, RpcWritable.Buffer request,\n          String methodName, ProtoClassProtoImpl protocolImpl)\n          throws Exception {\n        BlockingService service = (BlockingService) protocolImpl.protocolImpl;\n        MethodDescriptor methodDescriptor = service.getDescriptorForType()\n            .findMethodByName(methodName);\n        if (methodDescriptor == null) {\n          String msg = \"Unknown method \" + methodName + \" called on \"\n                                + connectionProtocolName + \" protocol.\";\n          LOG.warn(msg);\n          throw new RpcNoSuchMethodException(msg);\n        }\n        Message prototype = service.getRequestPrototype(methodDescriptor);\n        Message param = request.getValue(prototype);\n\n        Message result;\n        Call currentCall = Server.getCurCall().get();\n        try {\n          server.rpcDetailedMetrics.init(protocolImpl.protocolClass);\n          CURRENT_CALL_INFO.set(new CallInfo(server, methodName));\n          currentCall.setDetailedMetricsName(methodName);\n          result = service.callBlockingMethod(methodDescriptor, null, param);\n          // Check if this needs to be a deferred response,\n          // by checking the ThreadLocal callback being set\n          if (CURRENT_CALLBACK.get() != null) {\n            currentCall.deferResponse();\n            CURRENT_CALLBACK.set(null);\n            return null;\n          }","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine2.java#L602-L638","documentation":"Server-side in ProtobufRpcEngine2's call path: after the protocol resolves, the methodName is looked up in the BlockingService descriptor; a miss logs a warning and throws RpcNoSuchMethodException('Unknown method M called on P protocol.'), delivered to the client as a RemoteException. Connection-level negotiation passed, so this is a method-level mismatch — typically client newer than server or a renamed method.","triggerScenarios":"Newer Hadoop client invoking a method absent from the server's generated BlockingService; custom protocol where method names diverge between client and server generated code; a manual/reflective RPC sending a mistyped method name.","commonSituations":"During rolling upgrades (old daemons, new client jars); after regenerating protobuf without redeploying both sides; tools probing optional RPC capabilities.","solutions":["Match client and server jars/generated-code for the protocol, or complete the rolling upgrade.","For optional capabilities, catch RemoteException with RpcNoSuchMethodException and fall back.","Regenerate and redeploy protobuf code on both sides together; bump protocol version on incompatible changes."],"exampleFix":"// before\nboolean supports = proxy.erasureCoding(req) != null; // throws on old NameNode\n\n// after\nboolean supports;\ntry {\n  supports = proxy.erasureCoding(req) != null;\n} catch (RemoteException e) {\n  if (RpcNoSuchMethodException.class.getName().equals(e.getErrorCode())) {\n    supports = false; // server predates this method\n  } else { throw e; }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return proxy.methodAddedLater(req);\n} catch (RemoteException e) {\n  if (RpcNoSuchMethodException.class.getName().equals(e.getErrorCode())) {\n    return fallbackPath(req);\n  }\n  throw e;\n}","preventionTips":["During rolling upgrades, wrap newly added RPC calls in the RpcNoSuchMethodException catch and fall back.","Regenerate protobuf code and deploy client+server together for custom protocols.","Bump protocol versionID on rename/removal so clients fail at handshake, not mid-call."],"tags":["hadoop","ipc","rpc","protobuf","version-mismatch","server","protobuf-rpc-engine2"],"backgroundTag":"rpc-version-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}