serverless-redis-http icon indicating copy to clipboard operation
serverless-redis-http copied to clipboard

Error with redis docker image: Command 1 [ expire ] failed: ERR wrong number of arguments for 'expire' command

Open SirPedr opened this issue 1 year ago • 0 comments

Hello! I'm using serverless-redis-http to execute integration tests using @upstash/redis client but I'm getting the following error while using the expire command:

Command 1 [ expire ] failed: ERR wrong number of arguments for 'expire' command

It works fine when I'm using the official Redis instance in upstash (I'm using the TS SDK), but it crashes while running locally. Here's my docker-compose.yaml file:

services:
  redis:
    image: redis:alpine
    ports:
      - "6379:6379"
  serverless-redis-http:
    ports:
      - "8079:80"
    image: hiett/serverless-redis-http:latest
    environment:
      SRH_MODE: env
      SRH_TOKEN: example_token
      SRH_CONNECTION_STRING: "redis://redis:6379"

The code that triggers the error:

await redis.expire(sessionID, sessionTTL) // "sessionID" is a string and "sessionTTL" is a number

I've tried downgrading the redis version to 6.2-alpine since it's the latest version that Upstash has compatibility with (source). However, that gives me a new error message I believe it's associated with this image:

redis-1                  | 1:M 06 Oct 2024 16:28:58.325 # Can't handle RDB format version 12
redis-1                  | 1:M 06 Oct 2024 16:28:58.325 # Fatal error loading the DB: Invalid argument. Exiting

Is this a serverless-redis-http issue at all? I'm kinda lost on how to proceed in order to solve this. Thanks in advance!

SirPedr avatar Oct 06 '24 16:10 SirPedr