{"record":{"id":"85ec1bfa01e74a34","repo":"redis/go-redis","slug":"redis-connection-is-not-usable","errorCode":null,"errorMessage":"redis: connection is not usable","messagePattern":"redis: connection is not usable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"redis.go","lineNumber":567,"sourceCode":"\tif err := c.initConn(ctx, cn); err != nil {\n\t\tp.Remove(ctx, cn, err)\n\t\tif unwrapped := errors.Unwrap(err); unwrapped != nil {\n\t\t\treturn unwrapped\n\t\t}\n\t\treturn err\n\t}\n\n\tif dialStartNs := cn.GetDialStartNs(); dialStartNs > 0 {\n\t\tif cb := pool.GetMetricConnectionCreateTimeCallback(); cb != nil {\n\t\t\tduration := time.Duration(time.Now().UnixNano() - dialStartNs)\n\t\t\tcb(ctx, duration, cn)\n\t\t}\n\t}\n\n\t// initConn will transition to IDLE state, so we need to acquire it\n\t// before returning it to the user.\n\tif !cn.TryAcquire() {\n\t\terr := fmt.Errorf(\"redis: connection is not usable\")\n\t\t// Remove rather than abandon: an unacquirable conn left outside the\n\t\t// pool's accounting would leak its slot.\n\t\tp.Remove(ctx, cn, err)\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// loadPipelinePool returns the pipeline-pool ref, or nil when pipelines use\n// the main pool (PipelinePoolSize < 0, or an internal wrapper client).\nfunc (c *baseClient) loadPipelinePool() *pipelinePoolRef {\n\treturn c.pipelinePool\n}\n\n// getPipelinePool returns the dedicated pipeline pool as a pool.Pooler, or a\n// true nil interface when there is none. Callers must use this rather than\n// wrapping loadPipelinePool().pool themselves where a pool.Pooler is expected:","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/redis.go#L549-L585","documentation":"Error \"redis: connection is not usable\" thrown in redis/go-redis.","triggerScenarios":"Thrown at redis.go:567 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"}