{"record":{"id":"70c31ec419ac65c1","repo":"vitessio/vitess","slug":"workflow-s-s-is-incorrectly-configured","errorCode":null,"errorMessage":"workflow %s.%s is incorrectly configured","messagePattern":"workflow (.+?)\\.(.+?) is incorrectly configured","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/workflow.go","lineNumber":705,"sourceCode":"\t\t\t(*tableSizes)[table] += tableSize\n\t\t}\n\t\treturn nil\n\t}\n\tsourceDbName := \"\"\n\tfor _, tsSource := range vrw.ts.sources {\n\t\tsourceDbName = tsSource.GetPrimary().DbName()\n\t\tbreak\n\t}\n\tif sourceDbName == \"\" {\n\t\treturn nil, fmt.Errorf(\"no sources found for workflow %s.%s\", vrw.ws.TargetKeyspace, vrw.ws.Workflow)\n\t}\n\ttargetDbName := \"\"\n\tfor _, tsTarget := range vrw.ts.targets {\n\t\ttargetDbName = tsTarget.GetPrimary().DbName()\n\t\tbreak\n\t}\n\tif sourceDbName == \"\" || targetDbName == \"\" {\n\t\treturn nil, fmt.Errorf(\"workflow %s.%s is incorrectly configured\", vrw.ws.TargetKeyspace, vrw.ws.Workflow)\n\t}\n\tsort.Strings(tableList) // sort list for repeatability for mocking in tests\n\ttablesStr := strings.Join(tableList, \",\")\n\tquery := fmt.Sprintf(getRowCountQuery, encodeString(targetDbName), tablesStr)\n\tfor _, target := range vrw.ts.targets {\n\t\ttablet := target.GetPrimary().Tablet\n\t\tif err := getTableMetrics(tablet, query, &targetRowCounts, &targetTableSizes); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tquery = fmt.Sprintf(getRowCountQuery, encodeString(sourceDbName), tablesStr)\n\tfor source := range sourcePrimaries {\n\t\tti, err := vrw.wr.ts.GetTablet(ctx, source)\n\t\ttablet := ti.Tablet\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/workflow.go#L687-L723","documentation":"After resolving source and target database names from the first primary tablet of each TabletSet, this error fires when either side resolves to an empty name. It signals the workflow's topology data is incomplete — the workflow exists but its source or target side has no usable primary tablet.","triggerScenarios":"Calling the row-count/status plumbing when sourceDbName == \"\" (no source primaries) or targetDbName == \"\" (no target primaries) for vrw.ts, typically right after resolving a workflow whose tablets are missing or not yet elected.","commonSituations":"Reshard/MoveTables mid-flight before target primaries are up; keyspace created but tablets not started; topo data stale after a cluster rebuild; wrong keyspace passed to the command.","solutions":["Run `vtctldclient GetTablets` and confirm both source and target keyspaces have primaries","Start/repair missing tablets in the offending keyspace","Re-run the command once topology is healthy; if stale, verify vtctld points at the correct topo server"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(ts.Sources) == 0 || len(ts.Targets) == 0 {\n    return fmt.Errorf(\"workflow %s.%s lacks primaries; check topology\", keyspace, workflow)\n}","typeGuard":"func workflowFullyConfigured(ts *tabletset.Set) bool {\n    return len(ts.Sources) > 0 && len(ts.Targets) > 0\n}","tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"incorrectly configured\") {\n        // inspect GetTablets output for the keyspace before retrying\n    }\n    return err\n}","preventionTips":["Check both source and target keyspaces have primaries with vtctldclient GetTablets","Run workflow status only on active workflows","Verify vtctld points at the correct topo server environment"],"tags":["wrangler","workflow","topology"],"backgroundTag":"workflow-missing-primary-tablet","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}