{"id":"4e4e2e00c947c1d5","repo":"go-redis/redis","slug":"redis-auth-is-not-allowed-when-client-side-cachin","errorCode":null,"errorMessage":"redis: AUTH is not allowed when client-side caching is enabled","messagePattern":"redis: AUTH is not allowed when client-side caching is enabled","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"csc_integration.go","lineNumber":528,"sourceCode":"\t}\n}\n\n// errClientTrackingWithCSC rejects CLIENT TRACKING on clients with built-in CSC\n// (see the guards in baseClient.process and generalProcessPipeline). The raw\n// escape hatches — Do(ctx, \"client\", \"tracking\", ...) with string or []byte\n// args, and pipelines — are also caught: the guard matches on the command's\n// leading args, not the typed method.\nvar errClientTrackingWithCSC = errors.New(\n\t\"redis: CLIENT TRACKING is not allowed when client-side caching is enabled\")\n\n// errSelectWithCSC rejects runtime SELECT on clients with built-in CSC. Cache\n// keys use Options.DB, while SELECT mutates only the chosen pool connection.\nvar errSelectWithCSC = errors.New(\n\t\"redis: SELECT is not allowed when client-side caching is enabled\")\n\n// errAuthWithCSC rejects runtime authentication because it can change one\n// connection's ACL identity without changing the client's fixed cache namespace.\nvar errAuthWithCSC = errors.New(\n\t\"redis: AUTH is not allowed when client-side caching is enabled\")\n\n// errHelloWithCSC rejects HELLO with arguments because it can switch a tracked\n// connection out of RESP3 (and can also change authentication).\nvar errHelloWithCSC = errors.New(\n\t\"redis: HELLO with arguments is not allowed when client-side caching is enabled\")\n\n// errResetWithCSC rejects RESET because it disables tracking and switches the\n// connection to RESP2.\nvar errResetWithCSC = errors.New(\n\t\"redis: RESET is not allowed when client-side caching is enabled\")\n\n// errSubscribeWithCSC rejects raw subscriptions on the ordinary pool. The\n// typed Subscribe methods use dedicated PubSub connections and remain allowed.\nvar errSubscribeWithCSC = errors.New(\n\t\"redis: SUBSCRIBE is not allowed on pooled connections when client-side caching is enabled\")\n\n// cscCommandError rejects commands that can make a pooled connection's state","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/csc_integration.go#L510-L546","documentation":"Error \"redis: AUTH is not allowed when client-side caching is enabled\" thrown in go-redis/redis.","triggerScenarios":"Thrown at csc_integration.go:528 when the library encounters an invalid state.","commonSituations":"Use the credential-provider options (CredentialsProvider) rather than ad-hoc AUTH commands.","solutions":["Provide credentials in redis.Options so authentication happens at connection setup","Do not issue AUTH manually on a CSC-enabled client"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}