{"record":{"id":"ae6808621a0f741f","repo":"vitessio/vitess","slug":"failed-to-discover-ss-cluster-s-w","errorCode":null,"errorMessage":"failed to discover %ss (cluster %s): %w","messagePattern":"failed to discover (.+?)s \\(cluster (.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/cluster/resolver/resolver.go","lineNumber":435,"sourceCode":"\t\t}\n\t}\n}\n\nfunc (r *resolver) resolve() (*grpcresolver.State, error) {\n\tspan, ctx := trace.NewSpan(r.ctx, \"(vtadmin/cluster/resolver).resolve\")\n\tdefer span.Finish()\n\n\tspan.Annotate(\"cluster_id\", r.cluster)\n\tspan.Annotate(\"component\", r.component)\n\n\tlog.Info(fmt.Sprintf(\"%s: resolving %ss (cluster %s)\", logPrefix, r.component, r.cluster))\n\n\tctx, cancel := context.WithTimeout(ctx, r.opts.DiscoveryTimeout)\n\tdefer cancel()\n\n\taddrs, err := r.discoverAddrs(ctx, r.opts.DiscoveryTags)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to discover %ss (cluster %s): %w\", r.component, r.cluster, err)\n\t}\n\n\tspan.Annotate(\"addrs\", strings.Join(addrs, \",\"))\n\n\tstate := &grpcresolver.State{\n\t\tAddresses: make([]grpcresolver.Address, len(addrs)),\n\t}\n\n\tif r.sc != nil {\n\t\tspan.Annotate(\"balancer_policy\", r.opts.BalancerPolicy)\n\t\tstate.ServiceConfig = &serviceconfig.ParseResult{\n\t\t\tConfig: r.sc,\n\t\t}\n\t}\n\n\tfor i, addr := range addrs {\n\t\tstate.Addresses[i] = grpcresolver.Address{\n\t\t\tAddr: addr,","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/resolver/resolver.go#L417-L453","documentation":"resolver.resolve runs address discovery for the target component (vtctld or vtgate) under r.opts.DiscoveryTimeout and wraps any discovery failure with the component and cluster name. It means the underlying discovery mechanism (e.g. topology service lookups via DiscoverVtctldAddrs/DiscoverVTGateAddrs) returned an error or found no addresses, so the resolver cannot produce a gRPC address list.","triggerScenarios":"resolve() called (via the resolver's anonymous watcher) when: discovery times out (DiscoveryTimeout exceeded), the topology service is unreachable, no healthy instances match DiscoveryTags, or discoverAddrs returns an error.","commonSituations":"vtctld/vtgate not registered in the topology; network partitions between vtadmin and the topo servers; overly tight DiscoveryTimeout in slow clusters; wrong discovery tags configured so zero addresses match.","solutions":["Check the wrapped error: timeout vs topo connection failure vs zero results.","Verify vtctld/vtgate tablets are registered and healthy in the topology.","Increase opts.DiscoveryTimeout and re-check DiscoveryTags for correctness.","Confirm network connectivity and topo credentials from the vtadmin host.","gRPC will retry resolve; fix the underlying discovery and let the resolver re-resolve."],"exampleFix":"// before\nopts := resolver.Options{DiscoveryTimeout: 100 * time.Millisecond}\n// after\nopts := resolver.Options{DiscoveryTimeout: 5 * time.Second}","handlingStrategy":"retry","validationCode":"addrs, err := r.discoverAddrs(ctx, r.opts.DiscoveryTags)\nif err != nil || len(addrs) == 0 {\n  return fmt.Errorf(\"pre-flight discovery found no %s instances\", component)\n}","typeGuard":null,"tryCatchPattern":"err := retry.Do(func() error {\n  cc, err := grpc.DialContext(ctx, target,\n    grpc.WithResolvers(builder),\n    grpc.WithDefaultCallOptions(...))\n  if err != nil && strings.Contains(err.Error(), \"failed to discover\") {\n    return retry.RetryableError(err)\n  }\n  return err\n}, retry.Attempts(5), retry.Delay(2*time.Second))","preventionTips":["Ensure vtctld/vtgate are registered in the topology before pointing vtadmin at the cluster.","Set a generous DiscoveryTimeout (seconds, not milliseconds).","Verify DiscoveryTags actually match instance tags; empty results surface as discovery failure.","Monitor topo service reachability from vtadmin hosts."],"tags":["grpc","discovery","network","topology","timeout"],"backgroundTag":"service-discovery-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}