{"record":{"id":"1253014e78154f3e","repo":"vitessio/vitess","slug":"invalid-tablet-alias-q-v","errorCode":null,"errorMessage":"invalid tablet alias %q: %v","messagePattern":"invalid tablet alias %q: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/clone.go","lineNumber":98,"sourceCode":"\t\treturn replication.Position{}, errors.New(\"--clone-from-primary and --clone-from-tablet are mutually exclusive\")\n\tcase cloneFromPrimary:\n\t\t// Look up the primary tablet from topology.\n\t\tlog.Info(fmt.Sprintf(\"Looking up primary tablet for shard %s/%s for use as CLONE REMOTE donor\", keyspace, shard))\n\t\tsi, err := topoServer.GetShard(ctx, keyspace, shard)\n\t\tif err != nil {\n\t\t\treturn replication.Position{}, fmt.Errorf(\"failed to get shard %s/%s: %v\", keyspace, shard, err)\n\t\t}\n\t\tif topoproto.TabletAliasIsZero(si.PrimaryAlias) {\n\t\t\treturn replication.Position{}, fmt.Errorf(\"shard %s/%s has no primary\", keyspace, shard)\n\t\t}\n\t\tdonorAlias = si.PrimaryAlias\n\t\tlog.Info(fmt.Sprintf(\"Found primary tablet %s for use as CLONE REMOTE donor\", topoproto.TabletAliasString(donorAlias)))\n\tcase cloneFromTablet != \"\":\n\t\t// Parse the explicit donor tablet alias.\n\t\tlog.Info(fmt.Sprintf(\"Using tablet %s for use as CLONE REMOTE donor\", cloneFromTablet))\n\t\tdonorAlias, err = topoproto.ParseTabletAlias(cloneFromTablet)\n\t\tif err != nil {\n\t\t\treturn replication.Position{}, fmt.Errorf(\"invalid tablet alias %q: %v\", cloneFromTablet, err)\n\t\t}\n\tdefault:\n\t\treturn replication.Position{}, errors.New(\"no donor specified\")\n\t}\n\n\t// Get donor tablet info from topology.\n\tdonorTablet, err := topoServer.GetTablet(ctx, donorAlias)\n\tif err != nil {\n\t\treturn replication.Position{}, fmt.Errorf(\"failed to get tablet %s from topology: %v\", topoproto.TabletAliasString(donorAlias), err)\n\t}\n\n\t// Get clone credentials.\n\tcloneConfig := dbconfigs.GlobalDBConfigs.CloneUser\n\tif cloneConfig.User == \"\" {\n\t\treturn replication.Position{}, errors.New(\"clone user not configured; set --db-clone-user flag\")\n\t}\n\n\t// Create the clone executor.","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/clone.go#L80-L116","documentation":"Returned by mysqlctl clone logic when the provided tablet alias string is malformed, wrapping the parse error with the offending alias.","triggerScenarios":"CloneFromDonor invoked with a malformed --clone-from-tablet string (missing cell prefix, non-numeric uid, trailing whitespace, or alias format not matching the topo's alias parsing rules).","commonSituations":"Typo in tablet alias, using a hostname instead of a tablet alias, copying an alias from the wrong cell format, shell mangling of dashes.","solutions":["Use the exact `<cell>-<uid>` form, e.g. `zone1-0000000100`.","Get the correct alias with `vtctldclient GetTablets` and copy it verbatim.","Strip surrounding whitespace/quotes from the flag value."],"exampleFix":"// before\n--clone-from-tablet=zone1.100\n// after\n--clone-from-tablet=zone1-0000000100","handlingStrategy":"validation","validationCode":"alias, err := topoproto.ParseTabletAlias(flagCloneFromTablet)\nif err != nil {\n\treturn fmt.Errorf(\"--clone-from-tablet must be cell-uid form like zone1-0000000100: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid tablet alias\") {\n\t// correct the alias format and retry\n}","preventionTips":["Copy aliases verbatim from `vtctldclient GetTablets`","Validate alias format in scripts before invoking mysqlctl"],"tags":["clone","tablet-alias","validation"],"backgroundTag":"invalid-tablet-alias","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}