{"record":{"id":"ab1bee1454fa521f","repo":"vitessio/vitess","slug":"failed-to-parse-tablet-filters-value-q-v","errorCode":null,"errorMessage":"failed to parse tablet-filters value %q: %v","messagePattern":"failed to parse tablet-filters value %q: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/discovery/healthcheck.go","lineNumber":324,"sourceCode":"\t// subscribers\n\tsubscribers map[chan *TabletHealth]string\n\t// loadTabletsTrigger is used to immediately load information about tablets of a specific shard.\n\tloadTabletsTrigger chan topo.KeyspaceShard\n\t// options contains optional settings used to modify HealthCheckImpl\n\t// behavior.\n\toptions Options\n}\n\n// NewVTGateHealthCheckFilters returns healthcheck filters for vtgate.\nfunc NewVTGateHealthCheckFilters() (filters TabletFilters, err error) {\n\tif len(tabletFilters) > 0 {\n\t\tif len(KeyspacesToWatch) > 0 {\n\t\t\treturn nil, errKeyspacesToWatchAndTabletFilters\n\t\t}\n\n\t\tfbs, err := NewFilterByShard(tabletFilters)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse tablet-filters value %q: %v\", strings.Join(tabletFilters, \",\"), err)\n\t\t}\n\t\tfilters = append(filters, fbs)\n\t} else if len(KeyspacesToWatch) > 0 {\n\t\tfilters = append(filters, NewFilterByKeyspace(KeyspacesToWatch))\n\t}\n\tif len(tabletFilterTags) > 0 {\n\t\tfilters = append(filters, NewFilterByTabletTags(tabletFilterTags))\n\t}\n\treturn filters, nil\n}\n\n// NewHealthCheck creates a new HealthCheck object.\n// Parameters:\n// retryDelay.\n//\n//\tThe duration to wait before retrying to connect (e.g. after a failed connection\n//\tattempt).\n//","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/discovery/healthcheck.go#L306-L342","documentation":"NewVTGateHealthCheckFilters validates the tablet-filters list by passing it to NewFilterByShard. If any filter entry cannot be parsed into a keyspace|shard pair, the whole filter construction fails with this error containing the joined filter string and the parse error.","triggerScenarios":"Calling NewVTGateHealthCheckFilters (indirectly via createHealthCheck) with --tablet-filters values that are not valid 'keyspace|shard' entries — e.g. missing the '|' separator, invalid shard name/keyrange syntax, or duplicate entries; also combining tablet-filters with keyspaces-to-watch, which is rejected separately.","commonSituations":"Misconfigured VTGate command line: typo like 'commerce.0' instead of 'commerce|0'; using a comma-separated list where individual entries are invalid; stale configs from older flag formats; setting both tablet-filters and keyspaces-to-watch.","solutions":["Fix each tablet-filters entry to the 'keyspace|shard' format, e.g. 'commerce|0' or 'commerce|-80'.","Check the wrapped %v message for the specific bad entry (invalid parameter, shard parse error, or duplicate).","Remove keyspaces-to-watch if you intend to use tablet-filters (the two are mutually exclusive).","Validate the filter list locally with NewFilterByShard before deploying the config."],"exampleFix":"// before\nfbs, err := NewFilterByShard([]string{\"commerce.0\"}) // invalid separator\n// after\nfbs, err := NewFilterByShard([]string{\"commerce|0\"})","handlingStrategy":"validation","validationCode":"for _, f := range tabletFilters {\n\tparts := strings.Split(f, \"|\")\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"bad tablet-filter %q: want keyspace|shard\", f)\n\t}\n}\nif len(KeyspacesToWatch) > 0 && len(tabletFilters) > 0 {\n\treturn errors.New(\"keyspaces-to-watch and tablet-filters are mutually exclusive\")\n}","typeGuard":null,"tryCatchPattern":"filters, err := discovery.NewVTGateHealthCheckFilters()\nif err != nil {\n\tlog.Exitf(\"invalid tablet-filters config: %v\", err)\n}","preventionTips":["Validate tablet-filters entries as keyspace|shard at config load time","Never set keyspaces-to-watch and tablet-filters together","Test filter parsing in CI before shipping VTGate configs"],"tags":["configuration","discovery","healthcheck"],"backgroundTag":"invalid-config-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}