micro/go-micro · error

unsupported profile

Error message

unsupported profile: %s

What it means

The --debug-profile flag selects an entry from c.opts.DebugProfiles; unknown names produce this error. Debug profiles are registered by plugin packages, so only linked ones are valid.

Solutions

  1. Correct the profile name spelling against available DebugProfiles registrations.
  2. Import the package that registers the debug profile (or go-micro.dev/v6/cmd/defaults) and rebuild.
  3. Omit --debug-profile if debugging output is not needed.
  4. Check the go-micro version's profile list if following older documentation.

Example fix

// before
micro --debug-profile net server
// after: link it
import _ "go-micro.dev/v6/cmd/defaults" // registers debug profiles
// or omit the flag:
micro server
Defensive patterns

Strategy: validation

Validate before calling

allowedDebugProfiles := map[string]bool{"": true, "net": true /* linked */}
if !allowedDebugProfiles[*debugProfileFlag] {
    return fmt.Errorf("debug profile %q not registered in this binary", *debugProfileFlag)
}

Try / catch

if err := c.Run(ctx); err != nil {
    if strings.HasPrefix(err.Error(), "unsupported profile:") {
        return fmt.Errorf("%w (import the package registering this debug profile)", err)
    }
    return err
}

Prevention

When it happens

Trigger: Passing --debug-profile net (or any name) that no imported package registered into c.opts.DebugProfiles, or misspelling the profile name.

Common situations: Copying example CLI invocations from docs without importing the matching debug profile package; typos; debugging scripts that reference profiles removed in a newer go-micro version.

Related errors


AI-assisted analysis of micro/go-micro@24529f1404 (2026-09-01). Data as JSON: /api/errors/65f79842e54d3149. Report an issue: GitHub.

Appendix: source

Thrown at cmd/cmd.go:503

	}

	// Set the registry
	if name := ctx.String("registry"); len(name) > 0 && (*c.opts.Registry).String() != name {
		r, ok := c.opts.Registries[name]
		if !ok {
			return fmt.Errorf("registry %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins", name)
		}

		sopts, clopts := c.setRegistry(r())
		serverOpts = append(serverOpts, sopts...)
		clientOpts = append(clientOpts, clopts...)
	}

	// Set the debug profile
	if name := ctx.String("debug-profile"); len(name) > 0 {
		p, ok := c.opts.DebugProfiles[name]
		if !ok {
			return fmt.Errorf("unsupported profile: %s", name)
		}
		*c.opts.DebugProfile = p()
	}

	// Set the broker
	if name := ctx.String("broker"); len(name) > 0 && (*c.opts.Broker).String() != name {
		b, ok := c.opts.Brokers[name]
		if !ok {
			return fmt.Errorf("broker %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins", name)
		}
		sopts, clopts := c.setBroker(b())
		serverOpts = append(serverOpts, sopts...)
		clientOpts = append(clientOpts, clopts...)
	}

	// Set the selector
	if name := ctx.String("selector"); len(name) > 0 && (*c.opts.Selector).String() != name {
		s, ok := c.opts.Selectors[name]

View on GitHub (pinned to 24529f1404)