apache/hadoop · error · RpcNoSuchMethodException

Unknown method {} called on {} protocol.

Error message

Unknown method {} called on {} protocol.

What it means

Server-side: processCall looks up the client-requested methodName in the protobuf BlockingService's descriptor; an unknown name logs a warning and throws RpcNoSuchMethodException, which travels back to the client as a RemoteException. It means the connection and protocol handshake succeeded but the server's version of the protocol has no such RPC — classically a client/server version skew or a hand-crafted call with a typo.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java:483

    }

    /**
     * This implementation is same as
     * ProtobufRpcEngine2.Server.ProtobufInvoker#call(..)
     * except this implementation uses non-shaded protobuf classes from legacy
     * protobuf version (default 2.5.0).
     */
    static RpcWritable processCall(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 (currentCallback.get() != null) {
          currentCall.deferResponse();
          currentCallback.set(null);
          return null;
        }

View on GitHub (pinned to 2add963021)

Solutions

  1. Align versions: run client jars matching the server's Hadoop version (or rely on the protobuf protocol's compatibility guarantees).
  2. If probing for capability, catch RemoteException whose cause is RpcNoSuchMethodException and fall back to the older API.
  3. For custom protocols, bump the protocol versionID when methods change so VersionMismatch surfaces instead.

Example fix

// before
try {
  response = proxy.newMethodAddedInHadoop3(req);
} catch (RemoteException e) {
  throw e; // crashes on older NameNode: Unknown method newMethodAddedInHadoop3
}

// after
try {
  response = proxy.newMethodAddedInHadoop3(req);
} catch (RemoteException e) {
  if (e.getErrorCode().equals(RpcNoSuchMethodException.class.getName())) {
    response = legacyFallbackPath(req); // capability probe pattern
  } else { throw e; }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  return proxy.maybeNewMethod(req);
} catch (RemoteException e) {
  if (RpcNoSuchMethodException.class.getName().equals(e.getErrorCode())) {
    return legacyFallback(req); // server version lacks the method
  }
  throw e;
}

Prevention

When it happens

Trigger: A newer client calls an RPC method added after the running server's version (e.g., new HDFS API used against an older NameNode); a method removed/renamed across protocol versions; reflective or manual RPC clients sending a wrong method-name string.

Common situations: Rolling upgrades where applications run new client jars against old daemons; mixing Hadoop minor versions in tooling; custom protobuf protocols after a rename without bumping protocol version; tools probing servers for capability by calling methods speculatively.

Related errors


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