{"record":{"id":"c4f75a780dcd85e8","repo":"micro/go-micro","slug":"rpc-service-endpoint-request-ill-formed-endpoi","errorCode":null,"errorMessage":"rpc: service/endpoint request ill-formed: ${endpoint}","messagePattern":"rpc: service/endpoint request ill-formed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/rpc_router.go","lineNumber":426,"sourceCode":"\n\terr = cc.ReadHeader(msg, msg.Type)\n\tif err != nil {\n\t\treq = nil\n\t\tif err == io.EOF || err == io.ErrUnexpectedEOF {\n\t\t\treturn\n\t\t}\n\t\terr = errors.New(\"rpc: router cannot decode request: \" + err.Error())\n\n\t\treturn\n\t}\n\n\t// We read the header successfully. If we see an error now,\n\t// we can still recover and move on to the next request.\n\tkeepReading = true\n\n\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","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/server/rpc_router.go#L408-L444","documentation":"This error means the RPC request's Endpoint field did not contain exactly one dot separating service name from method name. The router splits req.msg.Endpoint on '.' and requires exactly two parts; anything else is ill-formed and cannot be routed. The connection is kept alive (keepReading=true) so the client can send further requests.","triggerScenarios":"Sending a request whose endpoint string has no dot (\"MyService\"), more than one dot (\"pkg/MyService.Method\" or \"Service.Method.Extra\"), or an empty endpoint.","commonSituations":"Hand-rolled RPC clients that forget the Service.Method format; endpoints copied from code paths containing package qualifiers or slashes; a client library upgrade that changed endpoint encoding; empty endpoint due to unset config field.","solutions":["Send the endpoint as exactly \"ServiceName.MethodName\" with a single dot","Trim any package path or namespace prefix from the service name before sending","Log req.msg.Endpoint on the client before dispatch to confirm the wire format","If using a custom codec, ensure it does not mangle or split the endpoint field"],"exampleFix":"// before\nmsg.Endpoint = \"mypackage/MyService.Calculate\"\n// after\nmsg.Endpoint = \"MyService.Calculate\"","handlingStrategy":"validation","validationCode":"func validEndpoint(ep string) bool {\n\tparts := strings.Split(ep, \".\")\n\treturn len(parts) == 2 && parts[0] != \"\" && parts[1] != \"\"\n}\nif !validEndpoint(msg.Endpoint) { return fmt.Errorf(\"bad endpoint: %q\", msg.Endpoint) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build endpoints from constants: serviceName + \".\" + methodName","Never embed package paths, slashes, or version suffixes in the endpoint","Add a client-side assertion on endpoint format before dispatch"],"tags":["rpc","protocol","request-format"],"backgroundTag":"malformed-rpc-endpoint","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}