cybozu-go / aptutil

Go utilities for Debian APT repositories
MIT License
124 stars 29 forks source link

error when synchronizing mirrors created by aptly #47

Open TheFlyingCorpse opened 4 years ago

TheFlyingCorpse commented 4 years ago

This tools is quite friendly when synchronizing mirrors, I've hit my head for a few days in regards to synchronizing mirrors, Icinga being amongst them. From the debugging I've done, the common denominator is how aptly does not provide an uncompressed Contents- file, such as Contents-amd64. You can download the file without the file extension as the Release says is available, the Header "Content-Location" is returned with the filename you are really getting (filename.gz), which the net/http library might not handle that well.

Example: As a consequence when trying to get https://packages.icinga.com/debian/dists/icinga-buster/main/Contents-amd64, you get served https://packages.icinga.com/debian/dists/icinga-buster/main/Contents-amd64.gz while the function checks against the file without compression. If the function checks in case it fails against a .gz entry for the same filename, it would work.

Toml to replicate the error:

dir = "/var/spool/go-apt-mirror"
max_conns = 10

[log]
level = "debug"
format = "plain"

[mirror.icinga]
url = "https://packages.icinga.com/debian"
suites = ["icinga-buster"]
sections = ["main"]
mirror_source = false
architectures = ["amd64"]
ymmt2005 commented 4 years ago

Thanks. Maybe dup of #27 ?

TheFlyingCorpse commented 4 years ago

Oh, it might be that, yes.