root@here:/home/me# snap refresh foo
error: snap "foo" not found
root@here:/home/me# snap install foo
snap "foo" is already installed, see 'snap help refresh'
I’ve tried adding --amend to the refresh command, but that doesn’t help.
I don’t have a reproducer, but this issue showed up at the same time my snap login broke. This is a private snap. I logged out and logged back in again but now the refresh command is broken.
There’s very little information for anyone to try to figure out what the issue could be. Have you looked at snapd logs? Can you attach the output of snap list?
If you’re worried about leaking the name of the private snap, but are a customer you should file a support ticket.
The snapd logs don’t have a lot to say. I mainly see:
May 01 06:23:04 10002 snapd[473144]: storehelpers.go:916: cannot refresh:
May 01 06:23:04 10002 snapd[473144]: snap has no updates available: "core20", "core22", "core24", "mesa-core20", "mesa-core22", "nmap", "snapd", "ubuntu-fra>
May 01 06:23:04 10002 snapd[473144]: snap not found: "sponge-controller"
May 01 14:08:45 10002 snapd[473144]: api_snaps.go:467: Installing snap "sponge-controller" revision unset
This is from the output of journalctl -u snapd. Is there a better place to view snapd logs?
I would have assumed that the “install” and “refresh” commands use the same piece of code to verify if a snap exists, but maybe the account verification scripts differ between the two?
root@here:~$ snap changes
ID Status Spawn Ready Summary
27194 Done yesterday at 14:51 EDT yesterday at 14:53 EDT Auto-refresh snap "snapd"
snap changes doesn’t give more info. The last snap refresh on this system for the snap in question was the 10th of February, I just noticed the other day that it was out of date.
I think it may be really a store error that the snap wasn’t found. This is in line with what you mentioned about the snap being private.
Have you tried querying the store about the snap, by running snap info <snapname> ? Are you logged in? i.e. have you run snap login before? Does snap whoami show that you are logged in?
snap whoami shows that I am indeed logged in. When this issue first popped up I tried to logout and log back in again, but that didn’t help.
I tried some other snap commands too: snap install, snap switch, snap info, snap enable all recognize that the snap is installed. snap refresh seems to think that the snap is not installed.
Ordinarily I would try to uninstall and reinstall the snap, but this machine is a remote iot machine for which the remote access is handled by the snap in question. I can’t risk uninstalling the existing version and loosing access.
I suppose I could install a different means of remote access and reinstall the snap after, but if this is indeed a bug in snapd then fixing it there would be a better solution.
It could be that the snap store is returning not found error which snapd relays back to the user. Can you add the following:
SNAPD_DEBUG_HTTP=7
SNAPD_DEBUG=1
to the snapd service environment, restart snapd, run snap refresh and collect the logs?
Make sure to edit the logs and erase authentication Macaroon before pasting them to the forum.
Other snap versions seem to be listed properly, is it possible that the private revision was removed? Can you paste the output of snap list sponge-controller?
If the snap is unasserted you may need to run snap refresh --amend sponge-controller for snapd to start tacking the version available from the store again.