go module_error ai_generated true

rpc error: code = Unimplemented desc = method SayHello not implemented

ID: go/grpc-unimplemented-service-method

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-02-28First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.21 active
1.22 active

Root Cause

The gRPC server does not have a handler registered for the invoked RPC method, possibly due to missing registration or incorrect service name.

generic

中文

gRPC服务器未注册调用的RPC方法的处理程序,可能是由于缺少注册或服务名称错误。

Workarounds

  1. 95% success Ensure the server registers the service with the correct generated code.
    grpcServer := grpc.NewServer()
    pb.RegisterGreeterServer(grpcServer, &myGreeterServer{})
  2. 90% success Verify the proto file and regenerate stubs if method was added recently.
    protoc --go_out=. --go-grpc_out=. *.proto

Dead Ends

Common approaches that don't work:

  1. Restarting the server without changing code. 100% fail

    The handler is still missing; restart doesn't add it.

  2. Checking client method name only, ignoring server registration. 90% fail

    The server must register the method; client alone can't fix it.