diff --git a/go/vt/vtctld/api.go b/go/vt/vtctld/api.go index ede03e98815..01706e1a2fd 100644 --- a/go/vt/vtctld/api.go +++ b/go/vt/vtctld/api.go @@ -287,9 +287,17 @@ func initAPI(ctx context.Context, ts *topo.Server, actions *ActionRepository, re if cell == "local" { if *localCell == "" { - return nil, fmt.Errorf("local cell requested, but not specified. Please set with -cell flag") + cells, err := ts.GetCellInfoNames(ctx) + if err != nil { + return nil, fmt.Errorf("could not fetch cell info: %v", err) + } + if len(cells) == 0 { + return nil, fmt.Errorf("no local cells have been created yet") + } + cell = cells[0] + } else { + cell = *localCell } - cell = *localCell } // If a keyspace is provided then return the specified srvkeyspace.