My last successful build was 20 mins ago and now I suddenly get:
Launching a container.
An error occurred with the instance when trying to launch with 'LXD': Create instance: Create instance: Invalid devices: Failed detecting root disk device: No root device could be found.
Ensure that 'LXD' is setup correctly and try again.
What does this possibly mean because I haven’t changed anything between now and my last successful build?
How do I “ensure that ‘LXD’ is setup correctly and try again.” because it has already been set up and working…?
and then restart your build. Note that this will delete the container and recreate it, so any customisations you may have made inside the container will be gone.
$ snapcraft --use-lxd
Launching a container.
Build environment is in unknown state, cleaning first.
An error occurred with the instance when trying to launch with 'LXD': Create instance: Create instance: Invalid devices: Failed detecting root disk device: No root device could be found.
Ensure that 'LXD' is setup correctly and try again.
As it repeatedly say that my build environment is in “unknown state, cleaning first” I suspect it doesn’t really clean anything. Where does snapcraft store information about builds?
I am having a somewhat related issue as well. It seems to be trying to download an image that clearly does not exist.
(venv) om26er@X1C6:~/scm/crossbario/crossbarfx$ snapcraft clean --use-lxd; snapcraft --use-lxd
Launching a container.
An error occurred with the instance when trying to launch with 'LXD': Unable to fetch https://cloud-images.ubuntu.com/buildd/daily/focal/20200728/focal-server-cloudimg-amd64-lxd_combined.tar.gz: 404 Not Found.
Ensure that 'LXD' is setup correctly and try again.
I had that issue, needed to refresh to LXD stable and reboot. There was a bug fixed by @stgraber on Friday, so maybe edge is fine now. But the reboot was required for me anyhow.
Launching a container.
An error occurred with the instance when trying to launch with 'LXD': Create instance: Create instance: Invalid devices: Failed detecting root disk device: No root device could be found.
Ensure that 'LXD' is setup correctly and try again.
Here are the outputs you requested:
$ lxc version
Client version: 4.4
Server version: 4.4
$ lxc profile show default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by: []
$ lxc storage show default
config:
size: 30GB
source: /var/snap/lxd/common/lxd/disks/default.img
description: ""
name: default
driver: btrfs
used_by:
- /1.0/images/84b6630213cde4243dd2553bfc1235dba7112dd767e9fb8da33050e0f20b6e37
- /1.0/profiles/default
status: Created
locations:
- none
I’m having the same issue – just started spontaneously happening now. Details on my side:
$ lxc profile show default
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by: []
$ lxc storage show default
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.
config:
size: 93GB
source: /var/snap/lxd/common/lxd/disks/default.img
zfs.pool_name: default
description: ""
name: default
driver: zfs
used_by:
- /1.0/images/8932633f436c73463da92237cc60466a2638d4e8515ccf44036ebded90ab892c
- /1.0/profiles/default
status: Created
locations:
- none
Context in which it showed up: I had a snapcraft build fail. Re-running it restarted from where it had left off, so I decided to clean and re-run it from scratch.
I mistakenly first typed snapcraft --use-lxd clean (which errored out) before the correct snapcraft clean --use-lxd. Then when I tried snapcraft --use-lxd again I got the error:
Launching a container.
Build environment is in unknown state, cleaning first.
An error occurred with the instance when trying to launch with 'LXD': Create instance: Create instance: Invalid devices: Failed detecting root disk device: No root device could be found.
Ensure that 'LXD' is setup correctly and try again.
It seems to have now resolved itself as spontaneously as it started appearing, as a few attempts later things are running again … :-\
Yeah, I got this working (without even rebooting my system) just by removing snapcraft snap with --purge and installing again. As I didn’t actually try to build before reinstalling snapcraft today it’s possible that it just tried to download something that was not available and showed this confusing and incorrect error and eventually got fixed (again) by itself when Canonical fixed their resources.