redis / docker-library-redis

Docker Official Image packaging for Redis
http://redis.io
BSD 3-Clause "New" or "Revised" License
1.12k stars 563 forks source link

FATAL CONFIG FILE ERROR #322

Closed vgoklani closed 1 year ago

vgoklani commented 2 years ago

Using docker-compose with the latest version of redis via docker, I get the following error;

    *** FATAL CONFIG FILE ERROR (Redis 7.0.2) *** 
   Reading the configuration file, at line 2
   >>> 'port 6379 "--appendonly no"'
   wrong number of arguments

this is the corresponding part from my docker-compose file:

redis0:
    restart: always
    image: redis:latest
    ports:
        - "127.0.0.1:6379:6379"
    volumes:
        - /var/opt_docker/data/redis0:/data
    mem_limit: 65536m
    env_file:
        - ./environment
    container_name: redis0
    healthcheck:
        test: ["CMD", "redis-cli", "ping"]
        interval: 120s
        timeout: 5s
        retries: 3
        start_period: 15s
    command: ["redis-server", "--port 6379", "--appendonly no", "--appendfsync no", "--appendfilename appendonly.aof", "--dbfilename redis.rdb", "--save 3600 1000 600 10000", "--dir /data", "--protected-mode yes", "--bind 0.0.0.0", "--requirepass ${REDIS_PASSWORD}"]

not sure why this isn't working, were the arguments changed? thanks!

wglambert commented 2 years ago

Duplicate of https://github.com/docker-library/redis/issues/320

This is a known issue that was introduced in Redis 7.0.1. The fix is at https://github.com/redis/redis/pull/10866 and it will be a part of the next patch-level release of Redis (7.0.3)

See also https://github.com/docker-library/redis/issues/320#issuecomment-1170264492

I'd recommend just using an adjusted command line that treats every item as separate arguments: