`redis-stack` method `revalidateTag` fails with redis error: `Could not parse field spec`
Brief Description of the Bug
redis-stack logs Error: Could not parse field spec on other pods when running revalidateTags.
Severity
Critical? Makes the redis-stack handler unusable
Frequency of Occurrence Always
Steps to Reproduce Provide detailed steps to reproduce the behavior, including any specific conditions or configurations where the bug occurs:
- Use the default
cache-handler.jsfrom the k8s example - Start a k8s cluster with an external instance of Redis 7.4 and RedisJSON + RedisSearch
- Call
revalidateTagfrom a single of the nextjs pods - Observe how the other pods log
Error: Could not parse field specand fail to revalidate the tag
Expected vs. Actual Behavior
I expect all of the pods to revalidate the tags and not log the Redis error: Error: Could not parse field spec. Seems to originate from RedisSearch IndexSpec_AddFieldsInternal method, but could not really track down what the issue actually is or why it happens.
Screenshots/Logs From pod which triggers revalidation:
[CacheHandler] Instance created with provided context.
[12:00:00] INFO: Got request to revalidate page slug index
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: revalidateTag] [tags: []] Started revalidating tag in parallel.
[12:00:00] INFO: Revalidated page slug index
From other pods:
[CacheHandler] Instance created with provided context.
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: revalidateTag] [tags: [collection:pages_index]] Started revalidating tag in parallel.
[CacheHandler] [handler: local-lru] [method: revalidateTag] [tag: collection:pages_index] Successfully revalidated tag.
[CacheHandler] [handler: redis-stack] [method: revalidateTag] [tag: collection:pages_index] Error: Error: Could not parse field spec
using custom cache handler @neshca/cache-handler with 2 Handlers
Environment:
- OS: Linux
- Node.js version: 22
@neshca/cache-handlerversion: Next15 branch (#846) and 1.8.1nextversion: 15
Dependencies and Versions Redis:
# Server
redis_version:7.4.1
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:7fd3520e9c14a41b
redis_mode:standalone
os:Linux 5.15.0-125-generic x86_64
arch_bits:64
...
# Modules
module:name=ft,ver=10200,api=1,filters=0,usedby=[],using=[],options=[]
module:name=ReJSON,ver=999999,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors]
Attempted Solutions or Workarounds
Using the redis-strings handler.
Impact of the Bug
Keeps us from using the redis-stack cache handler for our production websites.
Additional context n/a couldn't think of any