Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

FS#69531 - Improve reporting of 404s and other errors in Pacman 6 parallel downloading

Attached to Project: Pacman
Opened by Jade (lf) - Thursday, 04 February 2021, 09:29 GMT
Task Type General Gripe
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version git
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Summary and Info:
When downloading things with Pacman 6, it's sometimes the case that it appears to get stuck. I ended up downgrading to stable, only to observe the reason it was probably failing was that I hadn't run pacman -Syu recently and so the package download was hitting a 404.

This is a suboptimal user experience. I'd like it to give an indication of why it is appearing to be stuck (not necessarily which mirrors are 404'ing, just that it is happening).

Steps to Reproduce:
Forget to upgrade your computer for a while
Pacman gets some 404s it doesn't report and appears stuck while downloading a package.
This task depends upon

Comment by Jade (lf) - Thursday, 04 February 2021, 09:31 GMT
Forgot to mention- observed in pacman-git-6.0.0alpha1.r64.gab549c84, in case it's been fixed since.
Comment by Allan McRae (Allan) - Thursday, 04 February 2021, 09:52 GMT
Whet do you mean that the download gets stuck? With a 404, I get something like this immediately:

bash-5.1.004-1-x86_64.pkg.tar.zst failed to download

The reason for the failed downloads are currently given at the end of all downloads.

Comment by Jade (lf) - Thursday, 04 February 2021, 10:45 GMT
I have a long mirrorlist as tends to be installed by default. What generally happens when I have an outdated ~~package list~~sync database is it tries about 50 mirrors sequentially for the package file, gets 404s for most of them, then eventually finds one with the package.

I caused this on purpose for testing by putting:


into my pacman mirrorlist, commenting out all the other entries, `pacman -Syy`, removing the archive line and restoring my normal mirrors, then `pacman -S vim` (or another package that's been updated recently).

The `pacman -S vim` command will sit at:

vim-8.2.1704-1-x86_64.pkg.tar.zst downloading...

for a couple of minutes. Eventually it might find a mirror that has the old package and download it.

However, this is more frustrating on Pacman 6 since it will defer printing the dozens of errors such as:

error: failed retrieving file 'vim-8.2.1704-1-x86_64.pkg.tar.zst' from : The requested URL returned error: 404
error: failed retrieving file 'vim-runtime-8.2.1704-1-x86_64.pkg.tar.zst' from : The requested URL returned err
or: 404

until after it finishes the download of the package from the one mirror that has it, but without these errors, it is unclear why it is sitting there, whether it is a network issue/the mirror is down, or that `pacman -Syu` needs to be run to update sync databases. In previous versions, Pacman would print the errors as it gets them, so it would be possible to know after the first failure (taking about 5s) that the particular issue is stale sync databases.