Building for core18: multipass issue

Refer:

2 Likes

Thank you very much, this will work for now. You just saved my evening :wink:

Hi @TimSueberkrueb, this suggests something went wrong with the image snapcraft's using to build. Can you please try and multipass launch snapcraft:core16 (or core18 if that’s your base: in snapcraft.yaml)? The hash error is definitely coming from Multipass itself.

I don’t know why, but it works now, after having run multipass launch snapcraft:core18 manually. Thanks @Saviq!

FWIW I think you may have hit our bug #569. It probably resolved itself over time, after our HTTP cache expired.

1 Like

I’m experiencing the same thing now

$ multipass launch
launch failed: The following errors occurred:                                   
venerated-snapper: shutdown called while starting

$ multipass launch snapcraft:core18
launch failed: The following errors occurred:                                   
simple-garfish: shutdown called while starting

Hi @YamiYukiSenpai, could you please file this as an issue on our GitHub?

In the mean time, could you please also run:

$ multipass launch snapcraft:core18 -vvv

This will print more verbose logging to the console.

Thanks!

This happens to me a lot. I need to reboot and then ‘snapcraft’ command does not fail with the multipass error. Xenial.

I had similar error:

user@user# sudo snapcraft
Support for 'multipass' needs to be set up. Would you like to do that it now? [y/N]: y                                                                                                                    
snapd is not logged in, snap install commands will use sudo                                                                                                                                               
multipass (latest/beta) 0.8.0 from Canonical✓ installed
Waiting for multipass...                                                                                                                                                                                  
Launching a VM.                                                                                                                                                                                           
launch failed: failed to start qemu instance                                                                                                                                                              
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.  

Solved it by installing snapcraft from apt instead of snap

sudo snap remove snapcraft

sudo apt install snapcraft

1 Like

That is not a solution. You’re papering over the problem by installing an old version of snapcraft. You are missing a lot of new functionality by doing this, of which only one part is the multipass integration.

1 Like

Thanks @lucyllewy, good to know.

Running multipass launch snapcraft:core18 -vvv and getting the error launch failed: failed to start qemu instance , reboot or sudo does not help and same error on core16.
Running it on nanopi Duo2 (armv7l processor architecture).

Where is your kernel from? If you are using a Ubuntu derivative, the kernel does not have KVM enabled and thus multipass does not work (see LP bug https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1783961, the bug is for ARM64, but AFAIK the same problem exists for armhf).

However, multipass should be outputting more helpful debug information, but perhaps the fix (see https://github.com/CanonicalLtd/multipass/pull/948) has not landed in the beta channel yet, can you try snap refresh multipass --edge and run multipass launch snapcraft:core18 -vvv again to see what it outputs?

After installing snap edge sudo snap install snapcraft --edge --classic and executing sudo snap refresh multipass --edge I run the command and got an error:

user@user$ multipass launch snapcraft:core18 -vvv
[2019-09-02T17:36:01.106] [debug] [daemon] Loading AppArmor policy: 

#include <tunables/global>
profile multipass.dnsmasq flags=(attach_disconnected) {
  #include <abstractions/base>
  #include <abstractions/nameservice>

  capability chown,
  capability net_bind_service,
  capability setgid,
  capability setuid,
  capability dac_override,
  capability dac_read_search,
  capability net_admin,         # for DHCP server
  capability net_raw,           # for DHCP server ping checks
  network inet raw,
  network inet6 raw,

  # Allow multipassd send dnsmasq signals
  signal (receive) peer=snap.multipass.multipassd,

  # access to iface mtu needed for Router Advertisement messages in IPv6
  # Neighbor Discovery protocol (RFC 2461)
  @{PROC}/sys/net/ipv6/conf/*/mtu r,

  # binary and its libs
  /snap/multipass/1102/usr/sbin/dnsmasq ixr,
  /snap/multipass/1102/{usr/,}lib/@{multiarch}/{,**/}*.so* rm,

  # CLASSIC ONLY: need to specify required libs from core snap
  /snap/core18/*/{,usr/}lib/@{multiarch}/{,**/}*.so* rm,

  /var/snap/multipass/common/data/multipassd/network/dnsmasq.leases rw,           # Leases file
  /var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts r,             # Hosts file

  /var/snap/multipass/common/data/multipassd/network/dnsmasq.pid w,     # pid file
}
    

launch failed: Failed to load AppArmor policy                                   
#include <tunables/global>
profile multipass.dnsmasq flags=(attach_disconnected) {
  #include <abstractions/base>
  #include <abstractions/nameservice>

  capability chown,
  capability net_bind_service,
  capability setgid,
  capability setuid,
  capability dac_override,
  capability dac_read_search,
  capability net_admin,         # for DHCP server
  capability net_raw,           # for DHCP server ping checks
  network inet raw,
  network inet6 raw,

  # Allow multipassd send dnsmasq signals
  signal (receive) peer=snap.multipass.multipassd,

  # access to iface mtu needed for Router Advertisement messages in IPv6
  # Neighbor Discovery protocol (RFC 2461)
  @{PROC}/sys/net/ipv6/conf/*/mtu r,

  # binary and its libs
  /snap/multipass/1102/usr/sbin/dnsmasq ixr,
  /snap/multipass/1102/{usr/,}lib/@{multiarch}/{,**/}*.so* rm,

  # CLASSIC ONLY: need to specify required libs from core snap
  /snap/core18/*/{,usr/}lib/@{multiarch}/{,**/}*.so* rm,

  /var/snap/multipass/common/data/multipassd/network/dnsmasq.leases rw,           # Leases file
  /var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts r,             # Hosts file

  /var/snap/multipass/common/data/multipassd/network/dnsmasq.pid w,     # pid file
}
    : errno=1 ()

If snap edge isn’t good tell me and I will post another comment without the edge channel.

I am running

FriendlyCore (base on UbuntuCore), Kernel: Linux-4.14

One developer told me

You can build FriendlyElec’s Linux-4.14 by yourself according this wiki

If its help you better understand what kernel I am using.

Hi @guyluz11, it seems like your kernel does not have AppArmor support and we just enabled that on Multipass edge… This being a low-spec device, did you consider snapcraft --use-lxd to avoid the VM overhead?

@Saviq snapcraft --use-lxd return the error:
The LXD provider is offered as a technology preview for early adopters. The command line interface, container names or lifecycle handling may change in upcoming releases. Launching a container. An error occurred with the instance when trying to launch with 'LXD': The requested image couldn't be found. Ensure that 'LXD' is setup correctly and try again.

lxc list return empty table and sudo lxd init return The requested storage pool "default" already exists. Please choose another name.

Yes that is expected unfortunately, the cloud images that snapcraft pulls for lxd are not available on non-amd64 architectures, however you can still launch a container with lxd with the ubuntu:18.04 image and then run snapcraft --destructive-mode inside that container. Like this:

$ lxc launch ubuntu:18.04
Creating the container
Container name is: poetic-turkey
Starting poetic-turkey
$ lxc shell poetic-turkey
mesg: ttyname failed: No such device
root@poetic-turkey:~/my-snap# sudo snap install snapcraft --classic
2019-09-04T18:11:19Z INFO Waiting for restart...
snapcraft 3.7.2 from Canonical✓ installed
root@poetic-turkey:~# mkdir my-snap && cd my-snap
root@poetic-turkey:~/my-snap# snapcraft init
Created snap/snapcraft.yaml.
Go to https://docs.snapcraft.io/the-snapcraft-format/8337 for more information about the snapcraft.yaml format.
root@poetic-turkey:~/my-snap# snapcraft --destructive-mode
snapd is not logged in, snap install commands will use sudo
core18 20190827 from Canonical✓ installed
Pulling my-part 
Building my-part 
Staging my-part 
Priming my-part 
Snapping 'my-snap-name' |                                                                                                                                                                                                                                                  
Snapped my-snap-name_0.1_armhf.snap
root@poetic-turkey:~/my-snap# 

This isn’t ideal, but as per Call for testing: snapcraft 3.4 we will have to wait until snapcraft switches what lxd images it uses in order for non-amd64 architectures to be supported with snapcraft managed lxd directly.

1 Like

@ijohnson Thanks for the detailed answer.
I get this error on sudo lxc launch ubuntu:18.04

Creating the container
Error: Failed container creation: Get https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.json: Unable to connect to: cloud-images.ubuntu.com:443

Could it be because I use WiFi?

You shouldn’t see that issue just because you are using WiFi, but just to be clear is your device connected to the internet?

Restarted my internet router and now it works.

Now executing sudo lxc shell poetic-turkey return Error: not found

My device have 500Mb ram, will this be enough to run ubuntu:18.04 image in container?

poetic-turkey just happened to be the name of my lxc instance, yours will almost certainly be different. You can see the name of the instance that was launched with lxc list. The name in the first column is what you should use instead of poetic-turkey.