anatol / pacoloco

Caching proxy server for Arch Linux pacman
MIT License
199 stars 30 forks source link

Docker does not download from Archlinux servers #75

Closed lquidfire closed 1 year ago

lquidfire commented 1 year ago

Situation: The LAN server here actually runs Debian 10, but many workstations run Archlinux. Hence the desire to set up a proxy cache for pacman that also purges its storage. I am trying out Pacoloco.

Problem: I pulled the official docker image; I modified the pacoloco.yaml file, and created a directory for the cache. I then run the docker container, which starts up with no errors.

Herewith the local-mirrorlist on the Archlinux client; and the pacoloco.yaml file on the server.

local-mirrorlist.txt pacoloco.yaml.txt

The container is run with the following command: $ docker run -p 9129:9129 -v /home/[redacted]/docker/pacoloco/files/pacoloco.yaml:/etc/pacoloco.yaml -v /srv/pacoloco/:/var/cache/pacoloco ghcr.io/anatol/pacoloco

However, the docker container does not seem to pull files (databases, packages, signature files) from upstream servers.

When I manually place a .zst file in the correct directory, my Archlinux client downloads it (and then stumbles over the fact that there isn't a .sig file, but that is not important now). I conclude that the server can distribute within the LAN.

I did create a second container, based on the official Archlinux image; I installed the package pacoloco in it from the official mirror; and realise that that container can talk to the Internet in any event, since it can download and install software. The same issue of not pulling updates from official servers exists in that container, though.

I reckon that I am missing a simple configuration step. Since I did not find a GitHub Discussions page, I am posting this Issue.

Thank you for your assistance.

Edit: Correction in line 1.

lquidfire commented 1 year ago

This is from the docker log, while first running a pacman -Syu, and then a pacman -S emacs.

Please note: The .db files had been manually downloaded and placed in the correct directory already.

$ docker run -p 9129:9129 -v /home/[redacted]/docker/pacoloco/files/pacoloco.yaml:/etc/pacoloco.yaml -v /srv/pacoloco/:/var/cache/pacoloco ghcr.io/anatol/pacoloco pacoloco.go:101: Reading config file from /etc/pacoloco.yaml pacoloco.go:135: Starting server at port 9129 pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/multilib.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/core.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/community.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/extra.db pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/core.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/community.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/multilib.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/extra.db.sig: no such file or directory pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/multilib.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/extra.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/core.db pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/community.db pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/multilib.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/extra.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/core.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/community.db.sig: no such file or directory pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/emacs-28.2-2-x86_64.pkg.tar.zst: no such file or directory pacoloco.go:476: serving cached file /var/cache/pacoloco/pkgs/archlinux/emacs-28.2-2-x86_64.pkg.tar.zst pacoloco.go:144: open /var/cache/pacoloco/pkgs/archlinux/emacs-28.2-2-x86_64.pkg.tar.zst.sig: no such file or directory

At the first attempt, no emacs file is present in the cache directory. No attempt is made (that I can tell form the logs) to download it from the upstream servers.

At the second attempt to install emacs, I had manually downloaded the emacs .zst file (via curl). pacoloco then sent that to my Archlinux client, but the sig file was missing still.

Focshole commented 1 year ago

Are you sure you need to specify the http proxy? Are you under proxy?

http_proxy: [..local-domain..]:9129

lquidfire commented 1 year ago

Thank you, @Focshole ! That was it. I do not have a proxy on the network to reach the internet, and simply disabling that line in the config did the trick.

My mistake was that I understood that line to be the pacoloco's server config that clients on the net need to reach, which then proxies any requests to upstream servers if necessary.

Focshole commented 1 year ago

I'd reopen it, and add a comment on the default file configuration, such as "enable if you have pacoloco running behind a proxy", so that this should not happen again

lquidfire commented 1 year ago

I opened a PR for this and another change (I hope these are both correct and won't cause more work for the maintainers!).