aptly icon indicating copy to clipboard operation
aptly copied to clipboard

mirror update: unexpected EOF

Open pvdsar opened this issue 5 months ago • 8 comments

A mirror update after the mirror creation fails on downloading some packages with "unexpected EOF" 99% or so of the packages download with no issues. Subsequent mirror updates fail on those same packages. A wget of those packages proves that the packages are downloadable.

Seen this behaviour with aptly 1.5.0, 1.6.0 and 1.6.2 Strange thing is that packages are downloaded from another aptly instance of ours, so thát aptly was able to download those packages. Very strange..

pvdsar avatar Jul 15 '25 11:07 pvdsar

Our setup consists of 4 aptly repositories that mirror their precursor (don't ask why ;-): Eg: internet_repo <- repo1 <- repo2 <- repo3 <- repo4 Only repo4 runs into trouble. It occurred to me that repo1 and repo2 use apache2 as webserver , but repo3 runs nginx. I fired up apache2 on repo3 and now aptly is able to download the few remaining packages.

Since we'd like to use nginx, the issue remains. What causes this behaviour?

pvdsar avatar Jul 16 '25 09:07 pvdsar

try searching nginx error log on repo3, it might need some settings:

  • proxy_read_timeout 360s;
  • client_max_body_size 4G;

also the number of threads/processes of nginx might matter on repo3.

hope this helps ! let us know...

neolynx avatar Aug 15 '25 18:08 neolynx

Thanks for your response. Testing this requires deletion of my precious repo's :-| Will test this at a convenient moment.

pvdsar avatar Sep 30 '25 13:09 pvdsar

The nginx error log contained no relevant issues. The nginx normal logs however showed that as far as nginx is concerned, the files were succesfully transmitted (HTTP 200)

Nevertheless I reconfigured nginx as suggested (proxy_read_timeout 360s; client_max_body_size 4G;), but that did not result in succesful downloads.

pvdsar avatar Oct 03 '25 11:10 pvdsar

I remember there is also a number of processes you can specify in nginx (worker_processes ?), maybe you run into too many downloads at the same time...

A error message from the client of a failed download might help.

neolynx avatar Oct 04 '25 10:10 neolynx

No, there cannot be too many dowloads. The downloads consistently fail on specific packages. Wgets of such packages are always succesful. Besides: nginx itself reports succesful transfers of those packages.

An example of a client error:

Download Error: https://repo3.example.com/ubuntu/daily/pool/main/p/python-heatclient/python3-heatclient_3.5.0-0ubuntu1_all.deb
ERROR: unable to update: download errors:
  https://repo3.example.com/ubuntu/daily/pool/main/p/python-heatclient/python3-heatclient_3.5.0-0ubuntu1_all.deb: unexpected EOF

I would love it when aptly would simply use wget for downloading packages. I do not trust the built-in download code anymore.

pvdsar avatar Oct 15 '25 09:10 pvdsar

Maybe it is a client problem. there are actually 2 internal downloaders, the second one created to solve such kind of problems. However, the legacy downloader is still the default.

Could you try changing the downloader on this client to use grab ?

  // Downloader
  // * "default"
  // * "grab"      (more robust)
  "downloader": "grab"

neolynx avatar Oct 19 '25 18:10 neolynx

Tried grab downloader, but the unexpected EOF's are still reported

pvdsar avatar Oct 21 '25 08:10 pvdsar