I wanted to update an old application of mine that was using an outdated core. The last time I worked with snapcraft I was on Ubuntu. Currently I am using Fedora. I’ve installed snapd and can use snaps just fine.
However, I wanted to update my application to use core22 so I’ve changed my snacraft.yml accordingly and tried to build a snap. LXD gets installed on the first run, fails because my user is not yet a part of the lxd group so I add my used to the lxd group and try to run snapcraft again but I am now getting stuck in the launching instance ... part. I’ve tried running the same with SELinux disabled but nothing changed.
I’ve checked the execution log but have no idea what to do. I’ve tried multiple times and waited more than 5 minutes but nothing happened so I cancelled via ctrl + c.
I had trouble formatting the output properly so I’ve put it up on pastebin:
Link
It looks like it’s getting stuck on the call lxc --project snapcraft launch craft-com.ubuntu.cloud-buildd:core22 local:snapcraft-fbrary-on-amd64-for-amd64-140034 --config security.syscalls.intercept.mknod=true
What happens if you run that on the command line? Does it work?
I’m new to snap. I see these lines 20,24 in the log:
20 │ 2023-05-17 14:52:41.031 Instance 'snapcraft-fbrary-on-amd64-for-amd64-140034' does not exist.
24 │ 2023-05-17 14:52:41.081 Base instance 'base-instance-snapcraft-buildd-base-v00--a12c0d0071c13c372948' does not exist.
Ah ha! Now this is another bug. This is an issue with the LXD container having a network connectivity problem. Often, Docker is the culprit (although there may be something else with LXD + Fedora, I’m not sure). Here’s a post I made a few weeks ago for someone experiencing the same problem:
If Docker is installed on your host, it may be causing the network connectivity issues. See these links for more information from craft-providers, lxd, and docker.
Ah, podman. Please keep me updated if you find a solution, I’m interested in improving the user experience for networking issues concerning snapcraft + LXD.
I was able to fix my problem (at least the connectivity part) by permanently adding the lxd network interface (lxdbr0) to the trusted zone in firewalld:
Thank you @b0wter for doing such awesome detective job! I’m new to snapcraft, and just switched to Fedora, and had the exact same issue. Took me a few hours to find your response. It worked magic!