Dockerized Redis (latest and 6.2 tags) stopped working on a Linux machine with ‘ubuntu-2004:202010-01’ image. Error: 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. Fatal: Can't initialize Background Jobs.
I tried rerunning with SSH and modifying /etc/sysctl.conf as the error suggests, but got ‘Permission denied’ even with sudo.
I was able to make Redis work by pinning the version (tag) to 6.2.6. It still produces the same warning message, but doesn’t fail.
I didn’t try to run sysctl vm.overcommit_memory=1 as I thought it would have no effect without modifying /etc/sysctl.conf. Now that you asked I see that it’s an alternative. I’ve tried it just now - the warning message disappeared, but the error persists:
1:C 16 Jun 2023 11:06:21.919 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 16 Jun 2023 11:06:21.919 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 16 Jun 2023 11:06:21.919 # 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 16 Jun 2023 11:06:21.919 * monotonic clock: POSIX clock_gettime
1:M 16 Jun 2023 11:06:21.921 * Running mode=standalone, port=6379.
1:M 16 Jun 2023 11:06:21.921 # Server initialized
1:M 16 Jun 2023 11:06:21.921 # Fatal: Can’t initialize Background Jobs.
I have the similar problem plus I got the warning WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
I’ve tried to clean docker images, volumes, etc and also i’ve tried rebooting the machine and updating the version from 6 to 7 and it still does not work.
I solved the problem for. I’ve runned update and upgrade on my host and rebooted it. After this actions tho command docker run --restart=always -d -p 6399:6399 redis redis-server worked.
Faced the same problem today, redis in docker container “FROM redis:6”. It installs redis 6.12… . Changing to the specific version “FROM redis:6.2.6” solved my problem.