dpkg-statoverride should not consider unknown group a "syntax error"

Bug #593615 reported by Bela Lubkin on 2010-06-14
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
dpkg (Debian)
Fix Released
Unknown
dpkg (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: dpkg

Removal of package gnokii-cli 0.6.28.dfsg-1 left /var/lib/dpkg/statoverride in a corrupted state (LP#537025, debbugs #563317):

   $ grep gnokii /var/lib/dpkg/statoverride
   root gnokii 4750 /usr/sbin/mgnokiidev

   $ ls -l /usr/sbin/mgnokiidev
   ls: cannot access /usr/sbin/mgnokiidev: No such file or directory

   $ grep gnokii /etc/group

   $ dpkg-statoverride --remove /usr/sbin/mgnokiidev
   dpkg-statoverrides: unrecoverable fatal error, aborting:
    syntax error: unknown group 'gnokii' in statoverride file

   $ dpkg-statoverride --list
   dpkg-statoverrides: unrecoverable fatal error, aborting:
    syntax error: unknown group 'gnokii' in statoverride file

The "corrupted state" here is that the statoverride file mentions a group which no longer exists. (The same issue occurs with a nonexistent user, as see in LP#161798

Problems with this:

1. Parsing of /var/lib/dpkg/statoverride should not require the users & groups to exist. Those are separately maintained databases; also, couldn't statoverride be referring to a file which may or may not exist and whose user/group identity might be maintained dynamically?

2. This is not a "syntax error" but an "unexpected value".

3. The error should not be fatal for --list.

4. The error should definitely not be fatal for an attempt to --remove the very entry which is being complained about!

5. Trivial: the message should not be prefixed with "dpkg-statoverrideS", which is neither the name of the utility nor of the data file.

To reproduce without the help of a defective package:

   # sudo sh -c 'echo "foo bar 1234 /etc/baz" >> /var/lib/dpkg/statoverride'
   # dpkg-statoverride --list

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: dpkg 1.15.5.6ubuntu4
ProcVersionSignature: Ubuntu 2.6.32-22.36-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Sun Jun 13 22:30:20 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha i386 (20091209)
ProcEnviron:
 PATH=(custom, user)
 LANG=C
 SHELL=/bin/bash
SourcePackage: dpkg

Bela Lubkin (filbo) wrote :
tags: added: patch
Victor Vargas (kamus) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=592764

Changed in dpkg (Ubuntu):
importance: Undecided → Low
status: New → Triaged
tags: added: patch-forwarded-debian
removed: patch
Victor Vargas (kamus) wrote :

This is a message extracted from Debian Tracker:

Just checked the patch, and it's not good, it does not preserve the
user/group names when writting the database back, which would be a
regression. It's also non-fatal for all ensure_statoverrides()
callers, which is not what we want.

I've code which should be doing the correct thing, it needs some
polishing though, but will be included in a next upload being either
1.15.8.5 or 1.15.9.

thanks,
guillem

tags: added: patch-rejected-debian
removed: patch-forwarded-debian
Paul Crawford (psc-sat) wrote :

Today I found I can't install the updates on my 10.04 system and the error given was:

dpkg: unrecoverable fatal error, aborting:
 syntax error: unknown group 'root' in statoverride file

But this is not included in the /var/log/* files and you can't copy & paste from the update manager!

The contents of my file are:

root mlocate 2755 /usr/bin/mlocate
root root 4755 /sbin/unix_chkpwd
hplip root 755 /var/run/hplip

I have seen a thread about hplib and a similar error message (http://ubuntuforums.org/showthread.php?t=186487) from 2006 but why is it still happening 4 years later!?

The suggestion there is to remove by the command:

dpkg-statoverride --remove /var/run/hplip

But guess what? It gives the same error message:

dpkg-statoverrides: unrecoverable fatal error, aborting:
 syntax error: unknown group 'root' in statoverride file

This is a serious error as it is preventing security related updates from being installed, and the average user should simply NOT have this sort of thing to deal with.

Changed in dpkg (Debian):
status: Unknown → New
mikey (abc-mikey) wrote :

I've just had this bug on Ubuntu 11.04. It stopped me from adding or removing packages because it couldn't find a group 'cdemu' which is carzy. I added the group using 'addgroup cdemu' and ran 'apt-get purge cdemu-client' deleted the group with 'delgroup cdemu' and was still stuck because it hadn't purged the reference to the cdemu group. So I found the name of the associated file 'vim /var/lib/dpkg/statoverride' in my case it was '/usr/bin/cdemud' and got rid of it with 'dpkg-statoverride --remove /usr/bin/cdemud'.

Changed in dpkg (Debian):
status: New → Fix Released
dino99 (9d9) wrote :

That version is no more supported

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

Other bug subscribers

Remote bug watches

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