root@194a131a72e3:/# redis-server
663:C 18 Nov 2022 00:39:01.341 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
663:C 18 Nov 2022 00:39:01.341 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=663, just started
663:C 18 Nov 2022 00:39:01.341 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.0.16 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 663
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
663:M 18 Nov 2022 00:39:01.342 # Server initialized
663:M 18 Nov 2022 00:39:01.342 # Fatal: Can't initialize Background Jobs.
- Steps to reproduce (if any) $ redis-server
Comment From: madolson
Can you have more information about the system you are running on and the state of the system? That specific error occurs when we are unable to start background threads, most likely because of insufficient resources.
Comment From: japrogramer
@madolson the machine has plenty of resources to start a single redis-server with the default config but yet it fails
$
Linux 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
:~$ free -h
total used free shared buff/cache available
Mem: 15Gi 6.4Gi 262Mi 54Mi 9.0Gi 8.9Gi
Swap: 2.0Gi 48Mi 2.0Gi
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
Stepping: 1
CPU MHz: 2300.015
BogoMIPS: 4600.13
Hypervisor vendor: Xen
Virtualization type: full
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 1 MiB
L3 cache: 45 MiB
$ nproc --all
4
##############################################################################################
# in container
:/# uname -a
Linux #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
/# free -h
total used free shared buff/cache available
Mem: 15Gi 6.5Gi 251Mi 77Mi 8.9Gi 8.8Gi
Swap: 2.0Gi 54Mi 1.9Gi
Comment From: japrogramer
Tried running redis from the docker redis image. and it works but not from my container .. with the same error listed in the first comment ^
Both test were run with just the container in question running so im sure that the resources are not the issue as one container is able to run the server but not the other. @madolson are there any more debug flags that I can pass to see what the issue might be ? I've tried verbose and nothing came up
do I need to resort to strace ?
Note: In the container where redis does not start, so does this error come up.
redis-server --check-system
*** FATAL CONFIG FILE ERROR (Redis 6.0.16) ***
Reading the configuration file, at line 2
>>> 'check-system'
Bad directive or wrong number of arguments
$ docker run --name some-redis -d redis
$ docker logs -f some-redis
1:C 22 Nov 2022 00:30:46.267 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 22 Nov 2022 00:30:46.267 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 22 Nov 2022 00:30:46.267 # 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 22 Nov 2022 00:30:46.267 * monotonic clock: POSIX clock_gettime
1:M 22 Nov 2022 00:30:46.268 * Running mode=standalone, port=6379.
1:M 22 Nov 2022 00:30:46.268 # Server initialized
1:M 22 Nov 2022 00:30:46.268 # WARNING Your system is configured to use the 'xen' clocksource which might lead to degraded performance. Check the result of the [slow-clocksource] system check: run 'redis-server --check-system' to check if the system's clocksource isn't degrading performance.
1:M 22 Nov 2022 00:30:46.268 * Ready to accept connections
/data# redis-server --check-system
[slow-clocksource]...WARNING:
Slow system clocksource detected. This can result in degraded performance. Consider changing the system's clocksource. Current clocksource: xen. Available clocksources: xen tsc hpet acpi_pm. For example: run the command 'echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource' as root. To permanently change the system's clocksource you'll need to set the 'clocksource=' kernel command line parameter.
[xen-clocksource]...WARNING:
Your system is configured to use the 'xen' clocksource which might lead to degraded performance. Check the result of the [slow-clocksource] system check: run 'redis-server --check-system' to check if the system's clocksource isn't degrading performance.
[overcommit]...OK
[THP]...OK
Comment From: oranagra
maybe run it with strace to see which system call fails and why.
Comment From: madolson
@japrogramer on the other thread you mentioned it started working? This seems like a really weird issue, strace seems like a good suggestion to figure out why it's failing otherwise. Marking as "to be closed" in case there is no follow up.