Snapcraft failing

hey guys, I was building a snap on a new machine . I got the following error when running snapcraft:

bash: line 0: cd: /root/project/: Permission denied
An error occurred when trying to execute ‘sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True snap set system experimental.snapd-snap=true’ with ‘multipass’: returned exit code 1.

I think the snapcraft.yaml is working completely fine.

snap version:

snap 2.56.2 snapd 2.56.2 series 16 pop 22.04 kernel 5.17.15-76051715-generic

multipass version:

multipass 1.10.0 multipassd 1.10.0

multipass launch also works .

1 Like

it seems that my apt-update was broken. fixing it fixed the problem :wink:

1 Like

I’m seeing the same issue as you. (with the exact same versions of snap and multipass)

Launching a VM.
bash: line 0: cd: /root/project/: Permission denied                             
An error occurred when trying to execute 'sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True snap set system experimental.snapd-snap=true' with 'multipass': returned exit code 1.

‘apt update’ runs without issues for me.

This is a strange problem and I can reproduce it. We’ll investigate the issue, but In the meantime you can use snapcraft --use-lxd to use LXD instead of multipass to create the build environments.

@townsend has something changed in the latest stable multipass update that could cause this kind of behavior?

1 Like

Oh, hmm, I might know what’s going in Multipass, but I’ll need to investigate a bit more to understand how to fix it.

For anyone coming across this, we’re tracking this in Multipass at https://github.com/canonical/multipass/issues/2663. We’ll work on a fix ASAP and get out a bug fix release. Sorry for the headaches!

3 Likes

fwiw - I was able to build by installing the multipass from candidate

snap refresh multipass --candidate

(so using multipass 1.9.2 instead of 1.10.0 - which I guess is older :))

Can confirm that this gets it past the error.

Just to let everyone know here, we’ve released Multipass 1.10.1 in the --stable channel that fixes this issue. Thanks!

6 Likes