vitessio/vitess · error
no tables found to diff, %s:%s, on tablet %v
Error message
no tables found to diff, %s:%s, on tablet %v
What it means
buildPlan populates tableDiffers from the workflow schema filtered by the user-specified --tables option and the vreplication filter rules. If after filtering no tables remain, it fails with `no tables found to diff`, listing the options/spec and tablet.
Source
Thrown at go/vt/vttablet/tabletmanager/vdiff/workflow_differ.go:509
return err
}
if lastPK != nil {
td.lastSourcePK = lastPK.Source
td.lastTargetPK = lastPK.Target
}
wd.tableDiffers[table.Name] = td
if _, err := td.buildTablePlan(dbClient, wd.ct.vde.dbName, wd.collationEnv); err != nil {
return err
}
// We get the PK columns from the source schema as well as they can differ
// and they determine the proper position to use when saving our progress.
if err := td.getSourcePKCols(); err != nil {
return vterrors.Wrapf(err, "could not get the primary key columns from the %s source keyspace",
wd.ct.sourceKeyspace)
}
}
if len(wd.tableDiffers) == 0 {
return fmt.Errorf("no tables found to diff, %s:%s, on tablet %v",
optTables, specifiedTables, wd.ct.vde.thisTablet.Alias)
}
return nil
}
// getTableLastPK gets the lastPK protobuf message for a given vdiff table.
func (wd *workflowDiffer) getTableLastPK(dbClient binlogplayer.DBClient, tableName string) (*tabletmanagerdatapb.VDiffTableLastPK, error) {
query, err := sqlparser.ParseAndBind(sqlGetVDiffTable,
sqltypes.Int64BindVariable(wd.ct.id),
sqltypes.StringBindVariable(tableName),
)
if err != nil {
return nil, err
}
qr, err := dbClient.ExecuteFetch(query, 1)
if err != nil {
return nil, err
}View on GitHub (pinned to 01a25a7d17)
Solutions
- Check the workflow's table list (`vtctldclient GetWorkflows`) and use exact matching table names in --tables
- Remove --tables to diff all tables in the workflow, then narrow down
- Verify the vreplication filter rules don't exclude the tables you intend to diff
- Confirm you're running vdiff against the correct keyspace/workflow and that the source schema still contains the tables
Example fix
// before (typo) vtctldclient VDiff --tables customer,ordrs commerce commerce2customer // after vtctldclient VDiff --tables customer,orders commerce commerce2customer
Defensive patterns
Strategy: validation
Validate before calling
// verify --tables names exist in the workflow before running vdiff
wfTables := getWorkflowTableNames(keyspace, workflow) // from GetWorkflows
for _, t := range strings.Split(opts.Tables, ",") {
if !slices.Contains(wfTables, strings.TrimSpace(t)) {
return fmt.Errorf("table %s is not part of workflow %s", t, workflow)
}
} Type guard
func tablesInWorkflow(requested, workflowTables []string) bool {
for _, r := range requested {
if !slices.Contains(workflowTables, strings.TrimSpace(r)) { return false }
}
return true
} Try / catch
if err := wd.diff(ctx, dbClient); err != nil {
if strings.Contains(err.Error(), "no tables found to diff") {
log.Errorf("check --tables names and filter rules; workflow tables: %v", wfTables)
}
return err
} Prevention
- List workflow tables via GetWorkflows before specifying --tables
- Use exact table names (case-sensitive)
- Don't combine --tables with exclude rules for the same tables
- Confirm the workflow's source schema still has the tables
When it happens
Trigger: --tables option lists table names that don't match any table in the workflow schema (typo, wrong case, table not part of the workflow), or all tables are excluded by filter rules (rule.Filter == "exclude") or are internal operation tables.
Common situations: Running `vtctldclient VDiff --tables` with names not in the MoveTables/Migrate workflow; specifying tables that were already migrated out or renamed; running vdiff on a workflow whose filter excludes everything; keyspace/table name mismatch.
Related errors
- there are no cells in the topo
- --s3-backup-storage-bucket required
- direct DDL is disabled
- online DDL is disabled
- --batch-size requires 'direct' ddl_strategy
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/95308ba791eab4b6.
Report an issue: GitHub.