{"id":"d29a1536babcada4","repo":"go-redis/redis","slug":"redis-unexpected-option-s","errorCode":null,"errorMessage":"redis: unexpected option: %s","messagePattern":"redis: unexpected option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"options.go","lineNumber":887,"sourceCode":"\t}\n\tif q.has(\"conn_max_lifetime\") {\n\t\to.ConnMaxLifetime = q.duration(\"conn_max_lifetime\")\n\t} else {\n\t\to.ConnMaxLifetime = q.duration(\"max_conn_age\")\n\t}\n\tif q.has(\"conn_max_lifetime_jitter\") {\n\t\to.ConnMaxLifetimeJitter = min(q.duration(\"conn_max_lifetime_jitter\"), o.ConnMaxLifetime)\n\t}\n\tif q.err != nil {\n\t\treturn nil, q.err\n\t}\n\tif o.TLSConfig != nil && q.has(\"skip_verify\") {\n\t\to.TLSConfig.InsecureSkipVerify = q.bool(\"skip_verify\")\n\t}\n\n\t// any parameters left?\n\tif r := q.remaining(); len(r) > 0 {\n\t\treturn nil, fmt.Errorf(\"redis: unexpected option: %s\", strings.Join(r, \", \"))\n\t}\n\n\treturn o, nil\n}\n\nfunc getUserPassword(u *url.URL) (string, string) {\n\tvar user, password string\n\tif u.User != nil {\n\t\tuser = u.User.Username()\n\t\tif p, ok := u.User.Password(); ok {\n\t\t\tpassword = p\n\t\t}\n\t}\n\treturn user, password\n}\n\nfunc newConnPool(\n\topt *Options,","sourceCodeStart":869,"sourceCodeEnd":905,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/options.go#L869-L905","documentation":"Returned by setupConnParams when, after consuming all recognised query parameters, some keys remain in the URL query string. go-redis treats unknown query parameters as an error rather than silently ignoring them, listing every leftover key joined by commas.","triggerScenarios":"A URL like redis://host:6379/?timeout=5s (timeout is not a valid option; the real names are read_timeout/write_timeout), or redis://host:6379/?ssl=true (use rediss:// or skip_verify). Also triggered by misspelling a supported name like ?poolsize=10 (correct: pool_size).","commonSituations":"Carrying over options from another Redis client's URL format, typos in snake_case names, or deprecated names no longer accepted.","solutions":["Map the leftover key to the supported snake_case name (see the ParseURL doc comment for the full list).","Remove the parameter if it is no longer relevant.","Set the option programmatically on *redis.Options if there is no URL equivalent."],"exampleFix":"// before\nopt, err := redis.ParseURL(\"redis://localhost:6379/?poolsize=10\")\n// after\nopt, err := redis.ParseURL(\"redis://localhost:6379/?pool_size=10\")","handlingStrategy":"validation","validationCode":"var knownStandaloneParams = map[string]bool{\n    \"db\": true, \"protocol\": true, \"client_name\": true, \"max_retries\": true,\n    \"min_retry_backoff\": true, \"max_retry_backoff\": true, \"dial_timeout\": true,\n    \"read_timeout\": true, \"write_timeout\": true, \"pool_fifo\": true,\n    \"pool_size\": true, \"pool_timeout\": true, \"min_idle_conns\": true,\n    \"max_idle_conns\": true, \"max_active_conns\": true, \"max_concurrent_dials\": true,\n    \"conn_max_idle_time\": true, \"idle_timeout\": true, \"conn_max_lifetime\": true,\n    \"max_conn_age\": true, \"conn_max_lifetime_jitter\": true, \"skip_verify\": true,\n}\nfunc unknownParams(u *url.URL) []string {\n    var unk []string\n    for k := range u.Query() { if !knownStandaloneParams[k] { unk = append(unk, k) } }\n    return unk\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference the ParseURL doc comment for the accepted param list.","Do not carry over option names from other Redis clients.","Set non-URL options programmatically on *redis.Options."],"tags":["config","url","validation"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}