Dpkg fails to reinstall MTA Exim4 due to; "exim: failed to find uid for user name "Debian-exim"

Bug #1648934 reported by Nathaniel Homier
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
exim4 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

nate@frontier:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety

I had installed Exim4 MTA. I had a problem in Exim4 unrelated to the dpkg error. I reinstalled Exim4 MTA and became entangled in dependency hell. This always happens with Exim4. Dpkg does something to get confused. This is very much a bug. Postfix is not an option. I have another vm running Exim4 at the moment, but would like to get Exim4 running on the Ubuntu machine.

I tried following this howto to solve it and that failed; https://ubuntuforums.org/showthread.php?t=2309546

Here is the output of trying to reinstall;

nate@frontier:~$ sudo apt install exim4
[sudo] password for nate:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.8.0-22 linux-headers-4.8.0-22-generic linux-headers-4.8.0-26
  linux-headers-4.8.0-26-generic linux-image-4.8.0-22-generic
  linux-image-4.8.0-26-generic linux-image-extra-4.8.0-22-generic
  linux-image-extra-4.8.0-26-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  exim4-base exim4-config exim4-daemon-light
Suggested packages:
  eximon4 exim4-doc-html | exim4-doc-info spf-tools-perl swaks
The following NEW packages will be installed:
  exim4 exim4-base exim4-config exim4-daemon-light
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,638 kB of archives.
After this operation, 3,780 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 exim4-config all 4.87-3ubuntu1 [302 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 exim4-base amd64 4.87-3ubuntu1 [884 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 exim4-daemon-light amd64 4.87-3ubuntu1 [444 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 exim4 all 4.87-3ubuntu1 [7,872 B]
Fetched 1,638 kB in 14s (112 kB/s)
Preconfiguring packages ...
Selecting previously unselected package exim4-config.
(Reading database ... 427338 files and directories currently installed.)
Preparing to unpack .../0-exim4-config_4.87-3ubuntu1_all.deb ...
Unpacking exim4-config (4.87-3ubuntu1) ...
Selecting previously unselected package exim4-base.
Preparing to unpack .../1-exim4-base_4.87-3ubuntu1_amd64.deb ...
Unpacking exim4-base (4.87-3ubuntu1) ...
Selecting previously unselected package exim4-daemon-light.
Preparing to unpack .../2-exim4-daemon-light_4.87-3ubuntu1_amd64.deb ...
Unpacking exim4-daemon-light (4.87-3ubuntu1) ...
Selecting previously unselected package exim4.
Preparing to unpack .../3-exim4_4.87-3ubuntu1_all.deb ...
Unpacking exim4 (4.87-3ubuntu1) ...
Setting up exim4-config (4.87-3ubuntu1) ...
exim: failed to find uid for user name "Debian-exim"
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated
dpkg: error processing package exim4-config (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
dpkg: dependency problems prevent configuration of exim4-base:
 exim4-base depends on exim4-config (>= 4.82) | exim4-config-2; however:
  Package exim4-config is not configured yet.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is not configured yet.

dpkg: error processing package exim4-base (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    dpkg: dependency problems prevent configuration of exim4:
 exim4 depends on exim4-base (>= 4.87-3ubuntu1); however:
  Package exim4-base is not configured yet.
 exim4 depends on exim4-base (<< 4.87-3ubuntu1.1); however:
  Package exim4-base is not configured yet.

dpkg: error processing package exim4 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for doc-base (0.10.7) ...
Processing 3 added doc-base files...
Registering documents with scrollkeeper...
Processing triggers for systemd (231-9ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
dpkg: dependency problems prevent configuration of exim4-daemon-light:
 exim4-daemon-light depends on exim4-base (>= 4.87); however:
  Package exim4-base is not configured yet.

dpkg: error processing package exim4-daemon-light (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 exim4-config
 exim4-base
 exim4
 exim4-daemon-light
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here are some things I tried;

nate@frontier:~$ sudo apt-get clean exim4
[sudo] password for nate:
nate@frontier:~$ sudo apt-get clean exim4
nate@frontier:~$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu yakkety-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu yakkety InRelease
Hit:3 http://ppa.launchpad.net/atareao/atareao/ubuntu yakkety InRelease
Hit:4 http://archive.canonical.com/ubuntu yakkety InRelease
Get:5 http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease [102 kB]
Hit:6 http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu yakkety InRelease
Hit:7 http://ppa.launchpad.net/system76-dev/stable/ubuntu yakkety InRelease
Get:8 http://us.archive.ubuntu.com/ubuntu yakkety-backports InRelease [102 kB]
Fetched 204 kB in 1s (191 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
nate@frontier:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.8.0-22 linux-headers-4.8.0-22-generic linux-headers-4.8.0-26
  linux-headers-4.8.0-26-generic linux-image-4.8.0-22-generic
  linux-image-4.8.0-26-generic linux-image-extra-4.8.0-22-generic
  linux-image-extra-4.8.0-26-generic
0 upgraded, 0 newly installed, 8 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 628 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
nate@frontier:~$ sudo dpkg --remove exim4
dpkg: warning: ignoring request to remove exim4, only the config
 files of which are on the system; use --purge to remove them too
nate@frontier:~$ sudo dpkg --purge exim4
(Reading database ... 427523 files and directories currently installed.)
Removing exim4 (4.87-3ubuntu1) ...
Purging configuration files for exim4 (4.87-3ubuntu1) ...
nate@frontier:~$ dpkg -l | grep exim4
iU exim4-base 4.87-3ubuntu1 amd64 support files for all Exim MTA (v4) packages
iF exim4-config 4.87-3ubuntu1 all configuration for the Exim MTA (v4)
iU exim4-daemon-light 4.87-3ubuntu1 amd64 lightweight Exim MTA (v4) daemon
nate@frontier:~$ sudo dpkg --purge exim4-base
dpkg: dependency problems prevent removal of exim4-base:
 exim4-daemon-light depends on exim4-base (>= 4.87).

dpkg: error processing package exim4-base (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 exim4-base
nate@frontier:~$ sudo dpkg --purge exim4-config
dpkg: dependency problems prevent removal of exim4-config:
 exim4-base depends on exim4-config (>= 4.82) | exim4-config-2; however:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.
 exim4-base depends on exim4-config (>= 4.82) | exim4-config-2; however:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.

dpkg: error processing package exim4-config (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 exim4-config
nate@frontier:~$ sudo dpkg --purge --force-remove-reinstreq exim4-base
dpkg: dependency problems prevent removal of exim4-base:
 exim4-daemon-light depends on exim4-base (>= 4.87).

dpkg: error processing package exim4-base (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 exim4-base
nate@frontier:~$ sudo dpkg --purge --force-remove-reinstreq exim4-daemon-light
(Reading database ... 50%
(Reading database ... 427523 files and directories currently installed.)
Removing exim4-daemon-light (4.87-3ubuntu1) ...
Purging configuration files for exim4-daemon-light (4.87-3ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
nate@frontier:~$
nate@frontier:~$ sudo dpkg --purge --force-remove-reinstreq exim4-config
dpkg: dependency problems prevent removal of exim4-config:
 exim4-base depends on exim4-config (>= 4.82) | exim4-config-2; however:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.
 exim4-base depends on exim4-config (>= 4.82) | exim4-config-2; however:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.

dpkg: error processing package exim4-config (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 exim4-config
nate@frontier:~$ sudo dpkg --purge --force-remove-reinstreq exim4-base
(Reading database ... 427495 files and directories currently installed.)
Removing exim4-base (4.87-3ubuntu1) ...
Purging configuration files for exim4-base (4.87-3ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for doc-base (0.10.7) ...
Processing 3 removed doc-base files...
Registering documents with scrollkeeper...
Processing triggers for systemd (231-9ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
nate@frontier:~$ sudo dpkg --purge --force-remove-reinstreq exim4-config
(Reading database ... 427422 files and directories currently installed.)
Removing exim4-config (4.87-3ubuntu1) ...
Purging configuration files for exim4-config (4.87-3ubuntu1) ...
dpkg-statoverride: warning: no override present
dpkg: warning: while removing exim4-config, directory '/var/lib/exim4' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...
nate@frontier:~$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu yakkety InRelease
Get:2 http://security.ubuntu.com/ubuntu yakkety-security InRelease [102 kB]
Hit:3 http://ppa.launchpad.net/atareao/atareao/ubuntu yakkety InRelease
Hit:4 http://archive.canonical.com/ubuntu yakkety InRelease
Get:5 http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease [102 kB]
Hit:6 http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu yakkety InRelease
Hit:7 http://ppa.launchpad.net/system76-dev/stable/ubuntu yakkety InRelease
Get:8 http://us.archive.ubuntu.com/ubuntu yakkety-backports InRelease [102 kB]
Fetched 306 kB in 0s (310 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
nate@frontier:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.8.0-22 linux-headers-4.8.0-22-generic linux-headers-4.8.0-26
  linux-headers-4.8.0-26-generic linux-image-4.8.0-22-generic
  linux-image-4.8.0-26-generic linux-image-extra-4.8.0-22-generic
  linux-image-extra-4.8.0-26-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nate@frontier:~$ sudo apt-get clean exim4
nate@frontier:~$ sudo apt-get clean exim4-config
nate@frontier:~$ sudo apt-get clean exim4-base
nate@frontier:~$ sudo apt-get clean exim4-daemon-light
nate@frontier:~$ sudo dpkg --configure -a

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: dpkg 1.18.10ubuntu1
ProcVersionSignature: Ubuntu 4.8.0-30.32-generic 4.8.6
Uname: Linux 4.8.0-30-generic x86_64
ApportVersion: 2.20.3-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Dec 9 22:23:45 2016
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: dpkg
UpgradeStatus: Upgraded to yakkety on 2016-10-17 (54 days ago)

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :
Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

I also tried autoclean and also manually deleted dir and files that were left behind.

I see this error too;
exim: failed to find uid for user name "Debian-exim"
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated
dpkg: error processing package exim4-config (--configure):
 subprocess installed post-installation script returned error exit status 1

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

I also tried;
compgen -u
Debian-exim
sudo deluser Debian-exim
sudo deluser --group Debian-exim

And;
sudo apt-get remove --purge exim4\*
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
sudo dpkg --purge `COLUMNS=300 dpkg -l "*" | egrep "^rc" | cut -d\ -f3`
sudo rm -r /var/lib/exim4
sudo rm /var/crash/exim4-config.0.crash
sudo updatedb

Still get;
exim: failed to find uid for user name "Debian-exim"
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated
dpkg: error processing package exim4-config (--configure):
 subprocess installed post-installation script returned error exit status 1

Please help me with this bug. I don't know what else to do. Postfix is not an option.

summary: - Dpkg fails to reinstall MTA Exim4 due to dependency errors; E: Sub-
- process /usr/bin/dpkg returned an error code (1)
+ Dpkg fails to reinstall MTA Exim4 due to; "exim: failed to find uid for
+ user name "Debian-exim"
Adam Conrad (adconrad)
affects: dpkg (Ubuntu) → exim4 (Ubuntu)
Revision history for this message
Joshua Powers (powersj) wrote :

> exim: failed to find uid for user name "Debian-exim"

How did you remove or reinstall exim the first time? Trying to figure out how to reproduce this.

Also do /etc/passwd and /etc/group have entries for Debian-exim?

Changed in exim4 (Ubuntu):
status: New → Incomplete
Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

I just apt remove exim4
then I apt install exim4
Got error as noted above
Then apt purge exim4 and got error

etc/passwd: Debian-exim:x:122:131::/var/spool/exim4:/bin/false
etc/group: Debian-exim:x:131:

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hmm, the user is intentionally note removed since [1].
But on config there is a check like:
  ! getent passwd Debian-exim
     adduser ...

Now getent doesn't complain the way the error message looks like.
Also if it would be it would create the user.
This matches that you still have the users in passwd/group.

We have to assume that a command later on fails to properly get the uid.
But to go on we would have to know which.
I looked at the dpkg-statoverride /chown in there but that wasn't the problem.
Maybe you could look at /var/lib/dpkg/info/exim4-config.postinst and try to find which is throwing this error in your environment.

I tried various install/remove/purge combos but the issue didn't trigger for me to test here.

[1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270681

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

ChristianEhrhardt (paelzer) I looked at exim4-config.postinst.

Only thing I could see was;

if [ "$1" = "configure" ] &&\
 ! getent passwd Debian-exim > /dev/null ; then
 echo 'Adding system-user for exim (v4)' 1>&2
 adduser --system --group --quiet --home /var/spool/exim4 \
         --no-create-home --disabled-login --force-badname Debian-exim

But I'm not really good at packaging files or commands.

It's really these 2 errors;
exim: failed to find uid for user name "Debian-exim"
and
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated

and we know it's post install because of;
subprocess installed post-installation script returned error exit status 1
Which I would assume it means that Exim4 gets installed but configuring it is screwed up.

Is there some command or way to see a detailed listing of whats going on during post install, like a debug output switch?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Nathaniel,
yeah -a lso maybe the username is a red herring and the configfile is the actual issue.

You can follow [1] a bit.
And also consider the env vars of dpkd-maintscript-helper and dpkg.
So in your case likely something like:

DPKG_DEBUG=1 DPKG_MAINTSCRIPT_DEBUG=1 dpkg -i /var/cache/apt/archives/exim4-config_4.87-3ubuntu1.deb

If that is not enough
DPKG_DEBUG=1 DPKG_MAINTSCRIPT_DEBUG=1 dpkg --debug=3773 -i /var/cache/apt/archives/exim4-config_4.87-3ubuntu1.deb

Also what is the cotent (if still around) of /var/lib/exim4/config.autogenerated.tmp (and /var/lib/exim4/config.autogenerated)?

[1]: http://shearer.org/Debugging_Dpkg_Problems

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Related? https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816790
But we have that fix as it was done in 4.86

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

Only thing I could see was D000040: checking Breaks
D000400: checking virtbroken exim4-config-2
Setting up exim4-config (4.88-5ubuntu1) ...
D000001: deferred_configure updating conffiles

And that's only because it says virtbroken, I have no idea what that word means.

I'll dump the output to a file and attach. dpkg-debug-exim4.txt

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Since you already worked through getting it purged I wonder if some of things left, like /var/lib/exim4 would have to be removed to let the autogeneration work properly on next install.

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

I had already tried removing the /var/lib/exim4 dir and it was a no go.

I see exim4-config.0.crash in /var/crash. Would that be helpful to upload. Would it contain passwords?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Nathaniel,
sorry this took so long, I must have lost track of this :-/

The crash is a memory dump of the program and therefore could contain passwords.
Although you can upload just the stacktrace of it - not sure it helps thou.
To do so look at [1].

[1]: http://manpages.ubuntu.com/manpages/xenial/man1/apport-retrace.1.html

Revision history for this message
dino99 (9d9) wrote :

This is an unsupported release now. Please think to install the next LTS 'Bionic 18.04'

http://cdimage.ubuntu.com/ubuntu-next/daily-live/current/
https://www.omgubuntu.co.uk/2018/02/ubuntu-18-04-minimal-install-option

Changed in exim4 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.