Docker issues - config file and permission denied

Hello,

Please, help me to solve two issues with redis in the docker:

  1. no config file specified
  2. Failed opening the RDB file zzh

I spent a lot of time online trying to find how to solve these issues. I have tried many solutions, but they have not helped me.

Bellow records from the docker log, docker-compose and linux version.

1:C 30 Apr 2022 04:32:20.249 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 30 Apr 2022 04:32:20.249 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 30 Apr 2022 04:32:20.249 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 30 Apr 2022 04:32:20.250 * monotonic clock: POSIX clock_gettime
1:M 30 Apr 2022 04:32:20.250 * Running mode=standalone, port=6379.
1:M 30 Apr 2022 04:32:20.250 # Server initialized
1:M 30 Apr 2022 04:32:20.250 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 30 Apr 2022 04:32:20.252 * Loading RDB produced by version 6.2.6
1:M 30 Apr 2022 04:32:20.252 * RDB age 37732 seconds
1:M 30 Apr 2022 04:32:20.252 * RDB memory usage when created 1.59 Mb
1:M 30 Apr 2022 04:32:20.256 # Done loading RDB, keys loaded: 0, keys expired: 39.
1:M 30 Apr 2022 04:32:20.256 * DB loaded from disk: 0.005 seconds
1:M 30 Apr 2022 04:32:20.256 * Ready to accept connections
1:M 30 Apr 2022 04:37:21.044 * 100 changes in 300 seconds. Saving...
1:M 30 Apr 2022 04:37:21.045 * Background saving started by pid 19
19:C 30 Apr 2022 04:37:21.086 * DB saved on disk
19:C 30 Apr 2022 04:37:21.088 * RDB: 1 MB of memory used by copy-on-write
1:M 30 Apr 2022 04:37:21.145 * Background saving terminated with success
1:M 30 Apr 2022 04:56:57.134 * DB saved on disk
1:M 30 Apr 2022 04:56:57.612 * DB saved on disk
1:M 30 Apr 2022 04:56:57.934 * DB saved on disk
1:M 30 Apr 2022 04:56:58.456 * DB saved on disk
1:M 30 Apr 2022 04:56:59.559 * DB saved on disk
1:M 30 Apr 2022 04:57:00.013 * DB saved on disk
1:M 30 Apr 2022 04:57:00.046 * DB saved on disk
1:M 30 Apr 2022 04:57:00.294 * DB saved on disk
1:M 30 Apr 2022 04:57:00.535 * DB saved on disk
1:M 30 Apr 2022 04:57:00.792 * DB saved on disk
1:M 30 Apr 2022 04:57:01.755 # Failed opening the RDB file zzh (in server root dir /etc/cron.d) for saving: Permission denied
1:M 30 Apr 2022 04:57:02.342 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 04:57:02.926 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 04:57:03.110 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:24.757 # Failed opening the RDB file backup.db (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:26.240 # Failed opening the RDB file backup.db (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:32.906 # Failed opening the RDB file root (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:33.437 # Failed opening the RDB file root (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:33.703 # Failed opening the RDB file root (in server root dir /etc) for saving: Permission denied
1:M 30 Apr 2022 05:32:37.500 # Failed opening the RDB file zzh (in server root dir /etc/cron.d) for saving: Permission denied
1:M 30 Apr 2022 05:32:38.303 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied

docker-compose.yml

  redis:
    container_name: redis
    image: redis:latest
    privileged: true
    restart: always
    #security_opt:
    #  - seccomp:unconfined
    networks:
      - default
    ports:
      - 6379:6379
    volumes:
      - ${PWD}/data/redis:/data
    #  - ${PWD}/redis.conf:/etc/redis.conf
    #command: redis-server --save "" --rdbchecksum no --sanitize-dump-payload no

Docker

Docker version 20.10.14, build a224086

Linux


hostnamectl
   Static hostname: screener.market
         Icon name: computer-container
           Chassis: container
        Machine ID: ae3640736db445009c95ce1f2fbbf0d4
           Boot ID: 3d9934ff21d145ae8c66593d88aa0e84
    Virtualization: lxc
  Operating System: AlmaLinux 8.5 (Arctic Sphynx)
       CPE OS Name: cpe:/o:almalinux:almalinux:8::baseos
            Kernel: Linux 5.13.0-30-generic
      Architecture: x86-64

Good morning,

I’ve found this stackoverflow which indicates that an attacker tried to get access to your system:

So please ensure that your firewall only allows wanted traffic to your redis-container’s port and/or add a password to your redis-instance.

1 Like