{"record":{"id":"de2e1429fd3671e6","repo":"vitessio/vitess","slug":"stream-d-has-not-started-on-tablet-v","errorCode":null,"errorMessage":"stream %d has not started on tablet %v","messagePattern":"stream (.+?) has not started on tablet (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vdiff/table_differ.go","lineNumber":227,"sourceCode":"\t\treturn err\n\t}\n\t// streams are no longer running because vre.Exec would have replaced old controllers and new ones will not start\n\n\t// update position of all source streams\n\tquery = \"select id, source, pos from _vt.vreplication \" + ct.workflowFilter\n\tqr, err := dbClient.ExecuteFetch(query, -1)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, row := range qr.Named().Rows {\n\t\tid, _ := row[\"id\"].ToInt64()\n\t\tpos := row[\"pos\"].ToString()\n\t\tmpos, err := binlogplayer.DecodePosition(pos)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif mpos.IsZero() {\n\t\t\treturn fmt.Errorf(\"stream %d has not started on tablet %v\",\n\t\t\t\tid, td.wd.ct.vde.thisTablet.Alias)\n\t\t}\n\t\tsourceBytes, err := row[\"source\"].ToBytes()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar bls binlogdatapb.BinlogSource\n\t\tif err := prototext.Unmarshal(sourceBytes, &bls); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tct.sources[bls.Shard].position = mpos\n\t}\n\n\treturn nil\n}\n\nfunc (td *tableDiffer) forEachSource(cb func(source *migrationSource) error) error {\n\tct := td.wd.ct","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vdiff/table_differ.go#L209-L245","documentation":"While stopping target vreplication streams during table_differ initialization, the differ reads each stream's recorded position. A zero (empty) binlog position means the stream was created but never started replicating, so there is nothing valid to stop/park — the differ returns this error.","triggerScenarios":"initialize → stopTargetVReplicationStreams finds a target _vt.vreplication row whose pos column decodes to a zero position, i.e. the stream never made progress after creation.","commonSituations":"Target vreplication stream stuck/failed at startup (source unreachable, wrong keyspace/shard); racing a vdiff create immediately after workflow creation before streams start; target tablet copy loop stalled.","solutions":["Check the target stream's state/message: SELECT id, state, message, pos FROM _vt.vreplication; on the target tablet.","Fix the underlying stream failure (source tablet reachability, permissions, filter) and let it start before running vdiff.","If the stream is dead, delete/recreate the workflow (MoveTables/Reshard) so streams start properly, then re-run vdiff."],"exampleFix":"// before\nrow[\"pos\"] = \"\" // stream never started\n// after (verify first)\nSELECT id, pos, state FROM _vt.vreplication WHERE id=<stream id>;\n-- pos must be a non-zero gtid set before vdiff","handlingStrategy":"validation","validationCode":"rows := queryTarget(\"SELECT id, pos, state FROM _vt.vreplication WHERE workflow=?\", wf)\nfor _, r := range rows {\n  if r[\"state\"].ToString() != \"Running\" || r[\"pos\"].ToString() == \"\" {\n    return errors.New(\"wait for streams to start before vdiff\")\n  }\n}","typeGuard":null,"tryCatchPattern":"if err := startVDiff(); err != nil && strings.Contains(err.Error(), \"has not started\") {\n  // poll until stream pos is non-zero, then retry\n  waitForStreamStarted(streamID)\n  retryVDiff()\n}","preventionTips":["Wait for target streams to reach Running with a non-empty pos before vdiff create.","Check SELECT ... FROM _vt.vreplication on the target tablet first.","Fix source connectivity/permissions before launching vdiff.","Avoid racing vdiff create immediately after workflow create."],"tags":["vdiff","vreplication","binlog-position","stream"],"backgroundTag":"vreplication-stream-not-started","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}