Unclear error message when you have insufficient rights to a snap.

Bug #1718710 reported by Eric Snow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

tl;dr If you have insufficient rights to a snap then snapcraft prints an unhelpful error message (for commands that interact with the snap store).

I went to push a snap (let's call it "proj-snap") for a project I work on and the command failed:

  $ snapcraft push proj-snap_0.1_amd64.snap
  Snap 'proj-snap' was not found in '16' series.

That error message left me uncertain as to the problem (did I misspell it or something?) or what to do next. After double-checking, I verified that the snap name was correct. So I ran "snapcraft list-revisions proj-snap" to see what it would tell me, thinking that perhaps "series" in the error message was related to the revision. I got the same error.

At that point I tracked down the source code that matches the error message (SnapNotFoundError) and then the likely place the exception was raised. [1] Then it became mostly clear that snapcraft knows which snaps I have rights to and failed when it couldn't find "proj-snap" in that list. To verify this I ran "snapcraft list-revisions my-snap", where "my-snap" is a snap that I personally registered; it worked without error.

Conclusion: if you don't have sufficient rights to a snap in the store then snapcraft should clearly tell you that (e.g. "Insufficient rights to snap 'proj-snap'"). That would have saved me a bunch of time.

[1] https://github.com/snapcore/snapcraft/blob/2b2d5b1b9b7b31a10615dd6ad5bab3783f2a3f89/snapcraft/storeapi/__init__.py#L253

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

This occurs with other commands as well, e.g. `snapcraft status`. This message definitely needs to be changed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.