{"record":{"id":"ad44f03fe40fbc24","repo":"micro/go-micro","slug":"store-q-is-not-linked-into-this-binary-import-go","errorCode":null,"errorMessage":"store %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins","messagePattern":"store %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":445,"sourceCode":"\t\t// only change if we have the client and type differs\n\t\tif cl, ok := c.opts.Clients[name]; ok && (*c.opts.Client).String() != name {\n\t\t\t*c.opts.Client = cl()\n\t\t}\n\t}\n\n\t// Set the server\n\tif name := ctx.String(\"server\"); len(name) > 0 {\n\t\t// only change if we have the server and type differs\n\t\tif s, ok := c.opts.Servers[name]; ok && (*c.opts.Server).String() != name {\n\t\t\t*c.opts.Server = s()\n\t\t}\n\t}\n\n\t// Set the store\n\tif name := ctx.String(\"store\"); len(name) > 0 {\n\t\ts, ok := c.opts.Stores[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"store %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\t*c.opts.Store = s(store.WithClient(*c.opts.Client))\n\t}\n\n\t// Set the tracer\n\tif name := ctx.String(\"tracer\"); len(name) > 0 {\n\t\tr, ok := c.opts.Tracers[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unsupported tracer: %s\", name)\n\t\t}\n\n\t\t*c.opts.Tracer = r()\n\t}\n\n\t// Setup auth\n\tauthOpts := []auth.Option{}\n","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/cmd/cmd.go#L427-L463","documentation":"When --store <name> is passed, the CLI looks the name up in the map of store constructors registered via plugin init() functions. Unregistered names produce this error, which explicitly says the store plugin is not compiled into the binary and points at importing go-micro.dev/v6/cmd/defaults.","triggerScenarios":"Running the micro CLI with --store etcd (or redis, etc.) on a binary that never imported the store plugin package, so c.opts.Stores contains no entry for that name.","commonSituations":"Using a minimal micro binary (defaults not linked); custom binary in main.go that imports only a subset of plugins; renaming/upgrading where the store plugin name changed.","solutions":["Add import _ \"go-micro.dev/v6/cmd/defaults\" to your binary's main package and rebuild.","Or import only the specific store plugin, e.g. _ \"go-micro.dev/v6/util/cmd/store/etcd\" style plugin package.","Or omit --store to use the default in-memory store.","Run `micro --help` / `--store` list output to see which stores are actually linked."],"exampleFix":"// before (main.go)\npackage main\nfunc main() { cmd.New().Run() }\n// after\npackage main\nimport _ \"go-micro.dev/v6/cmd/defaults\"\nfunc main() { cmd.New().Run() }","handlingStrategy":"validation","validationCode":"// check at startup which stores are linked by attempting a trivial flag parse\n// or enforce in main:\nif *storeFlag != \"\" && !linkedStores[*storeFlag] {\n    log.Fatalf(\"store %q unavailable; rebuild with cmd/defaults\", *storeFlag)\n}","typeGuard":null,"tryCatchPattern":"if err := c.Run(ctx); err != nil {\n    if strings.Contains(err.Error(), \"is not linked into this binary\") {\n        log.Fatalf(\"plugin missing: import go-micro.dev/v6/cmd/defaults: %v\", err)\n    }\n    return err\n}","preventionTips":["Always import go-micro.dev/v6/cmd/defaults in binaries that accept plugin flags.","Document which store plugins each deployment image includes.","Add a smoke test that parses flags with each store name used in your configs."],"tags":["cli","store","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"}