{"record":{"id":"66284fdb4794d57c","repo":"vitessio/vitess","slug":"failed-to-resolve-keyspace-wildcard-v-v","errorCode":null,"errorMessage":"failed to resolve keyspace wildcard %v: %v","messagePattern":"failed to resolve keyspace wildcard (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":848,"sourceCode":"// It supports topology-based wildcards, and plain wildcards.\n// For instance:\n// us*                             // using plain matching\n// *                               // using plain matching\nfunc keyspaceParamsToKeyspaces(ctx context.Context, wr *wrangler.Wrangler, params []string) ([]string, error) {\n\tresult := make([]string, 0, len(params))\n\tfor _, param := range params {\n\t\tif len(param) == 0 {\n\t\t\treturn nil, errors.New(\"empty keyspace param in list\")\n\t\t}\n\t\tif param[0] == '/' {\n\t\t\t// this is a topology-specific path\n\t\t\tresult = append(result, params...)\n\t\t} else {\n\t\t\t// this is not a path, so assume a keyspace name,\n\t\t\t// possibly with wildcards\n\t\t\tkeyspaces, err := wr.TopoServer().ResolveKeyspaceWildcard(ctx, param)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to resolve keyspace wildcard %v: %v\", param, err)\n\t\t\t}\n\t\t\tresult = append(result, keyspaces...)\n\t\t}\n\t}\n\treturn result, nil\n}\n\n// shardParamsToKeyspaceShards builds a list of keyspace/shard pairs.\n// It supports topology-based wildcards, and plain wildcards.\n// For instance:\n// user/*                             // using plain matching\n// */0                                // using plain matching\nfunc shardParamsToKeyspaceShards(ctx context.Context, wr *wrangler.Wrangler, params []string) ([]topo.KeyspaceShard, error) {\n\tresult := make([]topo.KeyspaceShard, 0, len(params))\n\tfor _, param := range params {\n\t\tif param[0] == '/' {\n\t\t\t// this is a topology-specific path\n\t\t\tfor _, path := range params {","sourceCodeStart":830,"sourceCodeEnd":866,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L830-L866","documentation":"keyspaceParamsToKeyspaces expands command-line keyspace parameters that may contain wildcards (e.g. 'customer*') by calling topo.ResolveKeyspaceWildcard. This error wraps any failure from the topology server during that resolution, preserving both the offending parameter and the underlying cause (typically a topo server connectivity or keyspace-not-found problem).","triggerScenarios":"Running any vtctl command that accepts keyspace params (via commandRebuildKeyspaceGraph and similar) where a parameter is treated as a keyspace name with wildcards and ResolveKeyspaceWildcard fails — e.g. the wildcard matches no keyspaces, or the topo server is unreachable.","commonSituations":"Typo in keyspace name so the wildcard matches nothing; topo server (etcd/zk) down or misconfigured; running against the wrong topo environment; stale cell configuration.","solutions":["Check the wrapped cause: if it says no keyspace found, fix the keyspace name/wildcard pattern","Verify topo server connectivity (vtctl should list the keyspace via `vtctl GetKeyspaces`)","List existing keyspaces and correct the wildcard pattern to match at least one","Retry after confirming topo server health (etcd/zookeeper reachable)"],"exampleFix":"// before\nvtctl RebuildKeyspaceGraph 'custmer*'\n// after\nvtctl GetKeyspaces          # confirm real name\necho customer*              # verify glob matches\necho RebuildKeyspaceGraph 'customer*'\n","handlingStrategy":"validation","validationCode":"# Resolve the wildcard yourself before passing it on\nvtctl GetKeyspaces | grep -E '^customer'   # ensure the pattern matches\nkeyspaces=$(vtctl GetKeyspaces | grep '^customer' | tr '\\n' ' ')\nvtctl RebuildKeyspaceGraph $keyspaces","typeGuard":null,"tryCatchPattern":"if err := runVtctl(\"RebuildKeyspaceGraph\", pattern); err != nil {\n    if strings.Contains(err.Error(), \"failed to resolve keyspace wildcard\") {\n        // inspect wrapped cause, log the pattern, fall back to explicit keyspace list\n    }\n}","preventionTips":["Enumerate keyspaces with GetKeyspaces and pass explicit names in scripts","Test glob patterns against a real topo listing before automation runs","Pin topo server config and verify connectivity in preflight checks","Avoid wildcards where a single explicit keyspace suffices"],"tags":["vtctl","topo","keyspace","wildcard"],"backgroundTag":"keyspace-wildcard-resolution-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}