{"id":"303c35da29fb7c27","repo":"go-redis/redis","slug":"redis-client-tracking-is-not-allowed-when-client","errorCode":null,"errorMessage":"redis: CLIENT TRACKING is not allowed when client-side caching is enabled","messagePattern":"redis: CLIENT TRACKING is not allowed when client-side caching is enabled","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"csc_integration.go","lineNumber":518,"sourceCode":"\t}\n\treturn 0\n}\n\n// cscForgetConn drops connID's init-generation entry when initialization does\n// not establish tracked coverage, either because init failed or tracking was\n// rejected and CSC was disabled.\nfunc (c *baseClient) cscForgetConn(connID uint64) {\n\tif h := c.cscHook(); h != nil {\n\t\th.forgetConn(connID)\n\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","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/csc_integration.go#L500-L536","documentation":"Error \"redis: CLIENT TRACKING is not allowed when client-side caching is enabled\" thrown in go-redis/redis.","triggerScenarios":"Thrown at csc_integration.go:518 when the library encounters an invalid state.","commonSituations":"Route all tracking configuration through the client's CSC options so manual CLIENT TRACKING calls are unnecessary.","solutions":["Disable client-side caching (CacheSize/ttl options) if the application needs CLIENT TRACKING directly","Let go-redis manage tracking through its client-side caching integration instead of issuing CLIENT TRACKING manually"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}