I am trying to build my snapcraft app and it no longer works. This snap is already in the snap store, and I’m just trying to edit it. But it seems like the snap build process itself has changed somehow and I can no longer build the snap on my machine.
So, to make sure it is the build process and not my snap itself, I tried snapping the basic hello-world snapcraft app and, sure enough, I cannot make it happen.
Mac
(1) On my Mac with both snapcraft and multipass installed, I get some errors. This did work fine a few months ago, but it stopped working and I switched to using my Ubuntu VM. But since that too has now stopped working, I figured I would give the Mac another try. I’ve unintalled and reinstalled both snapcraft and multipass to no avail.
hello$ snapcraft clean
Failed to get information for snap 'core18': could not connect to 'http+unix://%2Frun%2Fsnapd.socket/v2/snaps/core18'
And then…
hello$ sudo snapcraft
Password:
Launching a VM.
error: no changes of type "auto-refresh" found
snap "snapd" has no updates available
snap "core18" has no updates available
snap "snapcraft" has no updates available
mount failed: source "/Users/myuser/Documents/snappath/hello" is not readable
An error occurred with the instance when trying to mount with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
(2) On my Mac I tried building remotely, which I have never done before. Got errors.
hello$ snapcraft remote-build
All data sent to remote builders will be publicly available. Are you sure you want to continue? [y/N]: y
snapcraft remote-build is experimental and is subject to change - use with caution.
Sorry, an error occurred in Snapcraft:
name '_source_handler' is not defined
Traceback (most recent call last):
File "/usr/local/bin/snapcraft", line 8, in <module>
sys.exit(run())
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/cli/remote.py", line 157, in remote_build
_start_build(
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/cli/remote.py", line 188, in _start_build
repo_dir = wt.prepare_repository()
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/internal/remote_build/_worktree.py", line 322, in prepare_repository
part_config = self._process_part_sources(part_name, part_config)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/internal/remote_build/_worktree.py", line 241, in _process_part_sources
part_config["source"] = self._pull_source(part_name, source)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/internal/remote_build/_worktree.py", line 163, in _pull_source
source_handler = self._get_part_source_handler(part_name, source, download_dir)
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/internal/remote_build/_worktree.py", line 92, in _get_part_source_handler
handler_class = snapcraft.internal.sources.get_source_handler(
File "/usr/local/Cellar/snapcraft/3.11_1/libexec/lib/python3.8/site-packages/snapcraft/internal/sources/__init__.py", line 170, in get_source_handler
return _source_handler[source_type]
NameError: name '_source_handler' is not defined
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
You can find the traceback in file '/var/folders/4v/y1kp9phs1sq2x2t302t_33s00000gn/T/tmp2_ay4fac/trace.txt'.
Ubuntu
(3) On an Ubuntu VM running on my Mac in Parallels, trying to use multipass, I get some errors. This has never worked. I assume a Parallels VM cannot launch another VM? Dunno if that can be changed on my VM somehow? Any suggestions?
hello$ snapcraft
Launching a VM.
launch failed: CPU does not support KVM extensions.
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.
(4) On my Ubuntu VM running on my Mac in Parallels, trying to use LXD, I get some errors. Now this used to work – in fact, today is the first time I can’t make it work.
Initializing LXD, I used the defaults except for the size of the new loop device. I noticed the default size (12GB) is different than it used to be (wasn’t it 15GB before?), so perhaps something here has changed and is now causing it to fail for me? Should I configure something differently when initializing this? I really don’t know what any of these settings mean.
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, zfs, ceph, btrfs) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty disk or partition? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=12GB]: 30GB
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
Here are the errors I am now getting.
hello$ snapcraft clean --use-lxd
An error occurred when trying to communicate with the 'LXD' provider: cannot connect to the LXD socket ('/var/snap/lxd/common/lxd/unix.socket')..
And…
snapcraft --use-lxd
An error occurred when trying to communicate with the 'LXD' provider: cannot connect to the LXD socket ('/var/snap/lxd/common/lxd/unix.socket')..
I wonder if this is related to this question?
(5) On my Ubuntu VM running on my Mac in Parallels, I also tried destructive-mode and got errors.
hello$ snapcraft --destructive-mode
Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [306 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [279 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7,972 B]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [43.7 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [49.2 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Fetched 942 kB in 1s (831 kB/s)
Reading package lists... Done
Installing build dependencies: autoconf automake autopoint autotools-dev libltdl-dev libsigsegv2 libtool m4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-99 linux-headers-4.15.0-99-generic linux-image-4.15.0-99-generic linux-modules-4.15.0-99-generic linux-modules-extra-4.15.0-99-generic
Use 'sudo apt autoremove' to remove them.
Suggested packages:
autoconf-archive gnu-standards autoconf-doc libtool-doc gfortran | fortran95-compiler gcj-jdk m4-doc
The following NEW packages will be installed:
autoconf automake autopoint autotools-dev libltdl-dev libsigsegv2 libtool m4
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,864 kB of archives.
After this operation, 6,650 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libsigsegv2 amd64 2.12-1 [14.7 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 m4 amd64 1.4.18-1 [197 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 autoconf all 2.69-11 [322 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 autotools-dev all 20180224.1 [39.6 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 automake all 1:1.15.1-3ubuntu2 [509 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 autopoint all 0.19.8.1-6ubuntu0.3 [426 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libltdl-dev amd64 2.4.6-2 [162 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libtool all 2.4.6-2 [194 kB]
Fetched 1,864 kB in 1s (2,610 kB/s)
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 203155 files and directories currently installed.)
Preparing to unpack .../0-libsigsegv2_2.12-1_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.12-1) ...
Selecting previously unselected package m4.
Preparing to unpack .../1-m4_1.4.18-1_amd64.deb ...
Unpacking m4 (1.4.18-1) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../2-autoconf_2.69-11_all.deb ...
Unpacking autoconf (2.69-11) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../3-autotools-dev_20180224.1_all.deb ...
Unpacking autotools-dev (20180224.1) ...
Selecting previously unselected package automake.
Preparing to unpack .../4-automake_1%3a1.15.1-3ubuntu2_all.deb ...
Unpacking automake (1:1.15.1-3ubuntu2) ...
Selecting previously unselected package autopoint.
Preparing to unpack .../5-autopoint_0.19.8.1-6ubuntu0.3_all.deb ...
Unpacking autopoint (0.19.8.1-6ubuntu0.3) ...
Selecting previously unselected package libltdl-dev:amd64.
Preparing to unpack .../6-libltdl-dev_2.4.6-2_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.6-2) ...
Selecting previously unselected package libtool.
Preparing to unpack .../7-libtool_2.4.6-2_all.deb ...
Unpacking libtool (2.4.6-2) ...
Setting up libltdl-dev:amd64 (2.4.6-2) ...
Setting up libsigsegv2:amd64 (2.12-1) ...
Setting up m4 (1.4.18-1) ...
Setting up autotools-dev (20180224.1) ...
Setting up autopoint (0.19.8.1-6ubuntu0.3) ...
Setting up libtool (2.4.6-2) ...
Setting up autoconf (2.69-11) ...
Setting up automake (1:1.15.1-3ubuntu2) ...
update-alternatives: using /usr/bin/automake-1.15 to provide /usr/bin/automake (automake) in auto mode
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
autoconf set to automatically installed.
automake set to automatically installed.
autopoint set to automatically installed.
autotools-dev set to automatically installed.
libltdl-dev set to automatically installed.
libsigsegv2 set to automatically installed.
libtool set to automatically installed.
m4 set to automatically installed.
Pulling gnu-hello
Sorry, an error occurred in Snapcraft:
[Errno 1] Operation not permitted
I tried sudo, but that didn’t help.
hello$ sudo snapcraft --destructive-mode
Running with 'sudo' may cause permission errors and is discouraged. Use 'sudo' when cleaning.
Pulling gnu-hello
Sorry, an error occurred in Snapcraft:
[Errno 1] Operation not permitted
The long and the short of it is, I cannot build snaps! I used to be able to, but now I can’t! Can someone please help!?!
Thank you!!!