DEV Community

Ross-Li
Ross-Li

Posted on

Cloud Newbie Fixing Newbie Problems: Snap

Initial problem: can't connect to a Google Cloud VM instance created through vscode.

Try to get SSH connection to the instance through Google Cloud Console:
Image description

Image description

Checked firewall rules. There already exists a predefined rule that applies to all instances allowing port 22 for SSH communication.

Enable the serial console, get into the serial console:
The serial console only outputs information and I can't input any command. The outputted information suggests some sort of snapd problem.

Taking a look at CPU usage:
Image description

I continued to work until around 01:00 AM this morning, then I disconnected from the SSH in vscode. But somehow the CPU kept running. Let's check the log around that time.

May 18 00:49:29 appstore snapd[532]: storehelpers.go:923: cannot refresh: snap has no updates available: "code", "core20", "google-cloud-cli", "lxd", "snapd"
Enter fullscreen mode Exit fullscreen mode

Well I forgot the technique of "just fxxking restart it". My concern is that if I stopped and restarted the VM instance, its external IP would be changed (it happened last time), causing a lot of config issues for testing. So I searched for methods to keep the IP not changed during restart. After a little bit of researching I promoted the ephemeral IP to static IP (well for more charges I guess). Now I can restart the instance without worries.

After restarting the instance, everything worked. I was curious what does Snap do other than being a newer fancier package manager than apt (e.g. what do these /dev/loop directories have to deal with my installed applications?), and a brief search online shows me a decent amount of other users ranting about this issue. So I guess the problem could be that my VM instance isn't powerful enough to handle the Snap automatic update (Copilot told me I can't completely turn off the automatic update, WTF?), or some restrictions of my VM instance (e.g. size or number of loopback devices) was reached during the Snap automatic update of some applications that I (vscode specifically, following the instruction of Bash output) or the system installed (google-cloud-cli). I am considering removing Snap altogether but I can't just do it because something important (i.e. google-cloud-cli) was installed by the system default via Snap.

Well Snap (and the version of Ubuntu that started to use Snap), you just got yourself another unsatisfied customer!

Top comments (0)