#986034 sa-compile broken under apt-get upgrade

#986034#5
Date:
2021-03-28 11:47:34 UTC
From:
To:
Dear Maintainer,

# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  liblua5.2-0
Use 'apt autoremove' to remove it.
The following packages have been kept back:
  linux-image-amd64
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up sa-compile (3.4.2-1+deb10u3) ...
Running sa-compile (may take a long time)
chmod: changing permissions of '/var/lib/spamassassin/compiled/5.028/3.004002/Mail/SpamAssassin/CompiledRegexps/body_0.pm': Operation not permitted
dpkg: error processing package sa-compile (--configure):
 installed sa-compile package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 sa-compile
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ ls -l /var/lib/spamassassin/compiled/5.028/3.004002/Mail/SpamAssassin/CompiledRegexps/body_0.pm
-r--r--r-- 1 root root 32641 Aug 25  2020 /var/lib/spamassassin/compiled/5.028/3.004002/Mail/SpamAssassin/CompiledRegexps/body_0.pm
$ ls -l /var/lib/spamassassin/compiled/5.028/3.004002/Mail/SpamAssassin/
total 0
drwxr-xr-x 2 debian-spamd debian-spamd 23 Aug 25  2020 CompiledRegexps

#986034#10
Date:
2021-03-30 03:02:39 UTC
From:
To:
/var/lib/spamassassin/compiled/5.028/3.004002/Mail/SpamAssassin/CompiledRegexps/body_0.pm
isn't owned by root in a default installation of spamassassin.  Most
likely somebody previously ran sa-compile as root on your system, rather
than as the 'debian-spamd' user that's used by the daily cron job.  That
is known to break things right now.  The workaround is to delete the
root-owned file and let sa-compile recreate it.

The spamassassin packages need to do a better job of recovering from
or preventing this scenario, but at the moment they don't.

noah