Snap install gets stuck

At some point something seems to have broken with my snap setup on Fedora 27, and now snap install some-snap always just gets 100% stuck. It worked before, I managed to install several things (e.g. Discord) via it just fine, but now nothing.

It asks for sudo access, and then freezes. I’ve tried to reboot, restart the snapd service, etc. but nothing seems to help. It prints exactly nothing to the console after I hit Enter to run the command. I’ve also tried installing several different things (e.g. snap install atom and snap install mailspring). Neither install or remove works, regardless of if I invite a non-existing package for remove.

I can’t find any logs anywhere in my system for snap (is this seriously working as designed?), and simply running sudo strace -f -p $(pidof snapd) while trying to run the other commands doesn’t reveal any issues. If I also start the client with strace -f -p snap remove mailspring it gets stuck in some infinite FUTEX_WAIT and ETIMEDOUT loop, while the snapd process seems to just be stuck on some other waits.

The straces themselves don’t seem to provide me with a lot of insight into what’s going on, but I can provide dumps if they are helpful.

Thanks for your post! Does every snap command freezes? Can you please try to run: snap version and snap changes ? The output of those two (if they work) would be very helpful.

There is also SNAPD_DEBUG=1 snap version (or any other command) that might be helpful. Snapd itself should do some logging. So the output of journalctl -u snapd would be great.

Strace is great of course, however when using it with go programs some extra options are required or it hangs. Jamie did a great write-up on this: Stracing snap commands - the important part are the -e !select, ... bits.

Please let us know if you find anything and if you can get the logs from above (snap version,changes, journalctl) that would be great.

We have resolved a similar problem that was caused by SELinux policy, details here:

As of today, the updated snapd packages are in updates-testing. Can you try dnf upgrade --enablerepo=updates-testing and check if it fixes your problem?

Terribly sorry I dropped the ball on this, I’ve been really busy and haven’t had time to dig data for you. However I can happily tell you that dnf upgrade --enablerepo=updates-testing snapd fixed the problems for me.

I would still suggest that there’s some kind of error handling / verbose logging option added so that in the future if any similar issues occur the CLI wouldn’t just freeze without any message.