Snapcraft is stuck on "launching instance..." indefinitely

Bug #1999321 reported by Matthew Jakeman
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Unassigned

Bug Description

When I run the "snapcraft" command, it gets stuck on "Launching instance..." indefinitely. I waited upwards of an hour before terminating the command.

If relevant (possibly due to the hardware I'm using - M1 Macbook), I am running this on the arm64 architecture. I can reproduce this on:
 - Fedora Workstation 37 (arm64)
 - Asahi Linux (arm64)

This means I am unable to build or test any snap file.

description: updated
Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Interesting. We have some outstanding work to time out early and provide logs when snapcraft gets stuck launching an instance (https://github.com/canonical/craft-providers/issues/146).

The hardware part is interesting. This could be a LXD or Multipass issue on this hardware. If you're building a core22 snap, I'd like to see the output of `snapcraft --verbosity=trace`.

I also wonder if you have the same behavior with Multipass and LXD. You can change between the two with `snap set snapcraft provider=lxd` (or multipass).

Revision history for this message
Matthew Jakeman (mjakeman) wrote :

When running with Multipass, I get an error that an image matching "22.04" cannot be found. LXD seems seems to loop on "[...] getent hosts snapcraft.io" endlessly. I'll attach logs for both attempts.

For reference, the snap I am trying to build is: `https://github.com/mjakeman/extension-manager/pull/314/files` with arm64 added as an additional supported architecture.

Revision history for this message
Matthew Jakeman (mjakeman) wrote :
Revision history for this message
Matthew Jakeman (mjakeman) wrote :
Revision history for this message
Farshid Tavakolizadeh (farshidtz) wrote :

I often face this issue on a Raspberry Pi 4 (Ubuntu Server 22.04):

2023-02-27 14:55:41.908 Executing in container: lxc --project snapcraft exec local:snapcraft-matter-pi-gpio-commander-on-arm64-for-arm64-151427 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin SNAPCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io
2023-02-27 14:55:42.593 Executing in container: lxc --project snapcraft exec local:snapcraft-matter-pi-gpio-commander-on-arm64-for-arm64-151427 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin SNAPCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io

It appears to be a re-occurring domain resolution issue, unrelated to snapcraft.

$ host snapcraft.io
Host snapcraft.io not found: 2(SERVFAIL)
$ host google.com
Host google.com not found: 2(SERVFAIL)

Changing the DNS addresses or rebooting the device solves it.

Revision history for this message
Claudio André (claudioandre.br) wrote :

The tip that the problem is related to network access saved my day. In my case, the firewall was preventing LXD from working properly. Disabling the firewall (or fixing the rules) does the trick.

Yesterday:
`
[UFW BLOCK] IN=lxdbr0 OUT= PHYSIN=vethd728cd65 MAC=00:16:3e:83:1c:fd:00:16:3e:b4:de:c7:86:dd SRC=fe80:0000:0000:0000:0216:3eff:feb4:dec7 DST=fe80:0000:0000:0000:0216:3eff:fe83:1cfd LEN=78 TC=0 HOPLIMIT=64 FLOWLBL=1016275 PROTO=UDP SPT=42222 DPT=53 LEN=38
`
Now:
`
UFW BLOCK] IN=lxdbr0 OUT= PHYSIN=vethe4c2b3ac MAC=00:16:3e:83:1c:fd:00:16:3e:b4:de:c7:86:dd SRC=fe80:0000:0000:0000:0216:3eff:feb4:dec7 DST=fe80:0000:0000:0000:0216:3eff:fe83:1cfd LEN=78 TC=0 HOPLIMIT=64 FLOWLBL=759663 PROTO=UDP SPT=59514 DPT=53 LEN=38
`

Could you guys add an alert the end user to make our life easier?

- I am on Ubuntu 22, snapping for core22, snapcraft via snap.

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Yeah, thanks for the feedback!

We now have two improvements to add:
1. Add timeouts to network calls (https://github.com/canonical/craft-providers/issues/146)
2. Check for the presence of Docker modifying iptables on the host (https://github.com/canonical/craft-providers/issues/172)

Both of these will include better logging and/or documentation to make your life easier.

Changed in snapcraft:
status: New → Confirmed
Revision history for this message
Callahan Kovacs (mr-cal) wrote :

@mjakeman, your issue with Snapcraft+Multipass not working on arm64 hardware sounds like this bug (https://bugs.launchpad.net/snapcraft/+bug/2012074). Sorry for suggesting you try something that doesn't work!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.