FS#71464 - pacman -U multiple downloads fail with ParallelDownloads enabled

Attached to Project: Pacman
Opened by Geert Hendrickx (ghen) - Wednesday, 07 July 2021, 18:57 GMT
Last edited by Allan McRae (Allan) - Saturday, 04 September 2021, 02:24 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 6.0.0
Due in Version 6.0.1
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

The following used to work without parallel downloads, but fails with ParallelDownloads enabled:

$ sudo pacman -U https://archlinux.org/packages/testing/x86_64/systemd/download https://archlinux.org/packages/testing/x86_64/systemd-libs/download https://archlinux.org/packages/testing/x86_64/systemd-sysvcompat/download
:: Retrieving packages...
download
download failed to download
download failed to download
error: could not rename /var/cache/pacman/pkg/download.part to /var/cache/pacman/pkg/systemd-libs-249-1-x86_64.pkg.tar.zst (No such file or directory)
error: could not rename /var/cache/pacman/pkg/download.part to /var/cache/pacman/pkg/systemd-249-1-x86_64.pkg.tar.zst (No such file or directory)
warning: failed to retrieve some files

It fails because all three files are retrieved as "download" at the same time (the filename part of all three URL's).

A workaround is to trick pacman into saving them under different names, like:

$ sudo pacman -U https://archlinux.org/packages/testing/x86_64/systemd/download?1 https://archlinux.org/packages/testing/x86_64/systemd-libs/download?2 https://archlinux.org/packages/testing/x86_64/systemd-sysvcompat/download?3
:: Retrieving packages...
download?1
download?2
download?3

Or to disable ParallelDownloads.

This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 04 September 2021, 02:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit c0026caab03d62fdb1774fa66d12e1258a84bf6f
Comment by morganamilo (morganamilo) - Wednesday, 07 July 2021, 19:05 GMT
The real issue is pacman gives both the same filename.
Comment by Geert Hendrickx (ghen) - Wednesday, 07 July 2021, 19:09 GMT
Yes, as mentioned. Pacman could use unique/random local filenames for download, instead of the remote (non unique) name?
Comment by morganamilo (morganamilo) - Wednesday, 07 July 2021, 20:06 GMT
The download used to be https://archlinux.org/packages/testing/x86_64/systemd/download/
(note the trailing slash) which would cause pacman to treat the url as having no file
name and it would pick a random one. Recently though this changed.
Comment by Geert Hendrickx (ghen) - Wednesday, 07 July 2021, 20:55 GMT

Loading...