snapcraft should check permissions before starting an upload

Bug #1627843 reported by Thomi Richards on 2016-09-26
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
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-permission-required"}]}'
```

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

Sergio Schvezov (sergiusens) wrote :

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.

Sergio Schvezov (sergiusens) wrote :

oops, 2.18 adds macaroon refreshing through LP: #1621171

Changed in snapcraft:
importance: Undecided → Medium
status: New → Triaged
Thomi Richards (thomir) wrote :

Hi Sergio,

Thanks for your reply. It's great to hear that this may be fixed (or at least made less annoying) in 2.18, but in this particular case I'm tied to running on Xenial. Is there an SRU planned for 2.18?

Perhaps there are plans to ship snapcraft as a snap? You could build snapcraft with snapcraft, would would be fun :D

El 26/09/16 a las 18:23, Thomi Richards escribió:
> Hi Sergio,
>
>
> Thanks for your reply. It's great to hear that this may be fixed (or at least made less annoying) in 2.18, but in this particular case I'm tied to running on Xenial. Is there an SRU planned for 2.18?

2.18 is making its way (2.18.1 really) into xenial as we speak.

> Perhaps there are plans to ship snapcraft as a snap? You could build
> snapcraft with snapcraft, would would be fun :D
>

We can create one which was basically useless until a bit ago. Now we
can use cleanbuild thanks to the lxd snap/interface. As soon as the
"always run a project in a container" work is started/completed we will
look into providing snapcraft as a snap.

Thomi Richards (thomir) wrote :

On Tue, Sep 27, 2016 at 10:42 AM, Sergio Schvezov <
<email address hidden>> wrote:

> 2.18 is making its way (2.18.1 really) into xenial as we speak.
>

ᕕ( ᐛ )ᕗ

>
> > Perhaps there are plans to ship snapcraft as a snap? You could build
> > snapcraft with snapcraft, would would be fun :D
> >
>
> We can create one which was basically useless until a bit ago. Now we
> can use cleanbuild thanks to the lxd snap/interface. As soon as the
> "always run a project in a container" work is started/completed we will
> look into providing snapcraft as a snap.
>

Sounds excellent.

--
Thomi Richards
<email address hidden>

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

Other bug subscribers