snapcraft export-login doesn't provide meaningful error messages when an argument is wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Triaged
|
Medium
|
Sergio Schvezov |
Bug Description
Steps to reproduce:
1. Run
```
expiry_
acls='package_
snap_name='firefox'
snapcraft export-login --channels=esr --snaps="snap_name" --acls="$acls" --expires=
```
(Note there's a bug in the last command, "snap_name" instead of "$snap_name".
2. Fill the right credentials.
Expected results: A meaningful error message like: "Server reported 'snap_name' is not a valid snap".
Actual results: Just this error message is provided: "Authentication error: Failed to get macaroon".
Context: I made this mistake after 2 successful macaroon exports. The lack of information lead me to think there was a bug around custom tracks. "ESR" was created in https:/
Kudos to Daniel Manrique who gave me a simple way to debug what's happening. Although, I think error messages should provide more info by default.
Changed in snapcraft: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Sergio Schvezov (sergiusens) |
As seen in the other bug, snapcraft code basically gives a generic "Failed to get macaroon" message if the store responds with a not-OK http status (4xx and 5xx pretty much):
if response.ok: json()[ "macaroon" ] StoreAuthentica tionError( "Failed to get macaroon", response)
return response.
else:
raise errors.