Skip to content

Cache path doubles for some files

I've been running apt-cacher-ng for almost 23 hours now (started on a clean cache directory), and I've found /var/cache/apt-cacher-ng inside /var/cache/apt-cacher-ng:

# find /var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ -type f | sort
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/bionic-updates/InRelease.1677135796.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/bionic/InRelease.1677135796.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-backports/InRelease.1677085995.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-backports/InRelease.1677086004.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-security/InRelease.1677085995.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-security/InRelease.1677086004.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-updates/InRelease.1677085995.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-updates/InRelease.1677086004.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal-updates/InRelease.1677119857.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/focal/InRelease.1677086004.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/xenial-backports/InRelease.1677081200.head
/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/xenial-security/InRelease.1677081200.head

Most files seem to be in the correct location, but as seen above, some are in a dubious place:

# du -sh /var/cache/apt-cacher-ng/ubuntu/
1.4G	/var/cache/apt-cacher-ng/ubuntu/
# du -sh /var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/
67K	/var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/
# ls /var/cache/apt-cacher-ng/ -1
_exfail_cnt
_expending_damaged
_expending_dat
_xstore
debian
debian-security
ubuntu
ubuntu-security
var
zabbix-6-2-ubuntu

Example file:

# stat /var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/bionic/InRelease.1677135796.head
  File: /var/cache/apt-cacher-ng/var/cache/apt-cacher-ng/ubuntu/dists/bionic/InRelease.1677135796.head
  Size: 168       	Blocks: 9          IO Block: 512    regular file
Device: 2000c8h/2097352d	Inode: 12935       Links: 1
Access: (0644/-rw-r--r--)  Uid: (  101/apt-cacher-ng)   Gid: (  101/apt-cacher-ng)
Access: 2023-02-23 07:03:16.057760475 +0000
Modify: 2023-02-23 07:03:16.057760475 +0000
Change: 2023-02-23 07:03:16.057760475 +0000
 Birth: 2023-02-23 07:03:16.057760475 +0000

Logs around this time:

...
1677135764|I|275|10.244.176.156|ubuntu/dists/trusty/Release
1677135764|O|58778|10.244.176.156|ubuntu/dists/trusty/Release
1677135786|I|264|10.55.50.109|ubuntu/dists/jammy/main/binary-amd64/Release
1677135786|O|394|10.55.50.109|ubuntu/dists/jammy/main/binary-amd64/Release
1677135796|I|279|10.244.241.134|ubuntu/dists/bionic/InRelease
1677135796|O|269|10.244.241.134|ubuntu/dists/bionic/InRelease
1677135796|I|279|10.244.176.156|ubuntu/dists/focal/InRelease
1677135796|O|265160|10.244.176.156|ubuntu/dists/focal/InRelease
1677135796|I|276|10.244.176.156|ubuntu/dists/bionic-updates/InRelease
1677135796|O|276|10.244.176.156|ubuntu/dists/bionic-updates/InRelease
1677135796|I|279|10.244.241.134|ubuntu/dists/focal-backports/InRelease
1677135796|O|108678|10.244.241.134|ubuntu/dists/focal-backports/InRelease
1677135796|I|89176|10.244.241.134|ubuntu/dists/bionic-updates/InRelease
1677135796|O|88998|10.244.241.134|ubuntu/dists/bionic-updates/InRelease
1677135796|I|242504|10.244.176.156|ubuntu/dists/bionic/InRelease
1677135796|O|242317|10.244.176.156|ubuntu/dists/bionic/InRelease
1677135796|I|276|10.244.241.134|ubuntu/dists/bionic-security/InRelease
1677135796|O|89001|10.244.241.134|ubuntu/dists/bionic-security/InRelease
1677135796|O|11521853|10.244.241.134|ubuntu/dists/bionic/universe/source/by-hash/SHA256/f05cceba96616bd3089a32361c0114bc0ebfd2908f759d5a6e97d8a458e2dc28
1677135796|I|276|10.244.176.156|ubuntu/dists/bionic-security/InRelease
1677135796|O|89001|10.244.176.156|ubuntu/dists/bionic-security/InRelease
1677135796|I|279|10.244.176.156|ubuntu/dists/focal-updates/InRelease
1677135796|O|114061|10.244.176.156|ubuntu/dists/focal-updates/InRelease
1677135796|I|276|10.244.241.134|ubuntu/dists/bionic-backports/InRelease
1677135796|O|83561|10.244.241.134|ubuntu/dists/bionic-backports/InRelease
1677135796|O|11340805|10.244.176.156|ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/ca221e8754c933c636b6c0a344617e3444a7c8cb0982ca97725cda9b7bfe1e6a
1677135796|I|276|10.244.241.134|ubuntu/dists/bionic-backports/InRelease
1677135796|O|83561|10.244.241.134|ubuntu/dists/bionic-backports/InRelease
1677135796|I|279|10.244.241.134|ubuntu/dists/focal-security/InRelease
1677135796|O|114064|10.244.241.134|ubuntu/dists/focal-security/InRelease
1677135796|O|13897|10.244.176.156|ubuntu/dists/bionic/restricted/binary-amd64/by-hash/SHA256/81b9542ff39f796dd83159d5ef02161232ae0b766538d8fc02a299fc1ced1f4d
1677135796|O|11344867|10.244.176.156|ubuntu/dists/focal/universe/binary-amd64/by-hash/SHA256/200acdc3421757fa8f8759c1cedacae2cf8f5821d7810ca59d8a313c5b3ae71e
1677135796|O|12293777|10.244.176.156|ubuntu/dists/focal/universe/source/by-hash/SHA256/863e9c12398d0a850b45cb18e8d3b0e5c53b42e229f2fc18688ae03958537f3f
...

I browsed the source, but:

  • I did not find filename.<TIME>.head code,
  • I did not quickly notice any concatenations that shouldn't be there.

Do you have any idea what's going on?

Version is 3.7.4-1build1 (Ubuntu/Jammy).

apt-cacher-ng (3.7.4-1build1) jammy; urgency=medium

  * No-change rebuild to update maintainer scripts, see LP: 1959054

 -- Dave Jones <dave.jones@canonical.com>  Wed, 16 Feb 2022 16:45:54 +0000

apt-cacher-ng (3.7.4-1) unstable; urgency=medium

  * New upstream version
    + avoids reporting garbled Last-Modified date where the information was not
      available (closes: #998329)

 -- Eduard Bloch <blade@debian.org>  Tue, 07 Dec 2021 14:50:20 +0100