Subject: bug#74556: 30.0.92; Package upgrade can fail and results in deleted package

From: Daniel Mendler <[email-masked]>
Date: Wed, 27 Nov 2024 12:37:17 +0100

Package upgrade can fail when the package metadata is out of sync. The
upgrade process first deletes the package, tries to download the new
version. If the download fails for some reason (metadata out of sync or
the file not available), the upgrade aborts but the earlier package
deletion is not rolled back as one would expect for an upgrade
transaction. Ideally the download would be performed first such that the
upgrade process wouldn't lead to a missing package.

I just executed M-x package-upgrade-all. The following messages appeared
in the log:

Package ‘<package>-<old-version>’ deleted.
Contacting host: elpa.gnu.org:443
package--with-response-buffer-1:
https://elpa.gnu.org/devel/<pkgname>-<new-version>.tar: No Data