Closed FirelightFlagboy closed 1 year ago
Hi @FirelightFlagboy, sorry for your troubles. I had a look at your logs and did not find any obvious reason for the time out. The only thing I saw out of the ordinary is that AppArmor is disabled, but that shouldn't be a problem.
Both start & stopping the VM created by
snapcraft
timeout. But VMs created by multipass do not :thinking:
Is that something you observed just once or twice, or consistently? Even with different VMs created via snapcraft? I wonder if there is something specific to snapcraft that provokes this behavior or if it is just a coincidence.
Unfortunately we've been observing these timeouts from time to time. It can be caused by image corruption, often following a bad shutdown. In any case, VMs that time out once often keep timing out. Have you tried purging the VM and starting from scratch? I know that's not ideal, but it might unblock you. A snap restart multipass
may also help.
FWIW, we've recently added code (#3114) to improve this a little and give us a better view into the causes. If you're willing, you could snap refresh --edge multipass
and let us know how it goes for you.
Is that something you observed just once or twice, or consistently?
I've tried yesterday and today, after restart also on another project
snapcraft
vm timeout but vm created by multipass (via multipass launch
) do not
It can be caused by image corruption
Is it possible to verify them ? or the remove them to re-download them ?
Have you tried purging the VM and starting from scratch
Yes, I do multipass delete --all --purge
we've recently added code (https://github.com/canonical/multipass/pull/3114) to improve this a little and give us a better view into the causes
I will try that
A
snap restart multipass
I've tried that previously but is will hang-out because it is waiting for the VMs to shutdown (which timeout :sweat:)
OK, what you can do to get out fo that situation if to kill -SIGKILL
the qemu-system...
process(es) that multipass is waiting on, as well as the dnsmasq
process if it gets left behind.
Is it possible to verify them ? or the remove them to re-download them ?
The original downloaded image remains untouched by VMs, so it is very unlikely that one gets corrupted and you don't need to re-download that. The images that can get corrupted by VMs are particular to them. So you can just launch a new VM and it will have a fresh image.
If you really want to try a completely fresh setup (including fresh images) you can snap remove --purge multipass
and then install again.
I've install multipass
using the channel edge
using snap refresh --channel=edge multipass
I've also restart multipass using snap restart multipass
.
$ snapcraft build
Launching a VM.
Build environment is in unknown state, cleaning first.
info failed: The following errors occurred:
instance "snapcraft-[REDACTED]" does not exist
launch failed: The following errors occurred:
snapcraft-[REDACTED]: timed out waiting for response
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
I can do multipass list
$ multipass list
Name State IPv4 Image
snapcraft-[REDACTED] Delayed Shutdown N/A Ubuntu 20.04 LTS
multipass info --all
timeout after 2min:
$ multipass info --all
info failed: Could not determine IP address within 120000ms
Using htop
, I see 2 qemu-system
process using 100% cpu and not stopping until killed.
Hi @FirelightFlagboy, it looks like there is a problem with the latest Focal (20.04) image for snapcraft. There's already a bug report for that and hopefully there will be a fix before long.
In the meantime, if you can by any chance move to 22.04, there shouldn't be any problems with that. If you can't change the base
in the snapcraft.yaml, your only alternative would be to build with LXD.
@FirelightFlagboy, actually there is one other way you can work around this. After having encontered this problem, killed and deleted the VM, do:
snap disable multipass
sudo mv focal-server-cloudimg-amd64-disk1.img /var/snap/multipass/common/cache/multipassd/vault/images/focal-20230711
(the goal is to overwrite the faulty image, so that should be the existing directory for that image. You may need to replace the date in the directory name as appropriate)snap enable multipass
Thanks you for your precious help
Hi @FirelightFlagboy, that focal image should be fixed now and working again normally. I will close this now, but let us know how it goes for you and feel free to reopen.
Hello, im having this same issue:
snap info multipass
name: multipass
summary: Instant Ubuntu VMs
publisher: Canonical✓
store-url: https://snapcraft.io/multipass
contact: https://github.com/canonical/multipass/issues/new
license: GPL-3.0
description: |
Multipass is a tool to launch and manage VMs on Windows, Mac and Linux that simulates a cloud
environment with support for cloud-init. Get Ubuntu on-demand with clean integration to your IDE
and version control on your native platform.
................
commands:
- multipass.gui
- multipass
services:
multipass.multipassd: simple, enabled, active
snap-id: mA11087v6dR3IEcQLgICQVjuvhUUBUKM
tracking: latest/stable
refresh-date: 12 days ago, at 07:57 CST
channels:
latest/stable: 1.13.1 2024-06-28 (12829) 122MB -
latest/candidate: 1.13.1 2024-07-10 (12924) 122MB -
latest/beta: 1.14.0 2024-07-11 (12940) 64MB -
latest/edge: 1.15.0-dev.2328+g6ee0b4ed 2024-07-10 (12931) 64MB -
installed: 1.13.1 (12829) 122MB -
when running snapcraft
i get:
snapcraft
Launching a VM.
launch failed: failed to download from 'https://cloud-images.ubuntu.com/buildd/daily/focal/20240624/focal-server-cloudimg-amd64-disk1.img': Error opening https://cloud-images.ubuntu.com/buildd/daily/focal/20240624/focal-server-cloudimg-amd64-disk1.img
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
multipass is searching for the ubuntu image 2024/06/24 but it seems that in the mirror all images are from july.
the
@FirelightFlagboy, actually there is one other way you can work around this. After having encontered this problem, killed and deleted the VM, do:
snap disable multipass
- download an older image from https://cloud-images.ubuntu.com/buildd/daily/focal/20230706/focal-server-cloudimg-amd64-disk1.img (note that this won't be available for long and I believe the problem starts on the following day)
sudo mv focal-server-cloudimg-amd64-disk1.img /var/snap/multipass/common/cache/multipassd/vault/images/focal-20230711
(the goal is to overwrite the faulty image, so that should be the existing directory for that image. You may need to replace the date in the directory name as appropriate)snap enable multipass
- try snapcraft again.
this solution doesnt work for me, after I enable multipass it seems that it deletes the /var/snap/multipass/common/cache/multipassd/vault/images/focal-20240624
directory
multipass fails for every ubuntu image
multipass launch 20.04
launch failed: failed to download from 'https://cloud-images.ubuntu.com/releases/server/releases/focal/release-20240612/ubuntu-20.04-server-cloudimg-amd64.img': Error opening https://cloud-images.ubuntu.com/releases/server/releases/focal/release-20240612/ubuntu-20.04-server-cloudimg-amd64.img
multipass launch 22.04
launch failed: failed to download from 'https://cloud-images.ubuntu.com/releases/server/releases/jammy/release-20240614/ubuntu-22.04-server-cloudimg-amd64.img': Error opening https://cloud-images.ubuntu.com/releases/server/releases/jammy/release-20240614/ubuntu-22.04-server-cloudimg-amd64.img
multipass launch lts
launch failed: failed to download from 'https://cloud-images.ubuntu.com/releases/server/releases/noble/release-20240622/ubuntu-24.04-server-cloudimg-amd64.img': Error opening https://cloud-images.ubuntu.com/releases/server/releases/noble/release-20240622/ubuntu-24.04-server-cloudimg-amd64.img
multipass launch devel
launch failed: failed to download from 'https://cloud-images.ubuntu.com/daily/server/oracular/20240622/oracular-server-cloudimg-amd64.img': Error opening https://cloud-images.ubuntu.com/daily/server/oracular/20240622/oracular-server-cloudimg-amd64.img
Hi @ecruzolivera, let's follow up in #3577
Describe the bug
When I try to build a snap package using
snapcraft
that usemultipass
to start a VM.To Reproduce
snapcraft snap
Expected behavior
That
multipass
didn't timeout when start / stopping VM used forsnapcraft
.If that could help: I didn't have that issue on the date of
2023-06-05
Logs
Additional info
Archlinux 6.4.3-arch1-1
multipass version
:1.2.1
multipass info --all
multipass get local.driver
:qemu
sudo journalctl
Additional context
Both start & stopping the VM created by
snapcraft
timeout. But VMs created by multipass do not :thinking:After the timeout start,
qemu
is still running and use 100% of a CPU core ad vitam aeternam