snapcraft should check permissions before starting an upload
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi,
I'm running:
snapcraft push <snap_file> --release <channel>
and sometimes it seems my authentication session has expired. Snapcraft uploads the entire snap file and then tells me:
```
Received 401: '{"error_list": [{"message": "Authorization Required", "code": "macaroon-
```
Running 'snapcraft login' and then re-running the above command fixes the issue.
The problem is that my upload speed is limited, and the snap is rather large. Ideally snapcraft would check that it has permissions to complete the operation before uploading everything.
If there's a race condition (i.e.- auth credentials expire while the upload is happening) that's regrettable, but would be far better than what it's doing now.
I'm running the latest snapcraft that's available on Xenial (which is where these snaps are built): 2.17
You might want 2.18 which doesn't completely fix this and we are also waiting on the API to query the store if pushing is ok before pushing a file, which would solve LP: #1610776 but would also solve your problem.
I am tempted to mark it as a dup of LP: #1610776 but will leave it separate for now.