How can I fix snapcraft build failing at "snap unset system proxy.http"?

When trying to build a trivial snap I get the following error:

$ snapcraft --debug
Launching a VM.
bash: line 0: cd: /root/project/: Permission denied                             
An error occurred when trying to execute 'sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True snap unset system proxy.http' with 'multipass': returned exit code 1.

If I multipass shell into the virtual machine, I can run the command without error:

sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True snap unset system proxy.http

The exact error has changed as I’ve tried deleting the virtual machine and starting from scratch. Previous incarnations included:

An error occurred when trying to execute 'sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True snapcraft snap' with 'multipass': returned exit code 1.
An error occurred when trying to execute 'sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True apt-get dist-upgrade --yes' with 'multipass': returned exit code 255.

This snap was previously building. How can I get snapcraft/multipass into a functional state again?

System details:
snapcraft 7.0.11
multipass 1.10.0
multipassd 1.10.0
snap 2.56.2
snapd 2.56.2
series 16
ubuntu 20.04
kernel 5.13.0-52-generic

What path are you using for your project folder? i.e. where on your host’s filesystem are you when you execute snapcraft?

What happens if you snap revert multipass?

+1 for this issue

However, it seems there is a issue with “multipass” released in stable channel . I have tried multipass from “candidate” channel using “snap refresh multipass --channel=latest/candidate” and it works OK . However, i am getting error using version 1.10.0.

Thank you

+1 for this issue Yesterday I have updated multipass to a latest version

Hey all,

We’re aware of the issue in Multipass and are tracking it at https://github.com/canonical/multipass/issues/2663. We’ll get a fix in ASAP and get out a bug fix release. Sorry for the problems!

1 Like

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

2 Likes