{"record":{"id":"b87a954e7aade250","repo":"grpc/grpc-go","slug":"error-in-clientrpcevent-method-v","errorCode":null,"errorMessage":"error in clientRPCEvent method: %v","messagePattern":"error in clientRPCEvent method: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gcp/observability/config.go","lineNumber":97,"sourceCode":"\t\t\tif exclude {\n\t\t\t\treturn errors.New(\"cannot have exclude and a '*' wildcard\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err := validateMethodString(method); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid method string: %v, err: %v\", method, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateLoggingEvents(config *config) error {\n\tif config.CloudLogging == nil {\n\t\treturn nil\n\t}\n\tfor _, clientRPCEvent := range config.CloudLogging.ClientRPCEvents {\n\t\tif err := validateLogEventMethod(clientRPCEvent.Methods, clientRPCEvent.Exclude); err != nil {\n\t\t\treturn fmt.Errorf(\"error in clientRPCEvent method: %v\", err)\n\t\t}\n\t}\n\tfor _, serverRPCEvent := range config.CloudLogging.ServerRPCEvents {\n\t\tif err := validateLogEventMethod(serverRPCEvent.Methods, serverRPCEvent.Exclude); err != nil {\n\t\t\treturn fmt.Errorf(\"error in serverRPCEvent method: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// unmarshalAndVerifyConfig unmarshals a json string representing an\n// observability config into its internal go format, and also verifies the\n// configuration's fields for validity.\nfunc unmarshalAndVerifyConfig(rawJSON json.RawMessage) (*config, error) {\n\tvar config config\n\tif err := json.Unmarshal(rawJSON, &config); err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing observability config: %v\", err)\n\t}","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/gcp/observability/config.go#L79-L115","documentation":"validateLoggingEvents validates every entry in config.CloudLogging.ClientRPCEvents; if any method string in a client event's Methods list fails validateLogEventMethod (see error 210), it returns the failure wrapped as \"error in clientRPCEvent method: <cause>\". Identical root cause as 210 but specifically scoped to the client_rpc_events array.","triggerScenarios":"GRPC_GCP_OBSERVABILITY_CONFIG (or the *_FILE) contains a client_rpc_events entry whose methods list has an invalid pattern (leading slash, missing/extra slash, empty method, or service wildcard).","commonSituations":"Mirroring the gRPC method path (with leading slash) into the observability config; mixing the wire format and the config format across environments.","solutions":["Apply the fixes for error 210 to every entry under client_rpc_events.","Run the config through a validator that calls validateLogEventMethod-equivalent logic before deploying.","If using Exclude, remember \"*\" is not allowed with Exclude; replace with explicit method lists."],"exampleFix":"// before\n{ \"cloud_logging\": { \"client_rpc_events\": [{ \"methods\": [\"*/Bar\"] }] } }\n\n// after\n{ \"cloud_logging\": { \"client_rpc_events\": [{ \"methods\": [\"goo.Foo/Bar\"] }] } }","handlingStrategy":"validation","validationCode":"func validateClientRPCEvents(events []clientRPCEvents) error {\n    for _, e := range events {\n        if err := validateLogEventMethod(e.Methods, e.Exclude); err != nil {\n            return fmt.Errorf(\"client event: %w\", err)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := validateLoggingEvents(cfg); err != nil {\n    return fmt.Errorf(\"observability config: %w\", err)\n}","preventionTips":["Run the same validateLogEventMethod rules over your config in CI.","Keep client and server event lists in sync to avoid drift.","Remember Exclude + \"*\" is illegal."],"tags":["grpc","observability","cloud-logging","config","validation","gcp"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}