Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

apt-cacher internal error (died)

288 views
Skip to first unread message

Adam Weremczuk

unread,
Sep 7, 2022, 1:00:06 PM9/7/22
to
Hi all,

The server runs Debian 9.2 and the client Debian 9.1

My errors:

CLIENT

$ sudo apt update
Ign:1 http://192.168.1.100:3142/debian stretch InRelease
Hit:2 http://192.168.1.100:3142/debian stretch-updates InRelease
Hit:3 http://192.168.1.100:3142/debian stretch Release
Reading package lists... Done
Building dependency tree
Reading state information... Done
91 packages can be upgraded. Run 'apt list --upgradable' to see them.

$ sudo apt install memtest86+
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
hwtools memtester kernel-patch-badram memtest86 mtools
The following NEW packages will be installed:
memtest86+
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
Need to get 75.1 kB of archives.
After this operation, 2,448 kB of additional disk space will be used.
Err:1 http://192.168.1.100:3142/debian stretch/main amd64 memtest86+
amd64 5.01-3
502 apt-cacher internal error (died)
E: Failed to fetch
http://192.168.1.100:3142/debian/pool/main/m/memtest86+/memtest86+_5.01-3_amd64.deb
502 apt-cacher internal error (died)
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?

SERVER

Wed Sep 7 17:06:40 2022|error [10088]: Failed to open/create
/var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb for return:
Permission denied at /usr/sbin/apt-cacher line 735, <GEN13> line 4.
Wed Sep 7 17:07:58 2022|warn [20848]: Warning: unable to close
filehandle __ANONIO__ properly: Bad file descriptor at
/usr/sbin/apt-cacher line 1539.

Permissions seem fine:

ls -al /var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb
lrwxrwxrwx 1 proxy proxy 51 Aug 22 18:13
/var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb ->
/var/cache/apt/archives/memtest86+_5.01-3_amd64.deb

ls -al /var/cache/apt/archives/memtest86+_5.01-3_amd64.deb
-rw-r--r-- 1 myuser users 75142 Nov 18 2021
/var/cache/apt/archives/memtest86+_5.01-3_amd64.deb

All folders in both paths are 755.

Any ideas?

Regards,
Adam

Charles Curley

unread,
Sep 7, 2022, 11:50:05 PM9/7/22
to
On Wed, 7 Sep 2022 17:50:16 +0100
Adam Weremczuk <ad...@matrixscience.com> wrote:

> The server runs Debian 9.2 and the client Debian 9.1

I remember having problems with apt-cacher-ng on Debian 9 or
there-abouts. Maybe it's time to upgrade to Bullseye?

apt-cacher-ng has a web server, with which you can do some maintenance.
If I recall correctly, so does apt-cacher. Have you tried running that?
You may need to do it several times.


--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

David Wright

unread,
Sep 8, 2022, 11:30:06 AM9/8/22
to
Disclaimer: I run apt-cacher-ng, and have never looked at apt-cacher.

On Wed 07 Sep 2022 at 17:50:16 (+0100), Adam Weremczuk wrote:

> SERVER
>
> Wed Sep 7 17:06:40 2022|error [10088]: Failed to open/create
> /var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb for return:
> Permission denied at /usr/sbin/apt-cacher line 735, <GEN13> line 4.
> Wed Sep 7 17:07:58 2022|warn [20848]: Warning: unable to close
> filehandle __ANONIO__ properly: Bad file descriptor at
> /usr/sbin/apt-cacher line 1539.
>
> Permissions seem fine:
>
> ls -al /var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb
> lrwxrwxrwx 1 proxy proxy 51 Aug 22 18:13
> /var/cache/apt-cacher/packages/memtest86+_5.01-3_amd64.deb ->
> /var/cache/apt/archives/memtest86+_5.01-3_amd64.deb
>
> ls -al /var/cache/apt/archives/memtest86+_5.01-3_amd64.deb
> -rw-r--r-- 1 myuser users 75142 Nov 18 2021
> /var/cache/apt/archives/memtest86+_5.01-3_amd64.deb
>
> All folders in both paths are 755.

I don't understand the commingling of apt-cacher and apt; is this
how apt-cacher is designed to work? When I install a new package
on a client, the server does not use /var/cache/apt/archives/,
but only its /var/cache/apt-cacher/ directories, from which it
will serve clients.

If someone was logged in to a client and installing package foo,
and I happened to be logged in to the server and installing foo
directly (not via apt-cacher), it would appear from your logs
that we'd both be trying to use the same directory. How would
the permissions work then, and if I cleaned apt's cache, where
would apt-cacher serve the deleted foo file from?

BTW Who is myuser and who is apt-cacher running as?

Cheers,
David.

Adam Weremczuk

unread,
Sep 8, 2022, 2:20:05 PM9/8/22
to
Hi David,

From SERVER:/etc/apt-cacher/apt-cacher.conf

user = www-data
group = www-data

sudo chown -R www-data:www-data /var/cache/apt/archives/*

Same error on the CLIENT :(

I think I'll give apt-cacher-ng a shot instead although I wouldn't mind
knowing why apt-cacher keeps failing.

Regards,
Adam

Adam Weremczuk

unread,
Sep 12, 2022, 9:50:05 AM9/12/22
to
Switching to apt-cacher-ng brings no immediate joy :(

CLIENT (192.168.100.243)
sudo apt update
Err:5 http://192.168.100.1:3142/security stretch/updates Release
503 DNS error for hostname security: No address associated with
hostname. If security refers to a configured cache repository, please
check the corresponding configuration file.
E: The repository 'http://192.168.100.1:3142/security stretch/updates
Release' does not have a Release file.

SERVER (192.168.100.1)
1662988978|E|769|192.168.100.243|security/dists/stretch/updates/InRelease [HTTP
error, code: 503]
1662988978|M|Download of security/dists/stretch/updates/Release aborted

Why a DNS error if I use IPs internally for this exercise?

Is there something wrong with sources.list on the SERVER:

deb http://ftp.uk.debian.org/debian stretch main contrib non-free
deb-src http://ftp.uk.debian.org/debian stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free

sudo apt update
Ign:1 http://ftp.uk.debian.org/debian stretch InRelease
Ign:2 http://hwraid.le-vert.net/debian stretch InRelease
Hit:3 http://ftp.uk.debian.org/debian stretch Release
Get:4 http://security.debian.org stretch/updates InRelease [59.1 kB]
Fetched 59.1 kB in 0s (119 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
381 packages can be upgraded. Run 'apt list --upgradable' to see them.

?

Thanks,
Adam

David Wright

unread,
Sep 12, 2022, 11:50:05 AM9/12/22
to
On Mon 12 Sep 2022 at 14:33:59 (+0100), Adam Weremczuk wrote:
> Switching to apt-cacher-ng brings no immediate joy :(
>
> CLIENT (192.168.100.243)
> sudo apt update
> Err:5 http://192.168.100.1:3142/security stretch/updates Release
> 503 DNS error for hostname security: No address associated with
> hostname. If security refers to a configured cache repository, please
> check the corresponding configuration file.
> E: The repository 'http://192.168.100.1:3142/security stretch/updates
> Release' does not have a Release file.

I would expect to see lines like:

Get:2 http://security.debian.org/debian-security bullseye-security/main amd64 libgdk-pixbuf-2.0-0 amd64 2.42.2+dfsg-1+deb11u1 [147 kB]

but with stretch/updates rather than bullseye-security, of course,
as the syntax was regularised.

> SERVER (192.168.100.1)
> 1662988978|E|769|192.168.100.243|security/dists/stretch/updates/InRelease
> [HTTP error, code: 503]
> 1662988978|M|Download of security/dists/stretch/updates/Release aborted
>
> Why a DNS error if I use IPs internally for this exercise?

AFAIK apt-cacher-ng still needs to make contact with debian-security
as part of the process.

> Is there something wrong with sources.list on the SERVER:
>
> deb http://ftp.uk.debian.org/debian stretch main contrib non-free
> deb-src http://ftp.uk.debian.org/debian stretch main contrib non-free
> deb http://security.debian.org/ stretch/updates main contrib non-free
> deb-src http://security.debian.org/ stretch/updates main contrib non-free

Mine were as attached, with an extra part to security's address.

> sudo apt update
> Ign:1 http://ftp.uk.debian.org/debian stretch InRelease
> Ign:2 http://hwraid.le-vert.net/debian stretch InRelease
> Hit:3 http://ftp.uk.debian.org/debian stretch Release
> Get:4 http://security.debian.org stretch/updates InRelease [59.1 kB]
> Fetched 59.1 kB in 0s (119 kB/s)
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> 381 packages can be upgraded. Run 'apt list --upgradable' to see them.

Cheers,
David.
¬etc¬apt¬sources.list

Adam Weremczuk

unread,
Sep 12, 2022, 2:00:05 PM9/12/22
to
Hi David,

I've tried your list and the server updates fine.

On a client I see again:

sudo apt update
Ign:1 http://192.168.100.1:3142/debian stretch InRelease
Ign:2 http://192.168.100.1:3142/debian-security stretch/updates InRelease
Hit:3 http://192.168.100.1:3142/debian stretch-updates InRelease
Hit:4 http://192.168.100.1:3142/debian stretch-backports InRelease
Hit:5 http://192.168.100.1:3142/debian stretch Release
Err:6 http://192.168.100.1:3142/debian-security stretch/updates Release
503 DNS error for hostname debian-security: Name or service not
known. If debian-security refers to a configured cache repository,
please check the corresponding configuration file.
Reading package lists... Done
E: The repository 'http://192.168.100.1:3142/debian-security
stretch/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is
therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user
configuration details.

It looks like there is something wrong with debian-security repo
specifically.

Could the fact that the client has no internet connectivity play a role?
I would imagine this is a typical scenario where you want to use apt-cacher.

Regards,
Adam

David Wright

unread,
Sep 13, 2022, 1:00:05 AM9/13/22
to
> I've tried your list and the server updates fine.
>
> On a client I see again:
>
> sudo apt update
> Ign:1 http://192.168.100.1:3142/debian stretch InRelease
> Ign:2 http://192.168.100.1:3142/debian-security stretch/updates InRelease
> Hit:3 http://192.168.100.1:3142/debian stretch-updates InRelease
> Hit:4 http://192.168.100.1:3142/debian stretch-backports InRelease
> Hit:5 http://192.168.100.1:3142/debian stretch Release
> Err:6 http://192.168.100.1:3142/debian-security stretch/updates Release
> 503 DNS error for hostname debian-security: Name or service not
> known. If debian-security refers to a configured cache repository,
> please check the corresponding configuration file.
> Reading package lists... Done
> E: The repository 'http://192.168.100.1:3142/debian-security
> stretch/updates Release' does not have a Release file.
> N: Updating from such a repository can't be done securely, and is
> therefore disabled by default.
> N: See apt-secure(8) manpage for repository creation and user
> configuration details.
>
> It looks like there is something wrong with debian-security repo
> specifically.

Did you change your sources.list on the client to make it the same as
the server's?

In case it's not clear, sources.list is not changed for apt-cacher-ng.
You tell it to use the proxy either manually, eg:

# apt-get -o Acquire::http::Proxy="http://192.168.1.14:3142/" …

of through /etc/apt/apt.conf (or, better, a file in /etc/apt/apt.conf.d/):

Acquire::http::Proxy "http://192.168.1.14:3142/";

For a laptop, you can turn proxying on and off with the "tricks" shown in
§8.13 of the User Manual in the docs (if it's not the server, of course).

BTW, from what you have posted, it may have escaped you that the
server should also be a client, with its proxy address set to the same
address as all the other clients. That will halve your bandwidth.
Keep that in mind in the penultimate paragraph.

> Could the fact that the client has no internet connectivity play a role?
> I would imagine this is a typical scenario where you want to use apt-cacher.

That implies that neither client nor server have access to the
internet, doesn't it? It's not something I've tried to do as the
internet is effectively always on here, so I'm not certain.

Going right back to the days of dial-up, I played around with apt-move
for a while, but after I had access to Zip® drives and a Jaz® drive,
I just copied /var/cache/apt/archives at work (on Janet) and ran
dpkg -i at home to install them. (The apt install ./foo.deb
command wasn't available back then.)

My guess is that most people use apt-cacher-ng as I do, to serve a
number of clients (including itself) on a LAN, saving their own
bandwidth and that of the Debian servers/mirrors.

One word of advice: serving to clients running a more recent
distribution from a server running an older one can cause problems,
because of minor improvements that are sometimes made in the way
the archives and the cache are handled and stored.

Bear in mind that if you install a new distribution from scratch,
and then start running apt-cacher-ng on it, you can feed the contents
of its own /var/cache/apt/archives/ (from the installation) into its
new cache by copying the debs into /var/cache/apt-cacher-ng/_import/
(ibid §8.1). So run apt update on the new server (with proxying
set) and an old client.

You can also feed it all the previous distribution's packages if you
still them to copy in the same way. But in this case, an old client
will need to run apt update *before* apt-cacher-ng will be able
to move the debs from …/_import/ into their places in its cache.

Cheers,
David.

Adam Weremczuk

unread,
Sep 21, 2022, 9:10:05 AM9/21/22
to
Hi David,

There is still something wrong with my /etc/apt/sources.list

Perhaps caused by stretch reaching end of life on 30 June 2022.

Can somebody provide me with a tested list of mirrors for stretch
working in Sep 2022 for apt-cacher-ng server and clients?

I've tried several different sets getting no errors from "apt update" on
the server (which has internet connectivity).

Every time I repeat this list in /etc/apt/sources.list on a client
replacing FQDN (e.g. deb.debian.org or security.debian.org) with my
server's IP and port (192.168.100.1:3142) I get DNS errors for security
mirror as below:

Err:5 http://192.168.100.1:3142/debian-security stretch/updates Release
503 DNS error for hostname debian-security: Name or service not
known. If debian-security refers to a configured cache repository,
please check the corresponding configuration file.

or

503 DNS error for hostname security: No address associated with hostname.

Perhaps /etc/apt-cacher-ng/acng.conf on the server needs amending as well?

I've found a line there that reads:

Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian #
Debian Archives

Regards,
Adam



On 13/09/2022 05:54, David Wright wrote:
> Err:5http://192.168.100.1:3142/security stretch/updates Release

Darac Marjal

unread,
Sep 21, 2022, 10:40:06 AM9/21/22
to


On 21/09/2022 14:07, Adam Weremczuk wrote:
Hi David,

There is still something wrong with my /etc/apt/sources.list

Perhaps caused by stretch reaching end of life on 30 June 2022.

Can somebody provide me with a tested list of mirrors for stretch working in Sep 2022 for apt-cacher-ng server and clients?

I've tried several different sets getting no errors from "apt update" on the server (which has internet connectivity).

Every time I repeat this list in /etc/apt/sources.list on a client replacing FQDN (e.g. deb.debian.org or security.debian.org) with my server's IP and port (192.168.100.1:3142) I get DNS errors for security mirror as below:

Err:5 http://192.168.100.1:3142/debian-security stretch/updates Release
  503  DNS error for hostname debian-security: Name or service not known. If debian-security refers to a configured cache repository, please check the corresponding configuration file.

I'm no expert in apt-cacher-ng, but the error here says that's it's trying to look up "debian-security" as a hostname. If I'm reading this page correctly, you shouldn't be changing /etc/apt/sources.list to point to apt-cacher-ng, instead, you should continue to point it to deb.debian.org or snapshot.debian.org and, instead, tell apt to use apt-cacher-ng as an HTTP proxy.

The protocol that a HTTP server and a HTTP proxy use are _slightly_ different. Instead of a client asking a server "Give me /path/to/index.html", it needs to tell the proxy "Give me /path/to/index.html from example.com". I suspect you problem comes of trying to download packages from apt-cacher-ng, rather than proxying through apt-cacher-ng.

OpenPGP_signature

Adam Weremczuk

unread,
Sep 21, 2022, 11:30:06 AM9/21/22
to
Thank you Darac, that was my problem indeed!
What confused me was the fact that, despite being fundamentally
misconfigured, it appeared to be almost working. Just complaining about
one security mirror.

On 21/09/2022 15:36, Darac Marjal wrote:
> I'm no expert in apt-cacher-ng, but the error here says that's it's
> trying to look up "debian-security" as a hostname. If I'm reading this
> page <https://help.ubuntu.com/community/Apt-Cacher%20NG> correctly, you

Bob Weber

unread,
Sep 21, 2022, 11:40:05 AM9/21/22
to

I use apt-cacher-ng also.  The apt proxy is setup in each client with the following file:

------------------ /etc/apt/apt.conf.d/000apt-cacher-ng-proxy

# This configuration snipped is intended to be stored in /etc/apt/apt.conf.d/
# on the client system in order to change a regular setup to use apt-cacher-ng.
#
Acquire::http::Proxy "http://172.16.0.1:3142/";

# Little optimization. A value of 10 has been used in earlier version of
# apt-get but was disabled in the beginning of the second decade because of
# incompatibilities with certain HTTP proxies. However, it still beneficial
# with proxy servers that support it good enough (like apt-cacher-ng).
#
Acquire::http::Pipeline-Depth "23";

-----------------

That tells apt to use a proxy on the server 172.16.0.1 at port 3142.  The source list files remain the same. 

Like for testing:

deb http://deb.debian.org/debian/ testing main non-free contrib

apt-cacher-ng can even connect to an external proxy (In setup file) but if it is running on a machine that can get to the internet it will not need an additional proxy (why waist resources).

This makes apt-cacher-ng work just like the client was connected to the internet with the exception of adding the above 000apt-cacher-ng-proxy file being the only change needed.

...bob


David Wright

unread,
Sep 21, 2022, 12:50:04 PM9/21/22
to
On Wed 21 Sep 2022 at 16:26:25 (+0100), Adam Weremczuk wrote:
> On 21/09/2022 15:36, Darac Marjal wrote:
> > I'm no expert in apt-cacher-ng, but the error here says that's
> > it's trying to look up "debian-security" as a hostname. If I'm
> > reading this page
> > <https://help.ubuntu.com/community/Apt-Cacher%20NG> correctly, you
> > shouldn't be changing /etc/apt/sources.list to point to
> > apt-cacher-ng, instead, you should continue to point it to
> > deb.debian.org or snapshot.debian.org and, instead, tell apt to
> > use apt-cacher-ng as an HTTP proxy.
> >
> > The protocol that a HTTP server and a HTTP proxy use are
> > _slightly_ different. Instead of a client asking a server "Give me
> > /path/to/index.html", it needs to tell the proxy "Give me
> > /path/to/index.html from example.com". I suspect you problem comes
> > of trying to download packages from apt-cacher-ng, rather than
> > proxying through apt-cacher-ng.
> >
> Thank you Darac, that was my problem indeed!
> What confused me was the fact that, despite being fundamentally
> misconfigured, it appeared to be almost working. Just complaining
> about one security mirror.

It wasn't "fundamentally" misconfigured: you just kept changing
the sources.list in the client when asked not to. Anyway, glad
that it works now.

BTW, obviously we see that you're running at least one machine
on stretch. I couldn't help wondering whether my musings in
https://lists.debian.org/debian-user/2021/09/msg00305.html
https://lists.debian.org/debian-user/2021/08/msg00882.html
were related in any way. (I take it you run a mix of versions.)
That's one of the reasons I wrote this advice:

"One word of advice: serving to clients running a more recent
distribution from a server running an older one can cause problems,
because of minor improvements that are sometimes made in the way
the archives and the cache are handled and stored."

Cheers,
David.

Adam Weremczuk

unread,
Sep 21, 2022, 1:20:06 PM9/21/22
to
Thanks David, the server runs 9.2 and clients 9.1 so hopefully it will
work ok.

Another reason I kept changing sources.list in the client was in the
aftermath of my recent attempts against apt-cacher.

In apt-cacher you change every line to point to apt-cacher:3142.
At least that's what I have in the legacy config I've inherited.
I'm assuming it worked at some point in the past.
0 new messages