Spamassassin 3.4.0 update fails

Asked by Tom Boucher

During automated update spamassassin:all 3.4.0-1ubuntu2 failed to update.

error is:

A package failed to install. Trying to recover:
Setting up spamassassin (3.4.0-1ubuntu2) ...
chown: invalid group: ‘debian-spamd:debian-spamd’
dpkg: error processing package spamassassin (--configure):

I have been using spamd for some time as my group, not sure why this is trying to change it.

 aptitude versions spamassassin
Package claws-mail-spamassassin:
p 3.9.3-1ubuntu1 trusty 500

Package claws-mail-spamassassin:i386:
p 3.9.3-1ubuntu1 trusty 500

Package spamassassin:
p A 3.4.0-1ubuntu1 trusty 500
C A 3.4.0-1ubuntu2 trusty-updates 500

Package spamassassin-heatu:
p 3.02+20101108-2 trusty 500

Package spamassassin-rules-ja:
p 9ubuntu1 trusty 500

uname -a
Linux ip-10-184-55-157 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 sa-compile Tools for compiling SpamAssassin rules into C

The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 spamassassin Perl-based spam filter using text analysis

# apt-cache policy spamassassin
spamassassin:
  Installed: 3.4.0-1ubuntu2
  Candidate: 3.4.0-1ubuntu2
  Version table:
 *** 3.4.0-1ubuntu2 0
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.4.0-1ubuntu1 0
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

apt-get --simulate install spamassassinReading package lists... Done
Building dependency tree
Reading state information... Done
spamassassin is already the newest version.
spamassassin set to manually installed.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  linux-headers-3.13.0-40 linux-headers-3.13.0-40-generic
  linux-image-3.13.0-39-generic linux-image-3.13.0-40-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Conf spamassassin (3.4.0-1ubuntu2 Ubuntu:14.04/trusty-updates [all])
Conf sa-compile (3.4.0-1ubuntu2 Ubuntu:14.04/trusty-updates [all])

Any suggestions on what to do to resolve? Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu spamassassin Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the following terminal commands:

uname -a
lsb_release -a
grep spamd /etc/passwd
grep spamd /etc/group
ls -ld /var/lib/spamassassin
sudo dpkg --configure -a

Revision history for this message
Tom Boucher (trekkie-b) said :
#2

root@ip-10-184-55-157:/etc/spamassassin# uname -a
Linux ip-10-184-55-157 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@ip-10-184-55-157:/etc/spamassassin# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
root@ip-10-184-55-157:/etc/spamassassin# grep spamd /etc/passwd
spamd:x:1001:1001:,,,:/var/lib/spamassassin:/bin/false
debian-spamd:x:113:119::/var/lib/spamassassin:/bin/sh
root@ip-10-184-55-157:/etc/spamassassin# grep spamd /etc/group
spamd:x:1001:spamass-milter
root@ip-10-184-55-157:/etc/spamassassin# ls -ld /var/lib/spamassassin
drwxr-xr-x 9 spamd spamd 4096 May 11 2014 /var/lib/spamassassin
root@ip-10-184-55-157:/etc/spamassassin# sudo dpkg --configure -a
Setting up spamassassin (3.4.0-1ubuntu2) ...
chown: invalid group: ‘debian-spamd:debian-spamd’
dpkg: error processing package spamassassin (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sa-compile:
 sa-compile depends on spamassassin (>= 3.3.2-8); however:
  Package spamassassin is not configured yet.

dpkg: error processing package sa-compile (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 spamassassin
 sa-compile

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

There is an inconsistency with the user and group settings for spamassassin.

There should be a user and a group debian-spamd to be the owner of the spamassassin files /directories.

On your system there is a user and group spamd, who is the current owner of the /var/lib/spamassassin directory, and there is a user debian-spamd existing, but no group debian-spamd.

This leads to the failure in the postinst script.

Have you manually created a user "debian-spamd"?

Proposals for remedy or workaround:
1. deleting the debian-spamd user (sudo deluser debian-spamd) or manually creating the debian-spamd group (sudo groupadd debian-spamd) (but better not both!)
and after that re-issue sudo dpkg --configure -a
2. You could create a bug report with your problem, requesting that the postinst script correctly takes into account the case that a user debian-spamd exists, but no group debian-spamd is existing.

Revision history for this message
Tom Boucher (trekkie-b) said :
#4

Hmm.

Setting up spamassassin (3.4.0-1ubuntu2) ...
Warning: The home dir /var/lib/spamassassin you specified already exists.
Adding system user `debian-spamd' (UID 113) ...
Adding new group `debian-spamd' (GID 120) ...
Adding new user `debian-spamd' (UID 113) with group `debian-spamd' ...
The home directory `/var/lib/spamassassin' already exists. Not copying from `/etc/skel'.
adduser: Warning: The home directory `/var/lib/spamassassin' does not belong to the user you are currently creating.
Starting SpamAssassin Mail Filter Daemon: /usr/bin/perl already running.
spamd.
Setting up sa-compile (3.4.0-1ubuntu2) ...

It appears this update is trying to / creating the debian-spamd user and group. Did that change between the two versions?

I was able to flip the permissions back to my 'spamd' user/group as it was before after the fact.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#5

It seems that the update now worked.

Information in the postinst script indicates that the user debian-spamd may have been introduced with version 3.3.2-3 (in 2012 ?). I do not know the history of your system (what version of spamassassin you originally installed and what the history of the upgrades was), so I cannot tell anything.

Please have a look at the spamassassin processes, whether they are now working well.
If you have no further question and if no other problem is showing up, you might mark this question as solved.

Revision history for this message
Tom Boucher (trekkie-b) said :
#6

Thanks Manfred Hampl, that solved my question.