{"record":{"id":"4806e56ce58e3341","repo":"redis/go-redis","slug":"redis-newclusterclient-nil-options","errorCode":null,"errorMessage":"redis: NewClusterClient nil options","messagePattern":"redis: NewClusterClient nil options","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster.go","lineNumber":1386,"sourceCode":"\n\t// himport is the cluster-wide HIMPORT fieldset registry, shared with\n\t// every node client (masters and replicas alike — roles change with the\n\t// topology) so any connection serving an HIMPORT SET can lazily replay\n\t// the PREPARE (see himport.go, himport_cluster.go).\n\thimport *himportRegistry\n\n\tautopipelinerMu     *sync.Mutex    // guards the autopipeliner fields against concurrent first-call creation\n\tautopipeliner       *AutoPipeliner // blocking face (ClusterClient.AutoPipeline)\n\tasyncAutopipeliner  *AutoPipeliner // deferred face (ClusterClient.AsyncAutoPipeline)\n\tautopipelinerClosed bool           // set by Close: refuse to resurrect a pipeliner on a closed client\n}\n\n// NewClusterClient returns a Redis Cluster client as described in\n// https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec.\n// Passing nil ClusterOptions will cause a panic.\nfunc NewClusterClient(opt *ClusterOptions) *ClusterClient {\n\tif opt == nil {\n\t\tpanic(\"redis: NewClusterClient nil options\")\n\t}\n\topt.init()\n\n\tc := &ClusterClient{\n\t\topt:             opt,\n\t\tnodes:           newClusterNodes(opt),\n\t\thimport:         newHImportRegistry(),\n\t\tautopipelinerMu: &sync.Mutex{},\n\t}\n\n\t// Every node client shares the cluster-wide fieldset registry, replicas\n\t// included: a promoted replica's connections carry no prepared flags, so\n\t// the first HIMPORT SET routed to it replays the PREPARE lazily.\n\tc.nodes.OnNewNode(func(nodeClient *Client) {\n\t\tnodeClient.himport = c.himport\n\t})\n\n\tc.cmdsInfoCache = newCmdsInfoCache(c.cmdsInfo)","sourceCodeStart":1368,"sourceCodeEnd":1404,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/osscluster.go#L1368-L1404","documentation":"Error \"redis: NewClusterClient nil options\" thrown in redis/go-redis.","triggerScenarios":"Thrown at osscluster.go:1386 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"}