{"record":{"id":"381a02bda2061562","repo":"micro/go-micro","slug":"registry-q-is-not-linked-into-this-binary-import","errorCode":null,"errorMessage":"registry %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins","messagePattern":"registry %q is not linked into this binary: import go-micro\\.dev/v6/cmd/defaults to enable flag-selected plugins","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cmd.go","lineNumber":491,"sourceCode":"\t\tauthOpts = append(authOpts, auth.PrivateKey(ctx.String(\"auth_private_key\")))\n\t}\n\tif len(ctx.String(\"auth_namespace\")) > 0 {\n\t\tauthOpts = append(authOpts, auth.Namespace(ctx.String(\"auth_namespace\")))\n\t}\n\tif name := ctx.String(\"auth\"); len(name) > 0 {\n\t\tr, ok := c.opts.Auths[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unsupported auth: %s\", name)\n\t\t}\n\n\t\t*c.opts.Auth = r(authOpts...)\n\t}\n\n\t// Set the registry\n\tif name := ctx.String(\"registry\"); len(name) > 0 && (*c.opts.Registry).String() != name {\n\t\tr, ok := c.opts.Registries[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"registry %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins\", name)\n\t\t}\n\n\t\tsopts, clopts := c.setRegistry(r())\n\t\tserverOpts = append(serverOpts, sopts...)\n\t\tclientOpts = append(clientOpts, clopts...)\n\t}\n\n\t// Set the debug profile\n\tif name := ctx.String(\"debug-profile\"); len(name) > 0 {\n\t\tp, ok := c.opts.DebugProfiles[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unsupported profile: %s\", name)\n\t\t}\n\t\t*c.opts.DebugProfile = p()\n\t}\n\n\t// Set the broker\n\tif name := ctx.String(\"broker\"); len(name) > 0 && (*c.opts.Broker).String() != name {","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/cmd/cmd.go#L473-L509","documentation":"The --registry flag is matched against c.opts.Registries, populated by registry plugins via init(). A name not present means that registry implementation is not compiled into this binary, so the CLI aborts with a message directing you to import go-micro.dev/v6/cmd/defaults.","triggerScenarios":"Passing --registry etcd/consul/mdns on a binary lacking that registry plugin, or a name mismatch with the current default registry (flag is only consulted when it differs from (*c.opts.Registry).String()).","commonSituations":"Switching from mdns to etcd for a production deploy using a defaults-free custom binary; version upgrades where the plugin path or registered name changed; typos in the registry name.","solutions":["Import _ \"go-micro.dev/v6/cmd/defaults\" (or the specific registry plugin, e.g. _ \"go-micro.dev/v6/plugins/registry/etcd\") and rebuild.","Verify the exact registered name (e.g. \"etcd\" not \"etcdv3\" depending on version).","Omit --registry to keep the current/default registry.","Ensure the registry server itself is irrelevant here — the error is purely about linking, not connectivity."],"exampleFix":"// before: custom binary without plugins\nmicro --registry etcd server\n// after: main.go\nimport _ \"go-micro.dev/v6/cmd/defaults\"\n// then:\nmicro --registry etcd server","handlingStrategy":"validation","validationCode":"allowedRegistries := map[string]bool{\"\": true, \"mdns\": true, \"etcd\": true /* linked */}\nif !allowedRegistries[*registryFlag] {\n    return fmt.Errorf(\"registry %q not linked; rebuild with cmd/defaults\", *registryFlag)\n}","typeGuard":null,"tryCatchPattern":"if err := c.Run(ctx); err != nil {\n    if strings.Contains(err.Error(), \"is not linked into this binary\") && strings.Contains(err.Error(), \"registry\") {\n        return fmt.Errorf(\"registry plugin missing: %w\", err)\n    }\n    return err\n}","preventionTips":["Ship binaries with go-micro.dev/v6/cmd/defaults imported when ops scripts use --registry.","Verify exact registry key names (e.g. \"etcd\" vs \"etcdv3\") per go-micro version.","Add deployment checks that run `micro --registry <name> --help` style validation before rollout."],"tags":["cli","registry","plugin-not-linked"],"backgroundTag":"plugin-not-linked","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}