multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Downloaded image hash does not match (stale network cache)

Open oSoMoN opened this issue 4 years ago • 11 comments

I can reliably observe this:

$ multipass launch snapcraft:core18
launch failed: Downloaded image hash does not match

The only logs (from journalctl) are this:

sept. 01 15:18:03 bribon multipassd[7063]: Read pid "7189" from file "/var/snap/multipass/common/data/multipassd/network/dnsmasq.pid"
sept. 01 15:18:03 bribon multipassd[7063]: existing dnsmasq found with pid 7189

Additional info

  • OS: Ubuntu 20.04.1
  • multipass version: 1.4.0 (revision 2445)

oSoMoN avatar Sep 01 '20 13:09 oSoMoN

Hey @oSoMoN, does snap restart multipass, or rebooting, help? Do you have a proxy set up?

Saviq avatar Sep 01 '20 13:09 Saviq

This should get you going, btw:

snap stop multipass
sudo rm -rf /var/snap/multipass/common/cache/multipassd/network-cache/
snap start multipass

Saviq avatar Sep 01 '20 13:09 Saviq

Hey @oSoMoN, does snap restart multipass, or rebooting, help? Do you have a proxy set up?

snap restart multipass didn't help. I couldn't test rebooting as I have long-running local processes that I'd rather not interrupt. No proxy.

Deleting the network-cache folder and restarting multipass did the trick, though. Thanks!

How could it possibly get in such a state?

oSoMoN avatar Sep 01 '20 13:09 oSoMoN

How could it possibly get in such a state?

Looks like QNetworkDiskCache, that we have in front of our HTTP requests, decided it won't grab the new SHA256SUMS file. We'll need to dig if we can ask it to check if the file got updated, first.

Saviq avatar Sep 01 '20 14:09 Saviq

Upon some debugging and digging, I've found that this is caused by a Qt bug: https://bugreports.qt.io/browse/QTBUG-81318

There is a proposed fix since August 2020, but it remains unmerged: https://codereview.qt-project.org/c/qt/qtbase/+/296092

Seeing as this goes against the default and described behavior, this is pretty bad on Qt's part. See the QNetworkRequest::PreferNetwork part in https://doc.qt.io/qt-5/qnetworkrequest.html#CacheLoadControl-enum

townsend2010 avatar Oct 07 '21 16:10 townsend2010

I got the same issue on windows 10 pro.

C:\Data\projects\makabaka>multipass version
multipass   1.9.1+win
multipassd  1.9.1+win

C:\Data\projects\makabaka>multipass.exe launch -c=4 -m=8G -d=20G -n=makabaka-1-1 20.04
launch failed: Downloaded image hash does not match

I just uninstalled version 1.8 and installed version 1.9 and restarted my PC, and still got this error. Is there a way to get around it?

I download ubuntu-20.04-server-cloudimg-amd64.img manually and the md5sum is corrected. Is there a way to tell multipass to use the manually downloaded file?

I moved my manually downloaded file to C:\ProgramData\Multipass\cache\vault\images\focal-20220706, but it get removed, and downloaded again when I run multipass launch.

UchihaYuki avatar Jul 12 '22 06:07 UchihaYuki

Hi @UchihaYuki,

Yeah, it's a Qt bug. You need to remove, C:\ProgramData\Multipass\cache\network-cache and restart the Multipass service and that should clear it up.

townsend2010 avatar Jul 12 '22 12:07 townsend2010

I able to solve it by reinstall multipass on my mac

ahdeanlau avatar Aug 14 '23 10:08 ahdeanlau

this still happened until now '__') but that workaround above seems to work

sudo snap stop multipass
sudo rm -rf /var/snap/multipass/common/cache/multipassd/network-cache/
sudo snap start multipass
sleep 1m; multipass launch jammy --cpus 2 --disk 20G --memory 8G --name ubu22

but after a while it's error again

Apr 13 13:34:20 pop2204 multipassd[25405]: Error getting https://cloud-images.ubuntu.com/releases/server/releases/jammy/release-20240319/ubuntu-22.04-server-cloudimg-amd64.img: Network timeout - trying cache.
Apr 13 13:34:20 pop2204 multipassd[25405]: Verifying hash "304983616fcba6ee1452e9f38993d7d3b8a90e1eb65fb0054d672ce23294d812"

or is there any way to download the image manually with more reliable software like aria2c?

or add an auto-retry for people that live in country with slow and unreliable internet?

kokizzu avatar Apr 13 '24 06:04 kokizzu