0

I try to set up apt-cacher-ng to cache all apt packages for the local network. But with the graylog repository I have some trouble.

System: Debian 9 with apt 1.4.0 and apt-cacher-ng 2-2

On a server I just configured apt to use the apt-cacher server as a proxy (this is the only server with internet connection) with a line in /etc/apt/apt.conf.d/01proxy:

Acquire::http { Proxy "10.10.10.10:3142"; };

Now all apt-get updates and upgrades are getting their packages from the apt-cacher server. This works fine. Also I can just use a https repository using HTTPS/// in the URL like described in the manual.

The source.list looks like this:

deb http://HTTPS///artifacts.elastic.co/packages/5.x/apt stable main
deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main
deb http://HTTPS///packages.graylog2.org/repo/debian/ stable 2.5

The output of "apt-get update" on the server ends with:

Err:13 http://HTTPS///packages.graylog2.org/repo/debian stable/2.5 amd64 Packages 406 Not Acceptable
Ign:14 http://HTTPS///packages.graylog2.org/repo/debian stable/2.5 all Packages Reading package lists...
W: The repository 'http://HTTPS///packages.graylog2.org/repo/debian stable Release' does not have a Release file.
E: Failed to fetch http://HTTPS///packages.graylog2.org/repo/debian/dists/stable/2.5/binary-amd64/Packages 406 Not Acceptable
E: Some index files failed to download. They have been ignored, or old ones used instead.

In the apt-cacher-ng log the error is:

1548752476|I|224|10.10.10.10|packages.graylog2.org/repo/debian/dists/stable/2.5/binary-all/Packages [HTTP error, code: 406]
1548752476|E|237|10.10.10.10|packages.graylog2.org/repo/debian/dists/stable/2.5/binary-all/Packages [HTTP error, code: 406]

When I enable tunneling with PassThroughPattern in the /etc/apt-cacher-ng/acng.conf, the traffic is not cached but updates will work. Which isn’t the goal here, but shows that the network traffic should be working on my site. This can be used if caching is not needed or optional:

PassThroughPattern: (packages\.graylog2\.org|graylog2-package-repository\.s3\.amazonaws\.com):443$

Any help is highly appreciated.

soeren
  • 1
  • 2
  • 1
    Its working like this with the artifacts.elastic.co repository and its recomended in the manuel: https://www.unix-ag.uni-kl.de/~bloch/acng/html/howtos.html#ssluse – soeren Feb 06 '19 at 08:59

1 Answers1

0

The repo you are trying to use with apt-cacher-ng is https://packages.graylog2.org/repo/debian/, so you have created your sources.list like:

deb http://HTTPS///packages.graylog2.org/repo/debian/ stable 2.5

The problem is that https://packages.graylog2.org/repo/debian/ is the wrong URL. The correct URL is https://packages.graylog2.org/debian.

So your sources line should appear like:

deb http://HTTPS///packages.graylog2.org/debian stable 2.5
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thanks Michael for your help! Unforunatly the URL is right (see Documentation: http://docs.graylog.org/en/2.5/pages/installation/operating_system_packages.html#manual-repository-installation). Also if I don't use the cacher and a direct SSL-tunnel is build the repo is working. Maybe this is related, but the firewall is not a problem for me: https://community.graylog.org/t/repository-giving-a-404-when-behind-apt-cacher/1009 – soeren Feb 06 '19 at 15:04
  • @soeren The URL is wrong in the documentation. The URL they gave is a 404. Change it exactly as I have shown above and try again. – Michael Hampton Feb 06 '19 at 15:12
  • I did test your recommendation first (thought didn't have to mention it): Err:13 http://HTTPS///packages.graylog2.org/debian stable/2.5 amd64 Packages 406 Not Acceptable .. Reading package lists... W: The repository 'http://HTTPS///packages.graylog2.org/debian stable Release' does not have a Release file. E: Failed to fetch http://HTTPS///packages.graylog2.org/debian/dists/stable/2.5/binary-amd64/Packages 406 Not Acceptable – soeren Feb 06 '19 at 15:18
  • Hm, something is wrong then. I've poked around that site some more, and it looks like a lot more files are missing. It might be a problem with that site. – Michael Hampton Feb 06 '19 at 15:20
  • For now I just can pass the traffic through the proxy and have no cache. Adding a line to /etc/apt-cacher-ng/acng.conf: PassThroughPattern: (packages\.graylog2\.org|graylog2-package-repository\.s3\.amazonaws\.com):443$ – soeren Feb 07 '19 at 14:13