{"record":{"id":"8fef8dca71f2b4db","repo":"vitessio/vitess","slug":"vdiff-found-with-invalid-id-on-tablet-s-w","errorCode":null,"errorMessage":"vdiff found with invalid id on tablet %s: %w","messagePattern":"vdiff found with invalid id on tablet (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vdiff/action.go","lineNumber":239,"sourceCode":"\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif qr, err = dbClient.ExecuteFetch(query, 1); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif qr.InsertID == 0 {\n\t\t\treturn fmt.Errorf(\"unable to create vdiff for UUID %s on tablet %s (%w)\",\n\t\t\t\treq.VdiffUuid, topoproto.TabletAliasString(vde.thisTablet.Alias), err)\n\t\t}\n\t\tresp.Id = int64(qr.InsertID)\n\t} else {\n\t\tif !recordFound {\n\t\t\treturn fmt.Errorf(\"vdiff with UUID %s not found on tablet %s\",\n\t\t\t\treq.VdiffUuid, topoproto.TabletAliasString(vde.thisTablet.Alias))\n\t\t}\n\t\tif resp.Id, err = qr.Named().Row().ToInt64(\"id\"); err != nil {\n\t\t\treturn fmt.Errorf(\"vdiff found with invalid id on tablet %s: %w\",\n\t\t\t\ttopoproto.TabletAliasString(vde.thisTablet.Alias), err)\n\t\t}\n\t\texecResume := func(query string) (rowsAffected uint64, err error) {\n\t\t\tquery, err = sqlparser.ParseAndBind(query,\n\t\t\t\tsqltypes.StringBindVariable(req.VdiffUuid),\n\t\t\t\tsqltypes.StringBindVariable(vde.dbName),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tif qr, err = dbClient.ExecuteFetch(query, 1); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\treturn qr.RowsAffected, nil\n\t\t}\n\t\trowsAffected, err := execResume(sqlResumeVDiff)\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vdiff/action.go#L221-L257","documentation":"The vdiff row was found, but its `id` column could not be converted to an int64 while building the response, indicating a corrupt or unexpected id value in _vt.vdiff_tablet. The error wraps the conversion failure.","triggerScenarios":"qr.Named().Row().ToInt64(\"id\") fails during handleCreateResumeAction — e.g. NULL id, non-numeric value, or missing `id` column in the row returned from _vt.vdiff_tablet.","commonSituations":"Manual edits or corrupted rows in the _vt.vdiff_tablet table; schema drift where the id column was altered/dropped by a failed migration; replication inconsistencies on a replica tablet's local _vt table.","solutions":["Inspect the row: SELECT id, uuid FROM _vt.vdiff_tablet WHERE uuid='<uuid>' on the tablet","Fix or delete the corrupt row and re-create the vdiff","Verify the tablet's _vt.vdiff_tablet schema matches the expected Vitess schema for your version","Check tablet replication health if the local _vt table diverged"],"exampleFix":"// repair a corrupt row\nmysql> DELETE FROM _vt.vdiff_tablet WHERE uuid='bad-uuid' AND id IS NULL;\n// then re-create the vdiff","handlingStrategy":"type-guard","validationCode":"row := qr.Named().Row()\nif row == nil { return errors.New(\"no vdiff row\") }\nif _, err := row[\"id\"].ToInt64(); err != nil { return fmt.Errorf(\"corrupt vdiff id: %w\", err) }","typeGuard":"func hasValidVDiffID(row sqltypes.RowNamed) bool {\n    if row == nil { return false }\n    _, err := row[\"id\"].ToInt64()\n    return err == nil\n}","tryCatchPattern":"if strings.Contains(err.Error(), \"found with invalid id\") {\n    // inspect/repair the _vt.vdiff_tablet row before proceeding\n}","preventionTips":["Never hand-edit _vt.vdiff_tablet rows","Validate schema after migrations touching _vt tables","Monitor replication health on tablets storing vdiff records"],"tags":["vdiff","data-corruption","schema"],"backgroundTag":"data-corruption","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}