Rspam filter stats have reset

NethServer Version: 7.9.2009
Module: rspam 2.4

Hello,
The status page of rspam has reset and is showing zero learned messages.
The uptime reported by the rspam status page corresponds with a restart of the VM host, so I suspect my NethServer VM wasn’t shutdown properly and that somehow caused rspam to reinitialize.
Is there anyway to diagnose what might have happened?

Many thanks
Bob

Did you update rspamd?

Let’s check rspamd version:

rpm -qa rspamd

See also this thread:

everythings is stored under a redis database that you can find at /var/lib/redis/rspamd/ if something occured bad like a shutdown maybe rspamd started a new redis databse (if the former was corrupted)

1 Like

Hello,

@mrmarkuz
[root@nethserver ~]# rpm -qa rspamd
rspamd-2.5-156.x86_64
I’ve updated rspamd many times and never had the statistics page reset.

@stephdl
[root@nethserver rspamd]# cd /var/lib/redis/rspamd/
[root@nethserver rspamd]# ls -lh
total 17M
-rw-r–r-- 1 redis mail 8.2M Feb 20 10:58 dump.rdb
-rw-r–r-- 1 redis mail 8.2M Feb 7 20:45 temp-739.rdb
The date of Feb 7 20:45 matches up with the VM host reboot. Is the file temp-739.rdb an old database?

The only other time I can remember the rspamd statistics resetting themselves was after I restored my NethServer VM from a ZFS snapshot almost 1.5years ago.

Thank you both for your help.

regards
bob

1 Like

ok we found so why you stats has been restarted from scratch. I bet it is better to accept to play with the new db of redis because you have a gap of time now between the two databases.

1 Like

I’m happy to leave the current system as it is.

For anyone else that comes across this thread in the future,
please can I confirm that the cause of the stats being reset was a corrupted redis database?

Many thanks
Bob

1 Like

I know this behavior, but I did not know the reason.
In such cases or freshly installed systems I train my system manually.

  1. Download spam samples from http://untroubled.org/spam/:
    wget http://untroubled.org/spam/2021-01.7z
  2. unzip: 7za x 2021-01.7z
  3. train: rspamc learn_spam 2021/01/*
  4. check: [root@srv01 ~]# rspamc stat
    Total learns: 1055

Sincerely, Marko

2 Likes

…and at the opportunity asked because it might fit to the topic… How do you reset a trained bayes filter manually?

https://wiki.nethserver.org/doku.php?id=howto:useful_commands#reset_bayes_data

not sure it is a good idea but you asked for

1 Like

Thank you for this hint.

are unintended side effects to be expected as a result?

Sincerely, Marko

no ideas yet, however you have always a risk when you alter a databse. Maybe stop rspamd redis-rspamd, remove the database, restart rspamd is less risky

I did it and Rspamd is still running.
But the reset doesn’t work. Because do not want to hijack the thread completely I, for that there is a new one.