The snap store is indeed returning a not found error, but the error is different from a snap that actually does not exist.
These are the snapd logs with the debug flags enabled for snap refresh sponge-controller
:
May 06 08:28:45 here snapd[2358262]: store_action.go:607: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
May 06 08:28:45 here snapd[2358262]: retry.go:51: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=11.314µs
May 06 08:28:45 here snapd[2358262]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.68.4 (series 16; classic) ubuntu/22.04 (arm64>
May 06 08:28:47 here snapd[2358262]: logger.go:74: DEBUG: < "HTTP/1.1 200 OK\r\nContent-Length: 957\r\nContent-Type: application/json\r\nDate: Tue, 06 May 2025 12:28:47 GMT\r\nServer: gun>
May 06 08:28:47 here snapd[2358262]: retry.go:63: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/refresh finished after 1 retries, elapsed time=1.985163529s, status: 200
May 06 08:28:47 here snapd[2358262]: store_action.go:607: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
May 06 08:28:47 here snapd[2358262]: retry.go:51: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=9.908µs
May 06 08:28:47 here snapd[2358262]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.68.4 (series 16; classic) ubuntu/22.04 (arm64>
May 06 08:28:48 here snapd[2358262]: logger.go:74: DEBUG: < "HTTP/1.1 200 OK\r\nContent-Length: 275\r\nContent-Type: application/json\r\nDate: Tue, 06 May 2025 12:28:48 GMT\r\nServer: gun>
May 06 08:28:48 here snapd[2358262]: retry.go:63: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/refresh finished after 1 retries, elapsed time=813.929704ms, status: 200
May 06 08:28:48 here snapd[2358262]: daemon.go:220: DEBUG: pid=2358813;uid=1000;socket=/run/snapd.socket; POST /v2/snaps/sponge-controller 2.854062054s 404
And when I call snap refresh non-existing-snap
:
May 06 08:31:34 here snapd[2358262]: store_action.go:607: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
May 06 08:31:34 here snapd[2358262]: retry.go:51: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=15.5µs
May 06 08:31:34 here snapd[2358262]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.68.4 (series 16; classic) ubuntu/22.04 (arm64) linux/>
May 06 08:31:35 here snapd[2358262]: logger.go:74: DEBUG: < "HTTP/1.1 200 OK\r\nContent-Length: 957\r\nContent-Type: application/json\r\nDate: Tue, 06 May 2025 12:31:35 GMT\r\nServer: gunicorn\r\>
May 06 08:31:35 here snapd[2358262]: retry.go:63: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/refresh finished after 1 retries, elapsed time=1.75552389s, status: 200
May 06 08:31:35 here snapd[2358262]: daemon.go:220: DEBUG: pid=2359353;uid=1000;socket=/run/snapd.socket; POST /v2/snaps/non-existing-snap 1.832124613s 400
The difference seems to be a 404 when looking for sponge-controller
and 400 for non-existing-snap
.
Snapd logs for snap info sponge-controller
:
May 06 08:36:41 here snapd[2358262]: retry.go:51: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/info/sponge-controller?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2Clinks%2Cc>
May 06 08:36:41 here snapd[2358262]: logger.go:67: DEBUG: > "GET /v2/snaps/info/sponge-controller?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2Clinks%2Ccontact%2Ccreated-at%2Cdes>
May 06 08:36:43 here snapd[2358262]: logger.go:74: DEBUG: < "HTTP/1.1 200 OK\r\nContent-Length: 3056\r\nContent-Type: application/json\r\nDate: Tue, 06 May 2025 12:36:43 GMT\r\nServer: gunicorn\r>
May 06 08:36:43 here snapd[2358262]: retry.go:63: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/info/sponge-controller?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2>
May 06 08:36:43 here snapd[2358262]: daemon.go:220: DEBUG: pid=2360575;uid=1000;socket=/run/snapd.socket; GET /v2/find?name=sponge-controller 2.103744734s 200
May 06 08:36:44 here snapd[2358262]: daemon.go:220: DEBUG: pid=2360575;uid=1000;socket=/run/snapd.socket; GET /v2/snaps/sponge-controller 715.617405ms 200
Snapd logs for snap info non-existing-snap
:
May 06 08:34:54 here snapd[2358262]: retry.go:51: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/info/non-existing-snap?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2Clinks%2Cc>
May 06 08:34:54 here snapd[2358262]: logger.go:67: DEBUG: > "GET /v2/snaps/info/non-existing-snap?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2Clinks%2Ccontact%2Ccreated-at%2Cdes>
May 06 08:34:56 here snapd[2358262]: logger.go:74: DEBUG: < "HTTP/1.1 404 NOT FOUND\r\nContent-Length: 115\r\nContent-Type: application/json\r\nDate: Tue, 06 May 2025 12:34:55 GMT\r\nServer: guni>
May 06 08:34:56 here snapd[2358262]: retry.go:63: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/info/non-existing-snap?architecture=arm64&fields=architectures%2Cbase%2Cconfinement%2>
May 06 08:34:56 here snapd[2358262]: daemon.go:220: DEBUG: pid=2360217;uid=1000;socket=/run/snapd.socket; GET /v2/find?name=non-existing-snap 1.91079169s 404
May 06 08:34:56 here snapd[2358262]: daemon.go:220: DEBUG: pid=2360217;uid=1000;socket=/run/snapd.socket; GET /v2/snaps/non-existing-snap 855.927µs 404
The messages from the snap refresh command are also different between the two:
root@here:~$ snap refresh sponge-controller
error: snap "sponge-controller" not found
root@here:~$ snap refresh non-existing-snap
error: cannot refresh "non-existing-snap": snap "non-existing-snap" is not installed
The other two commands you requested:
root@here:~$ snap list sponge-controller
Name Version Rev Tracking Publisher Notes
sponge-controller 0+git.d67eb1a-dirty 320 latest/beta ****** private
root@here:~$ snap refresh --amend sponge-controller
error: snap "sponge-controller" not found