{"record":{"id":"b3441e046787fe68","repo":"vitessio/vitess","slug":"error-creating-vtctldclient-proxy-config-w","errorCode":null,"errorMessage":"error creating vtctldclient proxy config: %w","messagePattern":"error creating vtctldclient proxy config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"go/vt/vtadmin/cluster/cluster.go","lineNumber":133,"sourceCode":"\n\tprotocluster := cluster.ToProto()\n\n\tvtsqlargs := buildPFlagSlice(cfg.VtSQLFlags)\n\n\tvtsqlCfg, err := vtsql.Parse(protocluster, disco, vtsqlargs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating vtsql connection config: %w\", err)\n\t}\n\n\tfor _, opt := range cfg.vtsqlConfigOpts {\n\t\tvtsqlCfg = opt(vtsqlCfg)\n\t}\n\n\tvtctldargs := buildPFlagSlice(cfg.VtctldFlags)\n\n\tvtctldCfg, err := vtctldclient.Parse(protocluster, disco, vtctldargs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating vtctldclient proxy config: %w\", err)\n\t}\n\n\tfor _, opt := range cfg.vtctldConfigOpts {\n\t\tvtctldCfg = opt(vtctldCfg)\n\t}\n\n\tcluster.DB, err = vtsql.New(ctx, vtsqlCfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating vtsql proxy: %w\", err)\n\t}\n\n\tcluster.Vtctld, err = vtctldclient.New(ctx, vtctldCfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating vtctldclient: %w\", err)\n\t}\n\n\tif cfg.TabletFQDNTmplStr != \"\" {\n\t\tcluster.TabletFQDNTmpl, err = template.New(cluster.ID + \"-tablet-fqdn\").Parse(cfg.TabletFQDNTmplStr)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/cluster.go#L115-L151","documentation":"cluster.New fails when vtctldclient.Parse cannot construct the vtctld proxy connection config from the cluster proto and cfg.VtctldFlags. Like the vtsql step, this is config/flag validation at startup; the underlying parse error is preserved as the cause.","triggerScenarios":"cfg.VtctldFlags contains an unknown or invalid flag for building the vtctldclient proxy config during cluster.BuildCluster.","commonSituations":"Wrong vtctld host/port; renamed or removed vtctld flags after upgrading vitess; malformed flag string (missing values, bad quoting).","solutions":["Correct the vtctld flags (host/port of the vtctld server) in the cluster config","Validate flag names against vtctldclient.Parse for your version","Test flags individually to isolate the offending one"],"exampleFix":"// before\nvtctld: \"-vtctld-host\"\n// after\nvtctld: \"-vtctld-host vtctld.example.com -vtctld-port 15999\"","handlingStrategy":"validation","validationCode":"// pre-validate vtctld flags before BuildCluster\nif err := validateFlagNames(\"vtctld\", cfg.VtctldFlags); err != nil {\n    return fmt.Errorf(\"bad vtctld flags: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"c, err := cluster.BuildCluster(ctx, cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"vtctldclient proxy config\") {\n        return fmt.Errorf(\"check --vtctld flags for cluster %q: %w\", cfg.ID, err)\n    }\n    return err\n}","preventionTips":["Use deployment templates with validated vtctld host/port values","Re-check flag names after vitess upgrades (deprecated flags get removed)","Test cluster construction in CI before production rollout"],"tags":["startup","vtctldclient","configuration","flag-parsing"],"backgroundTag":"invalid-config-flag","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}