Redis: Fatal: Can't initialize Background Jobs

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.

Can CircleCI do anything about it?

1 Like

Changing sysctl.conf will not work anyway as it needs the system to be rebooted, which would just cause the original image and values to be reloaded.

What happened when you tried the sysctl command?

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.

magic

Same here, but it seems that this bug has something to do with the machine itself, and I don’t have this problem on my other machine. :face_with_thermometer:

Yeah yeah, exactly.
I’ve installed Redis on the machine without Docker and it works fine.

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.

1 Like

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.

1 Like

Similar to ggeser, we were running latest version 7.0.11 and hit

Fatal: Can't initialize Background Jobs.

Downgrading to 7.0.10 sorted out any issues.

Saw the same broken state on 6.2.12 vs 6.2.11.

6.2.12 and 7.0.11 were both pushed yesterday so I guess something new was introduced.

2 Likes

Had the same error, downgrading to 6.2.6 solved the error.

1 Like

Find a solution: docker run just add --privileged.