Skip to content

redis-stack method revalidateTag fails with redis error: Could not parse field spec #866

@eliassjogreen

Description

@eliassjogreen

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:

  1. Use the default cache-handler.js from the k8s example
  2. Start a k8s cluster with an external instance of Redis 7.4 and RedisJSON + RedisSearch
  3. Call revalidateTag from a single of the nextjs pods
  4. Observe how the other pods log Error: Could not parse field spec and 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnext15Waiting for Next.js 15

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions