spamassassin (out of the blue) on latest directadmin

Alex1441

Verified User
Joined
May 25, 2026
Messages
16
Location
UK
Woke up this morning and saw: spamassassin.service loaded failed failed Spamassassin daemon

journalctl -xeu spamassassin.service

mail spamd[690847]: logger: removing stderr method mail spamd[690850]: config: cannot opendir /var/lib/spamassassin/4.000002: Permission denied mail spamd[690850]: readdir() attempted on invalid dirhandle SA_CF_DIR at /usr/share/perl/5.40.1/Mail/SpamAssassin.pm line 2326. mail spamd[690850]: closedir() attempted on invalid dirhandle SA_CF_DIR at /usr/share/perl/5.40.1/Mail/SpamAssassin.pm line 2328. mail spamd[690850]: config: cannot opendir /var/lib/spamassassin/4.000002: Permission denied mail spamd[690850]: readdir() attempted on invalid dirhandle SA_CF_DIR at /usr/share/perl/5.40.1/Mail/SpamAssassin.pm line 2326. mail spamd[690850]: closedir() attempted on invalid dirhandle SA_CF_DIR at /usr/share/perl/5.40.1/Mail/SpamAssassin.pm line 2328. mail spamd[690850]: config: no rules were found! Do you need to run 'sa-update'?

any idea?
 
Hello,

While I'm out of ideas what exactly went wrong on your server, I could suggest that you try and re-install SpamAssassin with CustomBuild/DirectAdmin or at least run sa-update -D and see whether or not it fixes the issue.
 
Hi,

Already did the rebuild...


sa-update -D

Dec 4 12:09:53.055 [707009] dbg: logger: adding facilities: all
Dec 4 12:09:53.055 [707009] dbg: logger: logging level is DBG
Dec 4 12:09:53.055 [707009] dbg: generic: SpamAssassin version 4.0.2
Dec 4 12:09:53.056 [707009] dbg: generic: Perl 5.040001, PREFIX=/usr, DEF_RULES_DIR=/usr/share/spamassassin, LOCAL_RULES_DIR=/etc/mail/spamassassin, LOCAL_STATE_DIR=/var/lib/spamassassin
Dec 4 12:09:53.056 [707009] dbg: config: timing enabled
Dec 4 12:09:53.056 [707009] dbg: config: score set 0 chosen.
Dec 4 12:09:53.058 [707009] dbg: generic: sa-update version 4.0.2 / svn1924963
Dec 4 12:09:53.058 [707009] dbg: generic: using update directory: /var/lib/spamassassin/4.000002
Dec 4 12:09:53.116 [707009] dbg: diag: perl platform: 5.040001 linux
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: Digest::SHA, version 6.04
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: HTML::Parser, version 3.83
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: Net::DNS, version 1.57
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: NetAddr::IP, version 4.079
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: Time::HiRes, version 1.9777
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: Archive::Tar, version 3.02_001
Dec 4 12:09:53.116 [707009] dbg: diag: [...] module installed: IO::Zlib, version 1.15
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Digest::SHA1 ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: MIME::Base64, version 3.16_01
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: DB_File, version 1.859
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Net::SMTP, version 3.15
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Net::LibIDN2 ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Net::LibIDN, version 0.12
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Mail::SPF ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: MaxMind::DB::Reader ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: MaxMind::DB::Reader::XS ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: IP::Geolocation::MMDB ('require' failed) Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Geo::IP ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: IP::Country::DB_File ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: IP::Country::Fast ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Razor2::Client::Agent ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: IO::Socket::IP, version 0.42
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: IO::Socket::INET6, version 2.73
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: IO::Socket::SSL, version 2.089
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Compress::Zlib, version 2.212
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Mail::DKIM, version 1.20240923
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: DBI ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: DBD::SQLite ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: LWP::Protocol::https, version 6.14
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: LWP::UserAgent, version 6.78
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Encode::Detect::Detector ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Net::Patricia ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Net::CIDR::Lite ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Net::DNS::Nameserver, version 2002
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: BSD::Resource ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module installed: Archive::Zip, version 1.68
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: IO::String ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Email::Address::XS ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Mail::DMARC ('require' failed) Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Devel::Cycle ('require' failed)
Dec 4 12:09:53.116 [707009] dbg: diag: [...] optional module not installed: Text::Diff ('require' failed)
Dec 4 12:09:53.118 [707009] dbg: gpg: Searching for 'gpg'
Dec 4 12:09:53.118 [707009] dbg: util: current PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Dec 4 12:09:53.118 [707009] dbg: util: executable for gpg was found at /usr/bin/gpg
Dec 4 12:09:53.118 [707009] dbg: gpg: found /usr/bin/gpg
Dec 4 12:09:53.118 [707009] dbg: gpg: release trusted key id list: 5E541DC959CB8BAC7C78DFDC4056A61A5244EC45 0C2B1D7175B852C64B3CDC716C55397824F434CE
Dec 4 12:09:53.118 [707009] dbg: util: secure_tmpfile created a temporary file /tmp/.spamassassin707009MTiXqTtmp
Dec 4 12:09:53.118 [707009] dbg: channel: attempting channel updates.spamassassin.org
Dec 4 12:09:53.118 [707009] dbg: channel: using existing directory /var/lib/spamassassin/4.000002/updates_spamassassin_org
Dec 4 12:09:53.118 [707009] dbg: channel: channel cf file /var/lib/spamassassin/4.000002/updates_spamassassin_org.cf
Dec 4 12:09:53.118 [707009] dbg: channel: channel pre file /var/lib/spamassassin/4.000002/updates_spamassassin_org.pre
Dec 4 12:09:53.119 [707009] dbg: channel: metadata version = 1941174, from file /var/lib/spamassassin/4.000002/updates_spamassassin_org.cf
Dec 4 12:09:53.131 [707009] dbg: dns: 2.0.4.updates.spamassassin.org => 1941174, parsed as 1941174
Dec 4 12:09:53.131 [707009] dbg: channel: current version is 1941174, new version is 1941174, skipping channel
Dec 4 12:09:53.131 [707009] dbg: diag: updates complete, exiting with code 1

no idea...
 
Missing modules hardly are related to the error "cannot opendir /var/lib/spamassassin/4.000002". So the folder "/var/lib/spamassassin/4.000002" exists according to the output. Do you still have the issue afterwards?
 
it's there

ll /var/lib/spamassassin/4.000002

Permissions Size User Group Date Modified Name
drw-rw---- - root root 4 Dec 10:04 updates_spamassassin_org
.rw-rw---- 3.2k root root 4 Dec 10:04  updates_spamassassin_org.cf
 
Code:
chmod -v 755 /var/lib/spamassassin/4.000002/ /var/lib/spamassassin/4.000002/updates_spamassassin_org

should fix the folders permissions
 
chmod -v 755 /var/lib/spamassassin/4.000002/ /var/lib/spamassassin/4.000002/updates_spamassassin_org
mode of '/var/lib/spamassassin/4.000002/' retained as 0755 (rwxr-xr-x)
mode of '/var/lib/spamassassin/4.000002/updates_spamassassin_org' retained as 0755 (rwxr-xr-x)
systemctl start spamd.service
Job for spamassassin.service failed because the control process exited with error code.
See "systemctl status spamassassin.service" and "journalctl -xeu spamassassin.service" for details.
journalctl -xeu spamassassin.service


░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit spamassassin.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Dec 04 12:26:19 mail systemd[1]: Starting spamassassin.service - Spamassassin daemon...
░░ Subject: A start job for unit spamassassin.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit spamassassin.service has begun execution.
░░
░░ The job identifier is 90525.
Dec 04 12:26:19 mail spamd[717798]: logger: removing stderr method Dec 04 12:26:19 mail spamd[717801]: config: cannot open "/var/lib/spamassassin/4.000002/updates_spamassassin_org.cf": Permission denied Dec 04 12:26:19 mail spamd[717801]: config: no rules were found! Do you need to run 'sa-update'?
Dec 04 12:26:20 mail spamd[717798]: child process [717801] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 3136.
Dec 04 12:26:20 mail spamd[717798]: child process [717801] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 3136.
Dec 04 12:26:20 mail systemd[1]: spamassassin.service: Control process exited, code=exited, status=255/EXCEPTION
same
 
chmod -v 755 /var/lib/spamassassin/4.000002/ /var/lib/spamassassin/4.000002/updates_spamassassin_org
mode of '/var/lib/spamassassin/4.000002/' retained as 0755 (rwxr-xr-x)
mode of '/var/lib/spamassassin/4.000002/updates_spamassassin_org' retained as 0755 (rwxr-xr-x)

Did you try the command twice? Any way what are other permissions?


Code:
ls -dl /var/lib/spamassassin/4.000002
ls -dl /var/lib/spamassassin/
ls -dl /var/lib/
ls -dl /var/
?
 
Did you try the command twice? Yes, accidentaly

ls -dl /var/lib/spamassassin/4.000002
drwxr-xr-x 3 root root 4.0K Dec 4 10:04 /var/lib/spamassassin/4.000002

ls -dl /var/lib/spamassassin/
drwxr-xr-x 4 root root 4.0K Sep 10 2025 /var/lib/spamassassin/

ls -dl /var/lib/
drwxr-xr-x 44 root root 4.0K Nov 13 20:57 /var/lib/

ls -dl /var/
drwxr-xr-x 13 root root 4.0K May 26 2026 /var
 
Will it help to start Spamd?

Code:
chmod -v 644 /var/lib/spamassassin/4.000002/updates_spamassassin_org.cf
chmod -v 644 /var/lib/spamassassin/4.000002/updates_spamassassin_org/*.cf

If the error persists what will see with:

Code:
grep ^SELINUX= /etc/selinux/config
?
 
chmod -v 644 /var/lib/spamassassin/4.000002/updates_spamassassin_org.cf
chmod -v 644 /var/lib/spamassassin/4.000002/updates_spamassassin_org/*.cf

Seems to have done it.
there is no selinux enabled

maybe during the updated the permissions got messed up?
anyway thank you for you're reply and support
 
Back
Top