logging of error in opening file

Bug #1253205 reported by Karl-Philipp Richter
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Ubuntu)
Fix Released
High
Unassigned
Nominated for Precise by Rolf Leggewie

Bug Description

if apt-cacher-ng 0.7.18-1 fails to start as a service due to a file permission error, it just displays <tt>Error opening file, terminating.</tt> and log files /var/log/apt-cacher-ng/apt-cacher.err and /var/log/apt-cacher-ng/apt-cacher.log are both empty. The user has to know which file caused the error.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I've been struggling with this problem for over half a year already. Confirming.

In my case it was the file /etc/apt-cacher-ng/security.conf that had permissions 640 with ownership root.root. this prevented the apt-cacher-ng user fromm reading the file. Changing ownership of the file to root.apt-cacher-ng fixed the issue here.

I kindly request any fix to be backported to precise as well.

Changed in apt-cacher-ng (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Karl-Philipp Richter (krichter722) wrote :

If fixed the problem by setting ownership of user and group of /etc/apt-cacher-ng/security.conf, /var/log/apt-cacher-ng/apt-cacher.err, /var/log/apt-cacher-ng/apt-cacher.log and /var/cache/apt-cacher-ng (the last recursively) to apt-cacher-ng:apt-cacher-ng. You can debug this using strace, but the logging is nevertheless pointless.

Revision history for this message
Eduard Bloch (edi-gmx) wrote :

I cannot explain the root:root ownership yet. It's configured by this
part of postinst:

   if [ -z "$(dpkg-statoverride --list $CFG/security.conf)" ] ; then
      dpkg-statoverride --update --add apt-cacher-ng apt-cacher-ng 600 $CFG/security.conf
   fi

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Karl-Philipp, are you using etckeeper by chance?

I have to say I cannot completely rule out etckeeper messing with file ownership. I looked through the changes to the .etckeeper file to see what had been going on. Initially, the permissions were apparently set to apt-cacher-ng.apt-cacher-ng and later were changed to root.root in a completely unrelated commit. I guess it looks like apt-cacher-ng cannot be faulted for the change itself. But I think the program should give a more clear indication what went wrong. It would have tremendously helped for example if the problematic file leading to the aborted program had been spelt out explicitly.

Eduard, do you think you can make such a change?

Here is the information you requested:
$ dpkg-statoverride --list /etc/apt-cacher-ng/security.conf
apt-cacher-ng apt-cacher-ng 600 /etc/apt-cacher-ng/security.conf

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :

I'm not using etckeeper.
 The reason the issue occured on my system is due to changing of uid and gid of apt-cacher-ng (might have gone wrong). The issue I opened here simply requests proper logging of the file handling error. My comment on how I fixed the issue was only a tip for people dealing with the issue and stumbling over this.
Anyway, I appreciate the interest in changing the package.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

still a problem?

I stopped using etckeeper for this and a number of other issues. I cannot remember running into this problem for years. Time to close?

Changed in apt-cacher-ng (Ubuntu):
status: Triaged → Incomplete
Changed in apt-cacher-ng (Ubuntu):
status: Incomplete → Fix Released
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.