{"record":{"id":"c8764ddc799bdb90","repo":"vitessio/vitess","slug":"unimplemented-connection-protocol-s","errorCode":null,"errorMessage":"unimplemented connection protocol %s","messagePattern":"unimplemented connection protocol (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vtbench/vtbench.go","lineNumber":163,"sourceCode":"\n\t\tvar conn clientConn\n\t\tvar err error\n\n\t\tswitch b.ConnParams.Protocol {\n\t\tcase MySQL:\n\t\t\tlog.V(5).Info(fmt.Sprintf(\"connecting to %s using mysql protocol...\", host))\n\t\t\tconn = &mysqlClientConn{}\n\t\t\terr = conn.connect(ctx, cp)\n\t\tcase GRPCVtgate:\n\t\t\tlog.V(5).Info(fmt.Sprintf(\"connecting to %s using grpc vtgate protocol...\", host))\n\t\t\tconn = &grpcVtgateConn{}\n\t\t\terr = conn.connect(ctx, cp)\n\t\tcase GRPCVttablet:\n\t\t\tlog.V(5).Info(fmt.Sprintf(\"connecting to %s using grpc vttablet protocol...\", host))\n\t\t\tconn = &grpcVttabletConn{}\n\t\t\terr = conn.connect(ctx, cp)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unimplemented connection protocol %s\", b.ConnParams.Protocol.String())\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error connecting to %s using %v protocol: %v\", host, cp.Protocol.String(), err)\n\t\t}\n\n\t\t// XXX handle normalization and per-thread query templating\n\t\tquery, bindVars := b.getQuery(i)\n\t\tb.threads = append(b.threads, benchThread{\n\t\t\tb:        b,\n\t\t\ti:        i,\n\t\t\tconn:     conn,\n\t\t\tquery:    query,\n\t\t\tbindVars: bindVars,\n\t\t})\n\n\t\tif time.Now().After(report) {\n\t\t\tfmt.Printf(\"Created %d/%d connections after %v\\n\", i, b.Threads, time.Since(start))","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vtbench/vtbench.go#L145-L181","documentation":"vtbench's createConns switches on b.ConnParams.Protocol to construct the right connection type; the default case returns this error for protocol values with no implementation (e.g. anything not mysql/tcp, unix, or grpc vttablet). It is a programming/config error: the chosen protocol is not supported by vtbench.","triggerScenarios":"Passing --protocol (or a conn params protocol string) with an unsupported value when calling vtbench.Run / createConns, e.g. an experimental or internal protocol flag that vtbench does not implement.","commonSituations":"Typo in the --protocol flag value; copying flags from another vitess tool that supports more protocols; new protocol added to ConnParams but not wired into vtbench.","solutions":["Use a supported protocol value (mysql, grpc-vttablet, etc. — see vtbench flag help)","Fix the --protocol flag spelling","If a new protocol is genuinely needed, add a case in createConns implementing conn.connect for it"],"exampleFix":"// before\nvtbenchclient.Run(ctx, \"--protocol\", \"grpc-vtctl\", ...)\n// after\nvtbenchclient.Run(ctx, \"--protocol\", \"grpc-vttablet\", ...)","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"mysql\": true, \"grpc-vttablet\": true}\nif !supported[protocol.String()] {\n    return fmt.Errorf(\"protocol %s unsupported by vtbench\", protocol)\n}","typeGuard":"func protocolSupported(p querypb.VtbenchProtocol) bool {\n    switch p {\n    case querypb.VtbenchProtocol_MYSQL, querypb.VtbenchProtocol_GRPC_VTTABLET:\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := b.Run(ctx); err != nil {\n    if strings.Contains(err.Error(), \"unimplemented connection protocol\") {\n        // surface flag help / supported protocols to the user\n    }\n    return err\n}","preventionTips":["Check vtbench flag help for supported --protocol values","Don't copy protocol flags from other vitess tools","Add a case in createConns before adopting a new protocol"],"tags":["vtbench","protocol","benchmark"],"backgroundTag":"unsupported-protocol","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}