{"record":{"id":"c3688660988fd838","repo":"rqlite/rqlite","slug":"invalid-disco-mode-s","errorCode":null,"errorMessage":"invalid disco mode %s","messagePattern":"invalid disco mode (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/rqlited/main.go","lineNumber":738,"sourceCode":"\t\t\t\tlog.Printf(\"discovery service returned %s as join address\", addr)\n\t\t\t\tif j, err := joiner.Do(ctx, []string{addr}, str.ID(), cfg.RaftAdv, clusterSuf); err != nil {\n\t\t\t\t\tlog.Printf(\"failed to join cluster at %s: %s\", addr, err.Error())\n\n\t\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\t\t_, addr, err = discoService.Register(str.ID(), cfg.HTTPURL(), cfg.RaftAdv)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"failed to get updated leader: %s\", err.Error())\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tlog.Println(\"successfully joined cluster at\", j)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid disco mode %s\", cfg.DiscoMode)\n\t}\n\treturn nil\n}\n\nfunc networkCheckJoinAddrs(joinAddrs []string) error {\n\tif len(joinAddrs) > 0 {\n\t\tlog.Println(\"checking that supplied join addresses don't serve HTTP(S)\")\n\t\tif addr, ok := httpd.AnyServingHTTP(joinAddrs); ok {\n\t\t\treturn fmt.Errorf(\"join address %s appears to be serving HTTP when it should be Raft\", addr)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":720,"sourceCodeEnd":752,"githubUrl":"https://github.com/rqlite/rqlite/blob/7586a4d1bdbd9a5a80021664c5a863cd850adb60/cmd/rqlited/main.go#L720-L752","documentation":"The -disco-mode flag was set to a value rqlited does not recognize. createCluster's switch over DiscoMode fell through to the default case, which rejects startup. Supported modes are dns, dnssrv, consul-kv, and etcd-kv (plus empty for no discovery).","triggerScenarios":"Starting rqlited with -disco-mode set to any string other than \"dns\", \"dnssrv\", \"consul-kv\", \"etcd-kv\" or empty — e.g. a typo like \"consul\" or \"etcd\".","commonSituations":"Typo or abbreviation of a mode name; copy-pasting a mode string from another tool; using an old mode name removed in a newer rqlite version.","solutions":["Set -disco-mode to one of: dns, dnssrv, consul-kv, etcd-kv (or omit it entirely).","Check the exact spelling including the -kv suffix for Consul/Etcd modes.","Consult `rqlited -h` or docs for the list of valid discovery modes in your rqlite version."],"exampleFix":"// before\nrqlited -disco-mode consul ...\n// after\nrqlited -disco-mode consul-kv ...","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"\": true, \"dns\": true, \"dnssrv\": true, \"consul-kv\": true, \"etcd-kv\": true}\nif !valid[discoMode] {\n    return fmt.Errorf(\"-disco-mode %q invalid; use dns, dnssrv, consul-kv, or etcd-kv\", discoMode)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the allowed disco mode list in your deployment tooling and validate flags at deploy time.","Never hand-type mode names; copy from documentation.","Run `rqlited -h` to confirm supported modes for your version."],"tags":["startup","configuration","discovery","cli-flags"],"backgroundTag":"invalid-enum-value","analyzedSha":"7586a4d1bdbd9a5a80021664c5a863cd850adb60","analyzedAt":"2026-09-03T07:03:02.260Z","contentChangedAt":"2026-09-03T07:03:02.260Z","schemaVersion":2},"datasetVersion":"2026-09-10T12:17:11.382Z"}