Error messages when refreshes are in flight

Not sure if this is a bug or just something that needs discussion / documentation.

Imagine you have a snap which requires interfaces to be connected for it to work properly. You use the snap connect command to fulfill this requirement. If you do it while a snap refresh is happening, you get some interesting obtuse messages.

alan@KinkPad-K450:~$ snap connect vokoscreen-ng:mount-observe 
error: snap "core" has "refresh-snap" change in progress
alan@KinkPad-K450:~$ snap connect vokoscreen-ng:camera
error: cannot communicate with server: timeout exceeded while waiting for response

As a normal user, what does this mean? Is there a problem? Should I retry? Should the error message perhaps give me a hint?

This is by design, I think we could make this a bit more clear, would something like this make more sense to you as a user:

error connecting "vokoscreen-ng:mount-observe" to "core:mount-observe": snap "core" has "refresh-snap" change in progress, please try again later

This seems like a bug, what I assume happened is that because the core snap was being refreshed, snapd the daemon needed to restart, and so “snap” the client got hung up waiting for snapd to restart. I think the right thing to do here is to make the client error message more descriptive as well (and possibly also make the timeout larger?) Is this more clear:

error: cannot communicate with snapd server: timeout exceeded while waiting for response, please try again later

Yes, something which explains an error condition has occurred, the fact it wasn’t my fault, and that something I can do will resolve the issue.

1 Like