{"record":{"id":"f3f355cfcf01b0eb","repo":"grpc-ecosystem/grpc-gateway","slug":"no-message-found-s","errorCode":null,"errorMessage":"no message found: %s","messagePattern":"no message found: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/descriptor/registry.go","lineNumber":359,"sourceCode":"\t\t}\n\t\tfile.Enums = append(file.Enums, e)\n\t\tr.enums[e.FQEN()] = e\n\t\tif grpclog.V(1) {\n\t\t\tgrpclog.Infof(\"Register enum name: %s\", e.FQEN())\n\t\t}\n\t}\n}\n\n// LookupMsg looks up a message type by \"name\".\n// It tries to resolve \"name\" from \"location\" if \"name\" is a relative message name.\nfunc (r *Registry) LookupMsg(location, name string) (*Message, error) {\n\tif grpclog.V(1) {\n\t\tgrpclog.Infof(\"Lookup %s from %s\", name, location)\n\t}\n\tif strings.HasPrefix(name, \".\") {\n\t\tm, ok := r.msgs[name]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no message found: %s\", name)\n\t\t}\n\t\treturn m, nil\n\t}\n\n\tif !strings.HasPrefix(location, \".\") {\n\t\tlocation = fmt.Sprintf(\".%s\", location)\n\t}\n\tcomponents := strings.Split(location, \".\")\n\tfor len(components) > 0 {\n\t\tfqmn := strings.Join(append(components, name), \".\")\n\t\tif m, ok := r.msgs[fqmn]; ok {\n\t\t\treturn m, nil\n\t\t}\n\t\tcomponents = components[:len(components)-1]\n\t}\n\treturn nil, fmt.Errorf(\"no message found: %s\", name)\n}\n","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/descriptor/registry.go#L341-L377","documentation":"Registry.LookupMsg fails when the requested message name starts with '.' (a fully-qualified name) and is not present in the registry's message map. It means no message with that exact fully-qualified name was loaded from any proto file.","triggerScenarios":"LookupMsg(location, name) with name like '.example.hello.HelloRequest' when that message was never loaded (missing proto file) or the fully-qualified name is misspelled (wrong package or nested path).","commonSituations":"Referencing a message from a proto file not passed to the registry; package renamed in proto but not in annotations/config; typos in .proto FQMN in grpc API configuration files.","solutions":["Load the proto file that defines the message (registry.LoadFile / pass it to protoc)","Verify the fully-qualified name matches package + message (and nesting) exactly","Check for package renames and update references","Enable grpclog V(1) logging to see lookup location context"],"exampleFix":"// before (message not loaded)\nreg.LoadFile(\"service.proto\")\nm, err := reg.LookupMsg(\".example.hello.Greeter\", \".example.hello.MissingRequest\")\n// after\nreg.LoadFile(\"message.proto\") // defines .example.hello.MissingRequest\nreg.LoadFile(\"service.proto\")\nm, err := reg.LookupMsg(\".example.hello.Greeter\", \".example.hello.MissingRequest\")","handlingStrategy":"try-catch","validationCode":"func hasMsg(reg *Registry, fqmn string) bool {\n    _, err := reg.LookupMsg(\".\", fqmn)\n    return err == nil\n}","typeGuard":null,"tryCatchPattern":"m, err := reg.LookupMsg(loc, \".example.hello.HelloRequest\")\nif err != nil {\n    return fmt.Errorf(\"message %s not loaded: ensure its proto file is loaded first: %w\", name, err)\n}","preventionTips":["Load all dependency protos before lookups","Use fully-qualified names matching package+nesting exactly","Update configs when renaming packages","Enable grpclog.V(1) while debugging lookups"],"tags":["protobuf","registry","message-lookup"],"backgroundTag":"message-not-found","analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}