wrong file permissions on /var/log/apt-cacher-ng abort package installation

Bug #1512780 reported by Barry Warsaw
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Up-to-date xenial, `apt-get install apt-cacher-ng` produces:

Preparing to unpack .../apt-cacher-ng_0.8.6-1_amd64.deb ...
Unpacking apt-cacher-ng (0.8.6-1) ...
Processing triggers for doc-base (0.10.6) ...
Processing 1 added doc-base file...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for systemd (227-2ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up apt-cacher-ng (0.8.6-1) ...
Job for apt-cacher-ng.service failed because the control process exited with error code. See "systemctl status apt-cacher-ng.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apt-cacher-ng, action "start" failed.
dpkg: error processing package apt-cacher-ng (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 apt-cacher-ng

Output of `systemctl status apt-cacher-ng.service`:

● apt-cacher-ng.service
   Loaded: masked (/dev/null)
   Active: failed (Result: start-limit) since Tue 2015-11-03 10:17:36 CST; 6min ago
 Main PID: 4356 (code=exited, status=1/FAILURE)

Nov 03 10:17:36 anarchist systemd[1]: Failed to start Apt-Cacher NG software download proxy.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Unit entered failed state.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Failed with result 'exit-code'.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Service hold-off time over, scheduling restart.
Nov 03 10:17:36 anarchist systemd[1]: Stopped Apt-Cacher NG software download proxy.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Start request repeated too quickly.
Nov 03 10:17:36 anarchist systemd[1]: Failed to start Apt-Cacher NG software download proxy.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Unit entered failed state.
Nov 03 10:17:36 anarchist systemd[1]: apt-cacher-ng.service: Failed with result 'start-limit'.
Nov 03 10:17:47 anarchist systemd[1]: Stopped Apt-Cacher NG software download proxy.

Excerpt from `journalctl -xe`:

Nov 03 10:25:26 anarchist systemd[1]: Starting Apt-Cacher NG software download proxy...
-- Subject: Unit apt-cacher-ng.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apt-cacher-ng.service has begun starting up.
Nov 03 10:25:26 anarchist apt-cacher-ng[6889]: WARNING: No configuration was read from file:backends_debvol
Nov 03 10:25:26 anarchist apt-cacher-ng[6889]: WARNING: No configuration was read from file:sfnet_mirrors
Nov 03 10:25:26 anarchist apt-cacher-ng[6889]: Problem creating log files. Check permissions of the log directory, /var/log/apt-cacher-ng
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Main process exited, code=exited, status=1/FAILURE
Nov 03 10:25:26 anarchist systemd[1]: Failed to start Apt-Cacher NG software download proxy.
-- Subject: Unit apt-cacher-ng.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apt-cacher-ng.service has failed.
--
-- The result is failed.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Unit entered failed state.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Failed with result 'exit-code'.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Service hold-off time over, scheduling restart.
Nov 03 10:25:26 anarchist systemd[1]: Stopped Apt-Cacher NG software download proxy.
-- Subject: Unit apt-cacher-ng.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apt-cacher-ng.service has finished shutting down.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Start request repeated too quickly.
Nov 03 10:25:26 anarchist systemd[1]: Failed to start Apt-Cacher NG software download proxy.
-- Subject: Unit apt-cacher-ng.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apt-cacher-ng.service has failed.
--
-- The result is failed.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Unit entered failed state.
Nov 03 10:25:26 anarchist systemd[1]: apt-cacher-ng.service: Failed with result 'start-limit'.

And finally:

% ls -ld /var/log/apt-cacher-ng/
drwxr-sr-x 2 usermetrics systemd-journal 4096 Aug 29 2014 /var/log/apt-cacher-ng//

Seems like g+w'ing that directory doesn't help.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt-cacher-ng (not installed)
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
ApportVersion: 2.19.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Nov 3 10:20:49 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-12-06 (696 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: apt-cacher-ng
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.apt.cacher.ng.acng.conf: [modified]
modified.conffile..etc.apt.cacher.ng.security.conf: [inaccessible: [Errno 13] Permission denied: '/etc/apt-cacher-ng/security.conf']
mtime.conffile..etc.apt.cacher.ng.acng.conf: 2015-11-03T10:11:20.553179

Revision history for this message
Barry Warsaw (barry) wrote :
Revision history for this message
Barry Warsaw (barry) wrote :

Fixing the user and group ownership fixes the problem:

% ls -ld /var/log/apt-cacher-ng/
drwxr-sr-x 2 apt-cacher-ng apt-cacher-ng 4096 Nov 3 10:40 /var/log/apt-cacher-ng//

So why did it use usermetrics:systemd-journal ??

apt-cacher-ng has never been installed on this box before.

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

I have no idea.

What's the UID of that user? Maybe something messed up with your passwd file?
The permission change is forcibly applied, I don't see why it could break, and even if, that would be root:root, not some weirduser:weirdgroup.

  # be sure about that even if the user messed it up
   for x in "$CDIR" $LDIR ; do
      if [ ! -d "$x" ]; then
         install -d -g $NAME -o $NAME -m2755 "$x"
      fi
   done

Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1512780] Re: apt-cacher-ng can't be installed on xenial

On Nov 03, 2015, at 05:41 PM, Eduard Bloch wrote:

>I have no idea.

Yeah, I was sitting next to pitti and he was also perplexed! (He also wasn't
able to reproduce it.)

>What's the UID of that user? Maybe something messed up with your passwd file?

Nope, passwd looks okay. I can't see anything weird about that user. Very
strange, but I guess if nobody else reports it, it's just gremlins doing their
dirty work on my machine.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: apt-cacher-ng can't be installed on xenial

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt-cacher-ng (Ubuntu):
status: New → Confirmed
Changed in apt-cacher-ng (Ubuntu):
importance: Undecided → Medium
Revision history for this message
d9ping (d9ping) wrote :

I had this issue too upon installing, starting and restarting apt-cacher-ng.
I found that i had a apparmor profile for apt-cacher-ng that was in enforce mode this was causing the installing, starting and restarting issues of apt-cacher-ng.
(I'm not sure if the apparmor profile is provided by apt-cacher-ng. )
But is resolved the issues of apt-cacher-ng by running:
sudo aa-complain usr.sbin.apt-cacher-ng

Revision history for this message
Ken Sharp (kennybobs) wrote :

Unbelievably this is still an issue over two years later.

Works find in Bionic and Cosmic.

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

There's reports of this in focal, too, now. See dupes of this ticket. It's still not clear how this comes about.

summary: - apt-cacher-ng can't be installed on xenial
+ wrong file permissions on /var/log/apt-cacher-ng abort package
+ installation
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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