apache/hadoop · error · RpcNoSuchMethodException

Unknown method ${methodName} called on ${connectionProtocolN

Error message

Unknown method ${methodName} called on ${connectionProtocolName} protocol.

What it means

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.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine2.java:620

        //Legacy protobuf implementation. Handle using legacy (Non-shaded)
        // protobuf classes.
        return ProtobufRpcEngine.Server
            .processCall(server, connectionProtocolName, request, methodName,
                protocolImpl);
      }

      private RpcWritable call(RPC.Server server,
          String connectionProtocolName, RpcWritable.Buffer request,
          String methodName, ProtoClassProtoImpl protocolImpl)
          throws Exception {
        BlockingService service = (BlockingService) protocolImpl.protocolImpl;
        MethodDescriptor methodDescriptor = service.getDescriptorForType()
            .findMethodByName(methodName);
        if (methodDescriptor == null) {
          String msg = "Unknown method " + methodName + " called on "
                                + connectionProtocolName + " protocol.";
          LOG.warn(msg);
          throw new RpcNoSuchMethodException(msg);
        }
        Message prototype = service.getRequestPrototype(methodDescriptor);
        Message param = request.getValue(prototype);

        Message result;
        Call currentCall = Server.getCurCall().get();
        try {
          server.rpcDetailedMetrics.init(protocolImpl.protocolClass);
          CURRENT_CALL_INFO.set(new CallInfo(server, methodName));
          currentCall.setDetailedMetricsName(methodName);
          result = service.callBlockingMethod(methodDescriptor, null, param);
          // Check if this needs to be a deferred response,
          // by checking the ThreadLocal callback being set
          if (CURRENT_CALLBACK.get() != null) {
            currentCall.deferResponse();
            CURRENT_CALLBACK.set(null);
            return null;
          }

View on GitHub (pinned to 2add963021)

Solutions

  1. Match client and server jars/generated-code for the protocol, or complete the rolling upgrade.
  2. For optional capabilities, catch RemoteException with RpcNoSuchMethodException and fall back.
  3. Regenerate and redeploy protobuf code on both sides together; bump protocol version on incompatible changes.

Example fix

// before
boolean supports = proxy.erasureCoding(req) != null; // throws on old NameNode

// after
boolean supports;
try {
  supports = proxy.erasureCoding(req) != null;
} catch (RemoteException e) {
  if (RpcNoSuchMethodException.class.getName().equals(e.getErrorCode())) {
    supports = false; // server predates this method
  } else { throw e; }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  return proxy.methodAddedLater(req);
} catch (RemoteException e) {
  if (RpcNoSuchMethodException.class.getName().equals(e.getErrorCode())) {
    return fallbackPath(req);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: During rolling upgrades (old daemons, new client jars); after regenerating protobuf without redeploying both sides; tools probing optional RPC capabilities.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/65ad40c84bfdaca1. Report an issue: GitHub.