apt package configure step fails without explanation if non-existent user is referenced in /etc/group

Bug #578216 reported by Krzysztof Foltman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: apt

I've changed the username after installing the system a long time ago, and the /etc/group file referred to both the old username (non-existent) and the new username.

This worked for months until I upgraded to Ubuntu Lucid Lynx - the upgrade failed because the new apt package couldn't be configured (the dpkg --configure apt step also failed when ran manually). Short investigation using strace -f showed that the problem was related to the old username triggering an error condition. Running apt.postinst script manually didn't cause any error though and exited with exit code 0.

The deleted username is krzysiek, the new username is kfoltman. The incorrect username was mentioned BEFORE the correct username in each relevant line of /etc/group. Like this:

adm:x:4:krzysiek,kfoltman

This is the possibly relevant fragment of the output of strace -f

[pid 5474] getcwd("/var/lib/dpkg/info", 4096) = 19
[pid 5474] setreuid(4294967295, 0) = 0
[pid 5474] setuid(0) = 0
[pid 5474] setregid(4294967295, 0) = 0
[pid 5474] lstat("/etc/sudoers", {st_mode=S_IFREG|0440, st_size=557, ...}) = 0
[pid 5474] setregid(4294967295, 0) = 0
[pid 5474] setreuid(0, 1) = 0
[pid 5474] open("/etc/sudoers", O_RDONLY) = 5
[pid 5474] fstat(5, {st_mode=S_IFREG|0440, st_size=557, ...}) = 0
[pid 5474] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff06419d000
[pid 5474] read(5, "# /etc/sudoers\n#\n# This file MUS"..., 4096) = 557
[pid 5474] lseek(5, 0, SEEK_SET) = 0
[pid 5474] fcntl(5, F_SETFD, FD_CLOEXEC) = 0
[pid 5474] setreuid(4294967295, 0) = 0
[pid 5474] setuid(0) = 0
[pid 5474] setregid(4294967295, 0) = 0
[pid 5474] ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff76b4b1d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 5474] read(5, "# /etc/sudoers\n#\n# This file MUS"..., 8192) = 557
[pid 5474] read(5, "", 4096) = 0
[pid 5474] read(5, "", 8192) = 0
[pid 5474] ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff76b4b1d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 5474] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 6
[pid 5474] lseek(6, 0, SEEK_CUR) = 0
[pid 5474] fstat(6, {st_mode=S_IFREG|0644, st_size=1782, ...}) = 0
[pid 5474] mmap(NULL, 1782, PROT_READ, MAP_SHARED, 6, 0) = 0x7ff06419c000
[pid 5474] lseek(6, 1782, SEEK_SET) = 1782
[pid 5474] fstat(6, {st_mode=S_IFREG|0644, st_size=1782, ...}) = 0
[pid 5474] munmap(0x7ff06419c000, 1782) = 0
[pid 5474] close(6) = 0
[pid 5474] write(2, "sudo", 4) = 4
[pid 5474] write(2, ": ", 2) = 2
[pid 5474] write(2, "unknown user: krzysiek", 22) = 22
[pid 5474] write(2, "\n", 1) = 1
[pid 5474] close(5) = 0

Note that this message (unknown user: krzysiek) wasn't displayed anywhere, so I had to use strace to find out why is it failing.

This might be an uncommon scenario (my system was misconfigured), but still, everything else seemed to handle that error just fine. And the error message being suppressed makes it hard to fix the problem. The obvious attempts to remedy the problem (apt --reinstall install apt, dpkg --configure -a) also failed, as the error wasn't related to order of configuration steps.

Revision history for this message
Adam Collard (adam-collard) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Can you please confirm how you went about upgrading to Lucid Lynx?

Changed in apt (Ubuntu):
status: New → Incomplete
Revision history for this message
Krzysztof Foltman (kfoltman) wrote :

I don't understand the question, but do you mean how did I initiate the upgrade? I don't remember, but I think it was the usual way, i.e. using Update Manager.

Removing the invalid user from the group (manually) fixed the problem, and I was able to finish the upgrade.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for apt (Ubuntu) because there has been no activity for 60 days.]

Changed in apt (Ubuntu):
status: Incomplete → Expired
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.