{"record":{"id":"a4b81d404efd7799","repo":"micro/go-micro","slug":"rpc-can-t-find-method-method","errorCode":null,"errorMessage":"rpc: can't find method ${method}","messagePattern":"rpc: can't find method (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/rpc_router.go","lineNumber":442,"sourceCode":"\tserviceMethod := strings.Split(req.msg.Endpoint, \".\")\n\tif len(serviceMethod) != 2 {\n\t\terr = errors.New(\"rpc: service/endpoint request ill-formed: \" + req.msg.Endpoint)\n\t\treturn\n\t}\n\n\t// Look up the request.\n\trouter.mu.Lock()\n\tservice = router.serviceMap[serviceMethod[0]]\n\trouter.mu.Unlock()\n\n\tif service == nil {\n\t\terr = errors.New(\"rpc: can't find service \" + serviceMethod[0])\n\t\treturn\n\t}\n\n\tmtype = service.method[serviceMethod[1]]\n\tif mtype == nil {\n\t\terr = errors.New(\"rpc: can't find method \" + serviceMethod[1])\n\t}\n\n\treturn\n}\n\nfunc (router *router) NewHandler(h interface{}, opts ...HandlerOption) Handler {\n\treturn NewRpcHandler(h, opts...)\n}\n\nfunc (router *router) Handle(h Handler) error {\n\trouter.mu.Lock()\n\tdefer router.mu.Unlock()\n\n\tif router.serviceMap == nil {\n\t\trouter.serviceMap = make(map[string]*service)\n\t}\n\n\tif len(h.Name()) == 0 {","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/server/rpc_router.go#L424-L460","documentation":"The service was found in the router's serviceMap, but the method name (the part after the dot) has no matching registered method entry in service.method. The method either does not exist on the handler type or was not eligible for RPC registration.","triggerScenarios":"Calling Service.Method where Method is not an exported method of the registered handler, has a signature that failed method registration, or is simply misspelled in the endpoint.","commonSituations":"Method renamed or removed in a newer server version while clients call the old name; method unexported (lowercase) and therefore never registered; method signature not matching the RPC conventions so it was skipped during Handle; typo in method name.","solutions":["Check the endpoint's method name matches an exported method on the handler exactly","Ensure the method satisfies the library's RPC method signature requirements so it gets registered","Align client and server versions so the called method exists on the server","Log available methods for the service at registration time to debug mismatches"],"exampleFix":"// before\nmsg.Endpoint = \"Calculator.multiply\" // unexported, never registered\n// after\ntype Calculator struct{}\nfunc (c *Calculator) Multiply(args *Args, reply *int) error { ... }\nmsg.Endpoint = \"Calculator.Multiply\"","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := client.Call(ctx, \"Calculator.Multiply\", args, &reply)\nif err != nil {\n\tif strings.Contains(err.Error(), \"can't find method\") {\n\t\t// wrong method name or server version skew; surface to caller\n\t\treturn fmt.Errorf(\"method unavailable: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Keep client and server on compatible versions; bump both when renaming methods","Only call exported methods matching the RPC signature conventions","Generate client stubs from the server's registered methods instead of hand-writing names"],"tags":["rpc","routing","method-lookup"],"backgroundTag":"rpc-method-not-found","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}