corrupt date with redis:6-alpine on RasPi

Viewed 1025

I'm running redis in a docker container on a RasPi 4 (redis:6-alpine). It is used by Nextcloud in another container (via docker-compose). Since a few days redis is using 100% CPU time.

I now saw that the date/time in the container is corrupt. Redis seems to start normally, but the log sais

pi@tsht2:/data/nextcloud $ docker logs nextcloud_redis_1 
1:C 03 May 2071 14:21:28.000 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 03 May 2071 14:21:28.000 # Redis version=6.0.10, bits=32, commit=00000000, modified=0, pid=1, just started
1:C 03 May 2071 14:21:28.000 # Configuration loaded
1:M 03 May 2071 14:18:00.000 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now.
1:M 03 May 2071 14:20:40.000 * Running mode=standalone, port=6379.
1:M 03 May 2071 14:21:28.000 # Server initialized
1:M 03 May 2071 14:21:20.000 # 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 03 May 2071 14:21:28.000 * Ready to accept connections

Watch the date!

When I look at the date in the container, I get

pi@tsht2:/data/nextcloud $ docker exec -it nextcloud_redis_1 date
Sun Jan  0 00:100:4174038  1900

I tried to stop the container, remove the image and restart anything, but I have the same problem.

What happens there? Has the 100% CPU usage something to do with the date problem?

BTW: the other containers show the correct date/time.

1 Answers

Raspbian stable is listed at https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0#time64_requirements with an outdated version of libseccomp (quoting: ... [requiring] host libseccomp to be version 2.4.2 or greater ...). Note that for Raspbian libseccomp is known as libseccomp2. In this case: either update libseccomp and Docker, or use an older image.

The issue with a non-functioning clock seems to apply to all containers based on Alpine Linux built in the last couple of weeks. In my own experience this includes PostgreSQL and Python. Both of these fail: PostgreSQL experiences a Segmentation Fault, Python fails to initialize its clock. Given that Redis is database-like, I would not be surprised if the lack of working clock breaks it as well.

(This issue seems to be resolved) The arm-v7 images of Alpine Linux seem to have been built with a non-functioning time component, see https://gitlab.alpinelinux.org/alpine/aports/-/issues/12346. This issue should be resolved by using either an older image (eg. redis:6.0.6-alpine3.12 seems to be 6 months old), waiting for a fixed build to appear, or using a build that does not use alpine.

Related