{"record":{"id":"17ef4a8255844cf2","repo":"vitessio/vitess","slug":"no-vitess-cluster-found-with-name-s","errorCode":null,"errorMessage":"no vitess cluster found with name %s","messagePattern":"no vitess cluster found with name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/topo/server.go","lineNumber":390,"sourceCode":"\t\tcc.conn.Close()\n\t}\n\tts.cellConns = make(map[string]cellConn)\n}\n\nfunc (ts *Server) clearCellAliasesCache() {\n\tcellsAliases.mu.Lock()\n\tdefer cellsAliases.mu.Unlock()\n\tcellsAliases.cellsToAliases = make(map[string]string)\n}\n\n// OpenExternalVitessClusterServer returns the topo server of the external cluster\nfunc (ts *Server) OpenExternalVitessClusterServer(ctx context.Context, clusterName string) (*Server, error) {\n\tvc, err := ts.GetExternalVitessCluster(ctx, clusterName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif vc == nil {\n\t\treturn nil, fmt.Errorf(\"no vitess cluster found with name %s\", clusterName)\n\t}\n\tvar externalTopo *Server\n\texternalTopo, err = OpenServer(vc.TopoConfig.TopoType, vc.TopoConfig.Server, vc.TopoConfig.Root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif externalTopo == nil {\n\t\treturn nil, fmt.Errorf(\"unable to open external topo for config %s\", clusterName)\n\t}\n\treturn externalTopo, nil\n}\n\n// SetReadOnly is initially ONLY implemented by StatsConn and used in ReadOnlyServer\nfunc (ts *Server) SetReadOnly(readOnly bool) error {\n\tglobalCellConn, ok := ts.globalCell.(*StatsConn)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid global cell connection type, expected StatsConn but found: %T\", ts.globalCell)\n\t}","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/topo/server.go#L372-L408","documentation":"Server.OpenExternalVitessClusterServer resolves an external vitess cluster by name via GetExternalVitessCluster. If the lookup succeeds but returns nil, the cluster name does not match any registered external cluster, so this error is returned.","triggerScenarios":"Calling OpenExternalVitessClusterServer (directly or via MoveTables/workflow command paths like commandVReplicationWorkflow, buildMaterializer, buildTrafficSwitcher) with a cluster name that is not present in the topo's external cluster list (topo key ExternalClusters).","commonSituations":"Typo in the --external-cluster flag value; external cluster never registered via vtctldclient AddExternalCluster (or the external topo was removed); environment mismatch where the source cluster was registered in a different topo.","solutions":["Run vtctldclient GetExternalClusters (or check the topo external clusters key) to list valid names","Register the external cluster with vtctldclient AddExternalCluster if missing","Correct the cluster name typo in the workflow command/flag","Verify you are pointing at the topo where the external cluster was actually registered"],"exampleFix":"// before\nvtctldclient MoveTables --external-cluster prodClusterA ...  # name not registered\n// after\nvtctldclient AddExternalCluster prodClusterA \"etcd:server1:2379\" \nvtctldclient MoveTables --external-cluster prodClusterA ...","handlingStrategy":"validation","validationCode":"clusters, err := ts.GetExternalVitessClusters(ctx)\nif err != nil {\n    return err\n}\nif !slices.Contains(clusters, clusterName) {\n    return fmt.Errorf(\"cluster %s not registered; known: %v\", clusterName, clusters)\n}","typeGuard":null,"tryCatchPattern":"externalTS, err := ts.OpenExternalVitessClusterServer(ctx, clusterName)\nif err != nil {\n    if strings.Contains(err.Error(), \"no vitess cluster found\") {\n        return fmt.Errorf(\"register the external cluster first: %w\", err)\n    }\n    return err\n}","preventionTips":["List registered external clusters (vtctldclient GetExternalClusters) before workflows","Register the external cluster with AddExternalCluster before MoveTables/workflows","Standardize external cluster names in config to avoid typos across environments"],"tags":["topo","external-cluster","vreplication","movetables"],"backgroundTag":"external-cluster-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}