{"record":{"id":"d64ae22abe3caa63","repo":"vitessio/vitess","slug":"unknown-mysqlctl-client-protocol-v","errorCode":null,"errorMessage":"unknown mysqlctl client protocol: %v","messagePattern":"unknown mysqlctl client protocol: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/mysqlctlclient/interface.go","lineNumber":93,"sourceCode":"// Factory functions are registered by client implementations.\ntype Factory func(ctx context.Context, network, addr string) (MysqlctlClient, error)\n\nvar factories = make(map[string]Factory)\n\n// RegisterFactory allows a client implementation to register itself\nfunc RegisterFactory(name string, factory Factory) {\n\tif _, ok := factories[name]; ok {\n\t\tlog.Error(fmt.Sprintf(\"RegisterFactory %s already exists\", name))\n\t\tos.Exit(1)\n\t}\n\tfactories[name] = factory\n}\n\n// New creates a client implementation as specified by a flag.\nfunc New(ctx context.Context, network, addr string) (MysqlctlClient, error) {\n\tfactory, ok := factories[protocol]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown mysqlctl client protocol: %v\", protocol)\n\t}\n\treturn factory(ctx, network, addr)\n}\n","sourceCodeStart":75,"sourceCodeEnd":97,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/mysqlctlclient/interface.go#L75-L97","documentation":"mysqlctlclient.New resolves the client implementation from a package-level registry keyed by the `protocol` flag; if the protocol value has no registered factory, this error is returned. Only protocols whose client packages were imported (registered via init) are available.","triggerScenarios":"Calling New with --mysqlctl_client_protocol set to anything other than grpc (the only factory registered by default), or building a binary that does not import the grpcmysqlctlclient package so factories is empty.","commonSituations":"Typo like 'GRPC' (case-sensitive) or 'grpc2'; custom builds missing the blank import `_ \"vitess.io/vitess/go/vt/mysqlctl/grpcmysqlctlclient\"`; stale flags copied from another deployment.","solutions":["Set --mysqlctl_client_protocol=grpc (lowercase).","Ensure the binary imports the grpcmysqlctlclient package (directly or via vitess defaults) so its factory registers.","Check the flag spelling against go/vt/mysqlctl/mysqlctlclient/interface.go registry."],"exampleFix":"// before\n--mysqlctl_client_protocol http\n// after\n--mysqlctl_client_protocol grpc","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"grpc\": true}\nif !allowed[flags.GetString(\"mysqlctl_client_protocol\")] {\n\treturn errors.New(\"mysqlctl_client_protocol must be grpc\")\n}","typeGuard":null,"tryCatchPattern":"client, err := mysqlctlclient.New(ctx, network, addr)\nif err != nil {\n\tif strings.Contains(err.Error(), \"unknown mysqlctl client protocol\") { /* fix protocol flag */ }\n\treturn err\n}","preventionTips":["Only use the documented protocol value 'grpc' in flags","Keep blank imports of client implementation packages in custom builds","Add flag validation in PreRunE to catch bad protocol values before RPC time"],"tags":["mysqlctl","configuration","grpc","client"],"backgroundTag":"unknown-protocol","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}