{"record":{"id":"b86f41e1d714cac8","repo":"redis/go-redis","slug":"redis-invalid-url-scheme-s-b86f41","errorCode":null,"errorMessage":"redis: invalid URL scheme: %s","messagePattern":"redis: invalid URL scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster.go","lineNumber":372,"sourceCode":"\t// setup username, password, and other configurations\n\to, err = setupClusterConn(u, h, o)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn o, nil\n}\n\n// setupClusterConn gets the username and password from the URL and the query parameters.\nfunc setupClusterConn(u *url.URL, host string, o *ClusterOptions) (*ClusterOptions, error) {\n\tswitch u.Scheme {\n\tcase \"rediss\":\n\t\to.TLSConfig = &tls.Config{ServerName: host}\n\t\tfallthrough\n\tcase \"redis\":\n\t\to.Username, o.Password = getUserPassword(u)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"redis: invalid URL scheme: %s\", u.Scheme)\n\t}\n\n\t// retrieve the configuration from the query parameters\n\to, err := setupClusterQueryParams(u, o)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn o, nil\n}\n\n// setupClusterQueryParams converts query parameters in u to option value in o.\nfunc setupClusterQueryParams(u *url.URL, o *ClusterOptions) (*ClusterOptions, error) {\n\tq := queryOptions{q: u.Query()}\n\n\to.Protocol = q.int(\"protocol\")\n\to.ClientName = q.string(\"client_name\")\n\to.MaxRedirects = q.int(\"max_redirects\")","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/osscluster.go#L354-L390","documentation":"Error \"redis: invalid URL scheme: %s\" thrown in redis/go-redis.","triggerScenarios":"Thrown at osscluster.go:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}