{"record":{"id":"c839832dfb3b7881","repo":"vitessio/vitess","slug":"topocat-invalid-wildcards-v","errorCode":null,"errorMessage":"TopoCat: invalid wildcards: %v","messagePattern":"TopoCat: invalid wildcards: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/topo.go","lineNumber":65,"sourceCode":"\t\tname:   \"TopoCp\",\n\t\tmethod: commandTopoCp,\n\t\tparams: \"[--cell <cell>] [--to_topo] <src> <dst>\",\n\t\thelp:   \"Copies a file from topo to local file structure, or the other way around\",\n\t})\n}\n\nfunc commandTopoCat(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tcell := subFlags.String(\"cell\", topo.GlobalCell, \"topology cell to cat the file from. Defaults to global cell.\")\n\tlong := subFlags.Bool(\"long\", false, \"long listing.\")\n\tdecodeProtoJSON := subFlags.Bool(\"decode_proto_json\", false, \"decode proto files and display them as json\")\n\tdecodeProto := subFlags.Bool(\"decode_proto\", false, \"decode proto files and display them as text\")\n\tsubFlags.Parse(args)\n\tif subFlags.NArg() == 0 {\n\t\treturn errors.New(\"TopoCat: no path specified\")\n\t}\n\tresolved, err := wr.TopoServer().ResolveWildcards(ctx, *cell, subFlags.Args())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"TopoCat: invalid wildcards: %v\", err)\n\t}\n\tif len(resolved) == 0 {\n\t\t// The wildcards didn't result in anything, we're done.\n\t\treturn nil\n\t}\n\n\tconn, err := wr.TopoServer().ConnForCell(ctx, *cell)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar topologyDecoder TopologyDecoder\n\tswitch {\n\tcase *decodeProtoJSON:\n\t\ttopologyDecoder = JSONTopologyDecoder{}\n\tcase *decodeProto:\n\t\ttopologyDecoder = ProtoTopologyDecoder{}\n\tdefault:","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/topo.go#L47-L83","documentation":"commandTopoCat resolves cell-qualified wildcard paths (e.g. 'zone1/*/keyspace') against the topo server before printing topo contents. This error wraps any failure from ResolveWildcards, most commonly a malformed path or an unreachable topo server/cell, prefixed with 'TopoCat: invalid wildcards:' so the user knows which argument was bad.","triggerScenarios":"Running `vtctl topo -cell <cell> cat <path>` where the path contains wildcards that fail resolution: a path glob that the topo server rejects, a nonexistent cell name, or the topo server being down/unreachable so ResolveWildcards returns an error.","commonSituations":"Typo'd cell in --cell; wildcard characters used with a path format the resolver doesn't expect (e.g. missing keyspace/shard component); topology backend (etcd/zk/consul) down or misconfigured via --topo_implementation and --topo_global_server_address.","solutions":["Check the path syntax printed by `vtctl topo --help` and fix the wildcard pattern (valid form is typically [cell/]<keyspace>/<shard>[/<file>] with * wildcards).","Verify the --cell value exists: run `vtctl GetCellInfo <cell>` or list cells via `vtctl topo -z cat /vitess/global/cells`.","Confirm topo server connectivity flags (--topo_implementation, --topo_global_server_address, --topo_global_root) match your deployment.","Run a non-wildcard path first (e.g. `vtctl topo cat <cell>/<keyspace>`) to isolate whether resolution or the backend is failing."],"exampleFix":"// before\nvtctl topo cat -cell zonne1/*/shard-0  # typo'd cell\n// after\nvtctl topo cat -cell zone1/*/shard-0","handlingStrategy":"validation","validationCode":"if !strings.Contains(path, \"*\") { if err := wr.TopoServer().Get(ctx, path); err != nil { return err } }\ncellInfo, err := wr.TopoServer().GetCellInfo(ctx, cell)\nif err != nil { return fmt.Errorf(\"cell %s does not exist: %v\", cell, err) }","typeGuard":null,"tryCatchPattern":"if err := cmdRun(); err != nil {\n    if strings.Contains(err.Error(), \"TopoCat: invalid wildcards\") {\n        log.Warn(\"check topo path/cell and topo server connectivity\", slog.Any(\"error\", err))\n    }\n}","preventionTips":["Validate the cell name with GetCellInfo before running topo cat with wildcards.","Test with a literal (non-wildcard) topo path first.","Keep topo server flags consistent with the deployment (etcd2/zk2/consul)."],"tags":["vtctl","topology","wildcard-resolution"],"backgroundTag":"topo-wildcard-resolution-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}