On a Raspi 4 Debian 11 my redis server (version=6.0.16) suddenly crashes after a while.

To reproduce reboot and wait

After a reboot everything works, but then I get an odd error from redis server which breaks after a while:

journalctl -f -u redis-server

-- Journal begins at Thu 2024-10-24 13:07:28 CEST. -- Okt 24 14:03:12 GLOIN systemd[1]: Stopped Advanced key-value store. Okt 24 14:03:12 GLOIN systemd[1]: Starting Advanced key-value store... Okt 24 14:03:22 GLOIN systemd[314571]: redis-server.service: Failed to set up mount namespacing: /run/systemd/unit-root/: Host is down Okt 24 14:03:22 GLOIN systemd[314571]: redis-server.service: Failed at step NAMESPACE spawning /usr/bin/redis-server: Host is down Okt 24 14:03:22 GLOIN systemd[1]: redis-server.service: Main process exited, code=exited, status=226/NAMESPACE Okt 24 14:03:22 GLOIN systemd[1]: redis-server.service: Failed with result 'exit-code'. Okt 24 14:03:22 GLOIN systemd[1]: Failed to start Advanced key-value store.

If I comment out ReadOnlyDirectories=/ in the redis systemd service file it would work. But I don’t like to do that.

The server ran for years with this configuration without problem and I have no idea what changed to provoke this behaviour. Also the solution, which I found on the internet seems odd. Is it ok to comment ReadOnlyDirectories out? Or what else could I do to fix that?

Thanks.

Comment From: sundb

@n0valis can you give the logs from redis server instead of systemd.

Comment From: n0valis

@sundb I am not neccessarily familiar with redis. Could you please be a bit mor specific. Where and what?

Comment From: sundb

@n0valis i'm not sure if config ReadOnlyDirectories=/ may cause redis to fail to write data, maybe you should avoid limiting write at the top level.

Comment From: n0valis

@n0valis i'm not sure if config ReadOnlyDirectories=/ may cause redis to fail to write data, maybe you should avoid limiting write at the top level.

And I don't know what to make of your comment. I am also not sure, that's why I'm here. I have no clue about redis and it's requirements. I read on the internet that disableing `ReadOnlyDirectories=/ in the service file solves the problem. That's why I did it and it works. I am here to find out about + the side effects of that, + why it solves the problem, + and what the actual reason is for redis to crash

I thought you might know anything about this. If you tell me where to find additional data which you need I can provide it.

Comment From: sundb

@n0valis you also need to give Redis the write permission, otherwise it will not be able to rdb saving, config rewrite, creat pid file, etc.

Comment From: n0valis

I think you don't understand the problem. I don't give anything. This is done automatically on installation. This Problem I have is new. Afzer years of running flawless. Can yoz please carefully read my posts and answer my questions

Comment From: sundb

https://github.com/systemd/systemd/issues/16156 This failure does not appear to be related with redis, this log is not from Redis, have you recently upgraded system or systemd, perhaps you should consider trying to update systemd.

Comment From: n0valis

Why is so difficult to understand for you? Redis server crashes. This is related to redis. Redis server is started as a service by systemd. This is related to redis. If I remove one entry in the service file the server does not crash. This is related to redis.

Do you know anything about this entry?(ReadOnlyDirectories=/) What could be the reason for redis to not crash if this entry is commented out? Do you know anything about redis?