As of a few hours ago, my kubectl snap stopped working on my system. The path is no longer in /snap/bin, snap list shows it as disabled,classic and I can’t refresh.
As a result I can no longer manage any of my kubernetes clusters. How do I rectify this and why did my snap move to disabled?
I don’t know anything that would move your snap to disabled beyond snap disable kubectl (maybe you did it thinking of snap stop --disable kubectl?). In any case you should be able to enable it again by doing snap enable kubectl.
Do remember that snapd will do a refresh in the background. (self-updating). I’m also curious as to the output of snap list --all | grep kube. I ask because I’m curious if you went through a refresh that caused this.
As you can see - my system has taken a few version through an automated refresh.
You could just move to the previous version with sudo snap revert kubectl. Test. And then you could move back to current with sudo snap refresh kubectl. Just need to determine if the issue is within the package or your system.
If you wanted to be aggressive, you could also remove the package with sudo snap remove kubectl and reinstall.
Oh - I missed that you could not run the other snap commands. Is that the case for all snaps on your system? Or just the kubectl one? What sort of errors do you get with things like list, etc?
Honestly, the output / errors for all these commands did not really lead me to know how I could see what’s going on. Here is that output:
ID Status Spawn Ready Summary
481 Doing 2018-02-17T01:48:48Z -
Don’t know what it’s doing, but it’s not ready apparently.
For now I’ve been doing /snap/kubectl/328/kubectl as my command, but it breaks a lot of my automation/scripts/history because it expects that to be in $PATH.
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:48Z Ensure prerequisites for "kubefed" are available
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:49Z Download snap "kubefed" (322) from channel "stable"
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:49Z Fetch and check assertions for snap "kubefed" (322)
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:50Z Mount snap "kubefed" (322)
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:50Z Run pre-refresh hook of "kubefed" snap if present
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:50Z Stop snap "kubefed" services
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:50Z Remove aliases for snap "kubefed"
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:50Z Make current revision for snap "kubefed" unavailable
Doing 2018-02-17T01:48:48Z - Copy snap "kubefed" data
Do 2018-02-17T01:48:48Z - Setup snap "kubefed" (322) security profiles
Do 2018-02-17T01:48:48Z - Make snap "kubefed" (322) available to the system
Do 2018-02-17T01:48:48Z - Set automatic aliases for snap "kubefed"
Do 2018-02-17T01:48:48Z - Setup snap "kubefed" aliases
Do 2018-02-17T01:48:48Z - Run post-refresh hook of "kubefed" snap if present
Do 2018-02-17T01:48:48Z - Start snap "kubefed" (322) services
Do 2018-02-17T01:48:48Z - Remove data for snap "kubefed" (260)
Do 2018-02-17T01:48:48Z - Remove snap "kubefed" (260) from the system
Do 2018-02-17T01:48:48Z - Clean up "kubefed" (322) install
Do 2018-02-17T01:48:48Z - Run configure hook of "kubefed" snap if present
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:48Z Ensure prerequisites for "kubectl" are available
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:51Z Download snap "kubectl" (328) from channel "stable"
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Fetch and check assertions for snap "kubectl" (328)
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Mount snap "kubectl" (328)
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Run pre-refresh hook of "kubectl" snap if present
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Stop snap "kubectl" services
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Remove aliases for snap "kubectl"
Done 2018-02-17T01:48:48Z 2018-02-17T01:48:52Z Make current revision for snap "kubectl" unavailable
Doing 2018-02-17T01:48:48Z - Copy snap "kubectl" data
Do 2018-02-17T01:48:48Z - Setup snap "kubectl" (328) security profiles
Do 2018-02-17T01:48:48Z - Make snap "kubectl" (328) available to the system
Do 2018-02-17T01:48:48Z - Set automatic aliases for snap "kubectl"
Do 2018-02-17T01:48:48Z - Setup snap "kubectl" aliases
Do 2018-02-17T01:48:48Z - Run post-refresh hook of "kubectl" snap if present
Do 2018-02-17T01:48:48Z - Start snap "kubectl" (328) services
Do 2018-02-17T01:48:48Z - Remove data for snap "kubectl" (266)
Do 2018-02-17T01:48:48Z - Remove snap "kubectl" (266) from the system
Do 2018-02-17T01:48:48Z - Clean up "kubectl" (328) install
Do 2018-02-17T01:48:48Z - Run configure hook of "kubectl" snap if present
Was there ever a resolution to this topic? I have a snap installed that is stuck in autorefresh. I can’t manually refresh, remove, stop, etc. Everything seems to produce the following…
error: snap “todoist” has “auto-refresh” change in progress
Nevermind. I was able to resolve this with a restart. I didn’t document it like I should but I ended up having to hold the power button to get the machine off. it was stuck trying to unmount something related to snaps. So I’m sure that was a related factor why it was stuck autorefreshing.