Problem
The maximum allowed size of a key in Redis is 512 MB. Some workspaces with a large number of resources emit logs that exceed this size which can cause some caching issues within Redis.
Cause
When Redis reaches the memory limit, it returns an error to new write commands. However, it will still respond normally to read commands.
Redis keys are binary-safe, which means any binary sequence can serve as a key. It can be anything – a string, the contents of a JPEG file, and more. An empty string is also a valid key.
However, there's a limit to the max key size (512MB). The same goes for the value size (512MB of any data type).
[ERROR] http.stream-upload: failed writing key to cache store
{ duration="4.31776ms" err="ERR string exceeds maximum allowed size (512MB)"
obj.compressed=true obj.encrypted=true obj.expire=1666011286
obj.key="terraform/logs/plan-ID" obj.mode="w" obj.stream=true }
[ERROR] http.stream-download: failed copying data to cache store
{ cache-hit=false duration="17.135878777s" err="ERR string exceeds maximum allowed size
(512MB)" obj.compressed=true obj.encrypted=true obj.expire=1666009894
obj.key="terraform/logs/plan-ID" obj.mode="r"
obj.stream=true opts.framing="application/json" opts.limit=0 opts.offset=0
opts.tail=64000 }
Solutions:
-
Reduce the number of objects in the workspace by splitting them into multiple workspaces.