{"record":{"id":"530f412a754cdec0","repo":"vitessio/vitess","slug":"active-reparent-commands-disabled-unset-the-dis","errorCode":null,"errorMessage":"active reparent commands disabled (unset the --disable-active-reparents flag to enable)","messagePattern":"active reparent commands disabled \\(unset the --disable-active-reparents flag to enable\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/reparent.go","lineNumber":72,"sourceCode":"\t})\n\taddCommand(\"Shards\", command{\n\t\tname:   \"EmergencyReparentShard\",\n\t\tmethod: commandEmergencyReparentShard,\n\t\tparams: \"--keyspace_shard=<keyspace/shard> [--new-primary=<tablet alias>] [--allow-split-brain-promotion] [--wait_replicas_timeout=<duration>] [--ignore_replicas=<tablet alias list>] [--prevent_cross_cell_promotion=<true/false>]\",\n\t\thelp:   \"Reparents the shard to the new primary. Assumes the old primary is dead and not responding.\",\n\t})\n\taddCommand(\"Shards\", command{\n\t\tname:   \"TabletExternallyReparented\",\n\t\tmethod: commandTabletExternallyReparented,\n\t\tparams: \"<tablet alias>\",\n\t\thelp: \"Changes metadata in the topology server to acknowledge a shard primary change performed by an external tool. See the Reparenting guide for more information:\" +\n\t\t\t\"https://vitess.io/docs/user-guides/reparenting/#external-reparenting\",\n\t})\n}\n\nfunc commandReparentTablet(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tif mysqlctl.DisableActiveReparents {\n\t\treturn errors.New(\"active reparent commands disabled (unset the --disable-active-reparents flag to enable)\")\n\t}\n\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tif subFlags.NArg() != 1 {\n\t\treturn errors.New(\"action ReparentTablet requires <tablet alias>\")\n\t}\n\ttabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn wr.ReparentTablet(ctx, tabletAlias)\n}\n\nfunc commandInitShardPrimary(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tif mysqlctl.DisableActiveReparents {\n\t\treturn errors.New(\"active reparent commands disabled (unset the --disable-active-reparents flag to enable)\")","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/reparent.go#L54-L90","documentation":"commandReparentTablet, the vtctldclient ReparentTablet command handler, refuses to run when active reparenting is globally disabled via mysqlctl.DisableActiveReparents. Vitess deployments that delegate reparenting to an external tool (e.g. Orchestrator) set --disable-active-reparents, and this guard prevents vtctld from racing that tool.","triggerScenarios":"Running `vtctldclient ReparentTablet <alias>` against a cluster started with the --disable-active-reparents flag on vttablets/vtctld.","commonSituations":"Operators migrating a cluster to external reparenting and forgetting the flag blocks built-in commands; CI/e2e environments launched with the flag for safety; habitual use of ReparentTablet after a config change.","solutions":["Remove the --disable-active-reparents flag from vttablet/vtctld startup and restart the processes if Vitess-managed reparenting is desired","Use the external reparenting tool instead of vtctldclient ReparentTablet (see the external reparenting user guide)","If this is a new shard init rather than a reparent, use InitShardPrimary — noting it is equally guarded when disabled"],"exampleFix":"// before (vttablet args)\n--disable-active-reparents\n// after\n# remove the flag; then:\nvtctldclient ReparentTablet zone1-0000000100","handlingStrategy":"validation","validationCode":"if mysqlctl.DisableActiveReparents {\n    return errors.New(\"reparenting is delegated to an external tool; use it instead of vtctldclient\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check cluster startup flags before running reparent commands","Route reparenting through the external tool when --disable-active-reparents is set","Document the flag's effect in runbooks so operators are not surprised"],"tags":["reparenting","cli","configuration","fail-fast"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}