Rspamd something strange after migration

you miss some important things, did you try to reinstall all the mail stack

yum reinstall nethserver-mail-\*

Even doing the reinstallation nothing has changed.

24039:C 07 Sep 21:09:46.582 # Can't chdir to '/var/lib/redis/rspamd': Permission denied
27389:C 07 Sep 21:16:25.029 # Can't chdir to '/var/lib/redis/rspamd': Permission denied
31270:C 07 Sep 21:22:35.179 # Can't chdir to '/var/lib/redis/rspamd': Permission denied
1022:C 07 Sep 21:23:09.058 # Can't chdir to '/var/lib/redis/rspamd': Permission denied
/var/log/redis/rspamd.log (END)

[root@srvmail ~]# systemctl status redis-rspamd
● redis-rspamd.service - Redis persistent key-value database Rspamd
   Loaded: loaded (/usr/lib/systemd/system/redis-rspamd.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2020-09-07 21:23:09 CEST; 1min 9s ago
 Main PID: 1022 (code=exited, status=1/FAILURE)

when i go into rspamd he asks me for the password. i think it’s strange…

the service is down it doesn’t surprise me much

in the cockpit the antispam service is enabled

no solution?

yet no :-?

My cristal ball is broken, did you try to reboot your server and trigger

signal-event nethserver-mail-filter-save

give us also the full message to the start of rspamd and redis-rspamd, maybe something has changed

nothing new

[root@srvmail ~]# uptime
 22:22:23 up 2 min,  1 user,  load average: 5.79, 2.44, 0.91
[root@srvmail ~]# signal-event nethserver-mail-filter-save
[root@srvmail ~]# 

and

[root@srvmail ~]# systemctl status redis-rspamd
● redis-rspamd.service - Redis persistent key-value database Rspamd
   Loaded: loaded (/usr/lib/systemd/system/redis-rspamd.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-09-08 22:20:37 CEST; 4min 35s ago
 Main PID: 807 (code=exited, status=1/FAILURE)

Sep 08 22:20:37 srvmail.XXX.it systemd[1]: Started Redis persistent key-value database Rspamd.
Sep 08 22:20:37 srvmail.XXX.it systemd[1]: redis-rspamd.service: main process exited, code=exited, status=1/FAILURE
Sep 08 22:20:37 srvmail.XXX.it systemd[1]: Unit redis-rspamd.service entered failed state.
Sep 08 22:20:37 srvmail.XXX.it systemd[1]: redis-rspamd.service failed.

and

[root@srvmail ~]# redis-cli -s /var/run/redis-rspamd/rspamd monitor
Could not connect to Redis at /var/run/redis-rspamd/rspamd: No such file or directory

Check if the folder of the redis socket exists

/var/run/redis-rspamd

What is the permission of this folder

[root@srvmail ~]# ls -al /var/run/redis-rspamd
ls: cannot access /var/run/redis-rspamd: No such file or directory

Ok this is the important hit, make the the folder with vmail permission iirc

Not at home will check my server later

drwxr-xr-x  2 redis    mail          80 Jun 15 15:41 /vr/run/redis-rspamd
/var/run/redis-rspamd/:
srwxrwx--- 1 redis mail 0 Jun 15 15:41 rspamd
-rw-r--r-- 1 redis mail 4 Jun 15 15:41 rspamd.pid

but

[root@prometheus ~]# systemctl cat redis-rspamd
# /usr/lib/systemd/system/redis-rspamd.service
[Unit]
Description=Redis persistent key-value database Rspamd

[Service]
ExecStart=/usr/bin/redis-server /etc/redis-rspamd.conf --daemonize no
ExecStop=/usr/libexec/redis-shutdown redis-rspamd
User=redis
Group=mail
RuntimeDirectory=redis-rspamd
RuntimeDirectoryMode=0755

so it is systemd itself that create the runtime directory, the key is to understand why redis-rspamd doesn’t start

what is the output of

/usr/bin/redis-server /etc/redis-rspamd.conf --daemonize no

2 Likes

no output happens, it remains suspended, I don’t get a new shell…

[root@srvmail ~]# systemctl restart redis-rspamd
[root@srvmail ~]# systemctl status redis-rspamd
● redis-rspamd.service - Redis persistent key-value database Rspamd
   Loaded: loaded (/usr/lib/systemd/system/redis-rspamd.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since gio 2020-09-10 10:24:48 CEST; 1s ago
  Process: 12924 ExecStart=/usr/bin/redis-server /etc/redis-rspamd.conf --daemonize no (code=exited, status=233/RUNTIME_DIRECTORY)
 Main PID: 12924 (code=exited, status=233/RUNTIME_DIRECTORY)

set 10 10:24:48 srvmail.XXX.it systemd[1]: Started Redis persistent key-value database Rspamd.
set 10 10:24:48 srvmail.XXX.it systemd[12924]: Failed at step RUNTIME_DIRECTORY spawning /usr/bin/redis-server: File exists
set 10 10:24:48 srvmail.XXX.it systemd[1]: redis-rspamd.service: main process exited, code=exited, status=233/RUNTIME_DIRECTORY
set 10 10:24:48 srvmail.XXX.it systemd[1]: Unit redis-rspamd.service entered failed state.
set 10 10:24:48 srvmail.XXX.it systemd[1]: redis-rspamd.service failed.

in /var/run/ never see the folder redis-rspamd

1 Like

this problem will remain a mystery, and I have another server with the same problem… :frowning:

1 Like

@loryaegis this is a perfect timing for… check the marks of the servers.
What are the differences, which are the similarities. Of course… excluding the obvious (hostname, ip addres, etc etc) but maybe the two setups/installatins share something.

Same ISP? Same kind of connections between ISP And Nethserver (forwarding included if behind a nat) or CPE setup…

IIUC you did a migration by a backup, then maybe we could reproduce it, could you confirm ?

Yes,

  1. I saved the configuration file.
  2. installed NS
  3. loaded the configuration file and then imported the data.
    I did everything on the same machine, it is not a migration.

fantastic! we understood the problem, thank you very much @stephdl .
It is a problem of permissions.

chown redis:redis -R /var/lib/redis
systemctl start redis-rspamd
systemctl status redis-rspamd

ll /var/lib/redis/rspamd/
total 12
-rw-r--r-- 1 redis mail  4626 Sep 17 17:10 dump.rdb
1 Like

Yes my concern was that the /var/lib/redis folder was set with an ownership to olefy:olefy

How we can prevent this for the next time
Why this ownership has been set by the restoration

cc @davidep

To summarize, redis-rspamd doesn’t want to start because redis lost the permission to /var/lib/redis, the owner and the group was olefy

2 Likes

yes exactly, I had this problem on 2 servers always after the restore.
I confirm that on the other server I solved the group permissions change.
Little bug?

1 Like