{"record":{"id":"95308ba791eab4b6","repo":"vitessio/vitess","slug":"no-tables-found-to-diff-s-s-on-tablet-v","errorCode":null,"errorMessage":"no tables found to diff, %s:%s, on tablet %v","messagePattern":"no tables found to diff, (.+?):(.+?), on tablet (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vdiff/workflow_differ.go","lineNumber":509,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\tif lastPK != nil {\n\t\t\ttd.lastSourcePK = lastPK.Source\n\t\t\ttd.lastTargetPK = lastPK.Target\n\t\t}\n\t\twd.tableDiffers[table.Name] = td\n\t\tif _, err := td.buildTablePlan(dbClient, wd.ct.vde.dbName, wd.collationEnv); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// We get the PK columns from the source schema as well as they can differ\n\t\t// and they determine the proper position to use when saving our progress.\n\t\tif err := td.getSourcePKCols(); err != nil {\n\t\t\treturn vterrors.Wrapf(err, \"could not get the primary key columns from the %s source keyspace\",\n\t\t\t\twd.ct.sourceKeyspace)\n\t\t}\n\t}\n\tif len(wd.tableDiffers) == 0 {\n\t\treturn fmt.Errorf(\"no tables found to diff, %s:%s, on tablet %v\",\n\t\t\toptTables, specifiedTables, wd.ct.vde.thisTablet.Alias)\n\t}\n\treturn nil\n}\n\n// getTableLastPK gets the lastPK protobuf message for a given vdiff table.\nfunc (wd *workflowDiffer) getTableLastPK(dbClient binlogplayer.DBClient, tableName string) (*tabletmanagerdatapb.VDiffTableLastPK, error) {\n\tquery, err := sqlparser.ParseAndBind(sqlGetVDiffTable,\n\t\tsqltypes.Int64BindVariable(wd.ct.id),\n\t\tsqltypes.StringBindVariable(tableName),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tqr, err := dbClient.ExecuteFetch(query, 1)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vdiff/workflow_differ.go#L491-L527","documentation":"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.","triggerScenarios":"--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.","commonSituations":"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.","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"],"exampleFix":"// before (typo)\nvtctldclient VDiff --tables customer,ordrs commerce commerce2customer\n// after\nvtctldclient VDiff --tables customer,orders commerce commerce2customer","handlingStrategy":"validation","validationCode":"// verify --tables names exist in the workflow before running vdiff\nwfTables := getWorkflowTableNames(keyspace, workflow) // from GetWorkflows\nfor _, t := range strings.Split(opts.Tables, \",\") {\n  if !slices.Contains(wfTables, strings.TrimSpace(t)) {\n    return fmt.Errorf(\"table %s is not part of workflow %s\", t, workflow)\n  }\n}","typeGuard":"func tablesInWorkflow(requested, workflowTables []string) bool {\n  for _, r := range requested {\n    if !slices.Contains(workflowTables, strings.TrimSpace(r)) { return false }\n  }\n  return true\n}","tryCatchPattern":"if err := wd.diff(ctx, dbClient); err != nil {\n  if strings.Contains(err.Error(), \"no tables found to diff\") {\n    log.Errorf(\"check --tables names and filter rules; workflow tables: %v\", wfTables)\n  }\n  return err\n}","preventionTips":["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"],"tags":["vdiff","configuration","table-filter"],"backgroundTag":"vdiff-no-tables-selected","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}