grpc-ecosystem/grpc-gateway · error

no message %s found

Error message

no message %s found

What it means

Message-level options are validated against the registry's map of loaded messages (r.msgs, keyed by fully-qualified name). An entry in opts.Message whose qualified name is absent produces this error, preventing silent no-op option application.

Source

Thrown at internal/descriptor/registry.go:789

			services[s.FQSN()] = struct{}{}
			for _, m := range s.Methods {
				methods[m.FQMN()] = struct{}{}
			}
		}
	}

	for _, opt := range opts.Method {
		qualifiedMethod := "." + opt.Method
		if _, ok := methods[qualifiedMethod]; !ok {
			return fmt.Errorf("no method %s found", opt.Method)
		}
		r.methodOptions[qualifiedMethod] = opt.Option
	}

	for _, opt := range opts.Message {
		qualifiedMessage := "." + opt.Message
		if _, ok := r.msgs[qualifiedMessage]; !ok {
			return fmt.Errorf("no message %s found", opt.Message)
		}
		r.messageOptions[qualifiedMessage] = opt.Option
	}

	for _, opt := range opts.Service {
		qualifiedService := "." + opt.Service
		if _, ok := services[qualifiedService]; !ok {
			return fmt.Errorf("no service %s found", opt.Service)
		}
		r.serviceOptions[qualifiedService] = opt.Option
	}

	// build map of all registered fields
	fields := make(map[string]struct{})
	for _, m := range r.msgs {
		for _, f := range m.Fields {
			fields[f.FQFN()] = struct{}{}
		}

View on GitHub (pinned to a58a4436a3)

Solutions

  1. Use the fully-qualified message name including its proto package (pkg.Outer.Inner)
  2. Confirm the message exists in a file loaded into this registry
  3. Update the options config after renames/deletions
  4. Dump the registry's known messages and compare with your options entries

Example fix

// before
Message: "GreetingRequest"
// after
Message: "examples.library.v1.GreetingRequest"
Defensive patterns

Strategy: validation

Validate before calling

want := "." + opt.Message
if !knownMessages[want] {
    return fmt.Errorf("message %q not found; use fully-qualified pkg.Message", opt.Message)
}
err = reg.RegisterOptions(opts)

Prevention

When it happens

Trigger: Registering options with opts.Message naming a message that is not defined in any loaded file, is misspelled, or lacks its package prefix (lookup is done with '.' + opt.Message against FQMN keys).

Common situations: Message moved/renamed during a refactor; referencing a message from an unloaded dependency; forgetting the proto package prefix; typos in nested message paths.

Related errors


AI-assisted analysis of grpc-ecosystem/grpc-gateway@a58a4436a3 (2026-09-02). Data as JSON: /api/errors/b7d3b285e934cabd. Report an issue: GitHub.