vitessio/vitess · error
TopoCat: invalid wildcards: %v
Error message
TopoCat: invalid wildcards: %v
What it means
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.
Source
Thrown at go/vt/vtctl/topo.go:65
name: "TopoCp",
method: commandTopoCp,
params: "[--cell <cell>] [--to_topo] <src> <dst>",
help: "Copies a file from topo to local file structure, or the other way around",
})
}
func commandTopoCat(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {
cell := subFlags.String("cell", topo.GlobalCell, "topology cell to cat the file from. Defaults to global cell.")
long := subFlags.Bool("long", false, "long listing.")
decodeProtoJSON := subFlags.Bool("decode_proto_json", false, "decode proto files and display them as json")
decodeProto := subFlags.Bool("decode_proto", false, "decode proto files and display them as text")
subFlags.Parse(args)
if subFlags.NArg() == 0 {
return errors.New("TopoCat: no path specified")
}
resolved, err := wr.TopoServer().ResolveWildcards(ctx, *cell, subFlags.Args())
if err != nil {
return fmt.Errorf("TopoCat: invalid wildcards: %v", err)
}
if len(resolved) == 0 {
// The wildcards didn't result in anything, we're done.
return nil
}
conn, err := wr.TopoServer().ConnForCell(ctx, *cell)
if err != nil {
return err
}
var topologyDecoder TopologyDecoder
switch {
case *decodeProtoJSON:
topologyDecoder = JSONTopologyDecoder{}
case *decodeProto:
topologyDecoder = ProtoTopologyDecoder{}
default:View on GitHub (pinned to 01a25a7d17)
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.
Example fix
// before vtctl topo cat -cell zonne1/*/shard-0 # typo'd cell // after vtctl topo cat -cell zone1/*/shard-0
Defensive patterns
Strategy: validation
Validate before calling
if !strings.Contains(path, "*") { if err := wr.TopoServer().Get(ctx, path); err != nil { return err } }
cellInfo, err := wr.TopoServer().GetCellInfo(ctx, cell)
if err != nil { return fmt.Errorf("cell %s does not exist: %v", cell, err) } Try / catch
if err := cmdRun(); err != nil {
if strings.Contains(err.Error(), "TopoCat: invalid wildcards") {
log.Warn("check topo path/cell and topo server connectivity", slog.Any("error", err))
}
} Prevention
- 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).
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- mysql cluster type not yet supported
- no shards in keyspace %v
- not allowed: deny-all security-policy enforced
- not allowed: read-only security-policy enforced
- invalid choice for enum
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/c839832dfb3b7881.
Report an issue: GitHub.