Launchpad not uploading Snap packages

Asked by Microsoft Azure IoT

I have renamed my snap package and I reconfigured my Launchpad project to reflect the new name. The snap built fine, but then it had errors uploading and resulted in...

-----------------------------------
Launchpad failed to upload this snap package to the store:

  403 Client Error: Forbidden

You can retry the upload here:

  https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Flaunchpad.net%2F~aziot%2F%2Bsnap%2Fazure-iot-edge%2F%2Bbuild%2F40061&data=02%7C01%7Czafields%40microsoft.com%7Cedaf0fd218264fb1b1b408d4a2ea16a4%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636312573676865086&sdata=JWgzKImOr%2BZJgsjGh3gQgd75Oau%2FU0ScH6zTVCgouKw%3D&reserved=0

--
https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Flaunchpad.net%2F~aziot%2F%2Bsnap%2Fazure-iot-edge%2F%2Bbuild%2F40061&data=02%7C01%7Czafields%40microsoft.com%7Cedaf0fd218264fb1b1b408d4a2ea16a4%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636312573676865086&sdata=JWgzKImOr%2BZJgsjGh3gQgd75Oau%2FU0ScH6zTVCgouKw%3D&reserved=0
You are the requester of the build.
-----------------------------------

However, if I download the binary (.snap) from Launchpad and call `snapcraft push` from the command line, it works without incident.

~Zak

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Colin Watson (cjwatson) said :
#2

Sorry for the delay in replying. When you changed the name in Launchpad, it should have asked you to reauthorise uploads to the store. Do you remember if it did so?

We're also looking into some possible store bugs here, and Launchpad changes to make this kind of thing easier to debug.

Revision history for this message
Microsoft Azure IoT (aziot) said :
#3

No worries. Yes it did prompt me to reauthorize, so I was particularly surprised by this error.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Revision history for this message
Microsoft Azure IoT (aziot) said :
#5

I tried again this morning, and I am receiving error message...

    "Launchpad failed to upload this snap package to the store:

      Package-restricted permission does not include snap-id 8neFt3wtSaWGgIbEepgIJcEZ3fnz7Lwt"

I went through the "edit snap package" page, clicked the "update snap package" button at the bottom. No new prompts or required fields, where do I go from here?

Revision history for this message
Best Colin Watson (cjwatson) said :
#6

Right, so we now have something resembling logs that can help with this. Here's what the last upload attempt of your snap said:

[2017-06-26 17:09:26,279: DEBUG/Worker-2] root macaroon: snap-ids: ["EtvY9UZBXIFAN71hD4sk4JEnWRtrvdLI"]

Note that that doesn't match the one in the error message you quoted. When I ask the store about those two IDs, here's what I get:

$ curl -s https://assertions.ubuntu.com/v1/assertions/snap-declaration/16/EtvY9UZBXIFAN71hD4sk4JEnWRtrvdLI | jq
{
  "headers": {
    "authority-id": "canonical",
    "publisher-id": "Bmfm0Ld9V4aaHzUPInULqhSCgjkqe7Nq",
    "revision": "1",
    "series": "16",
    "sign-key-sha3-384": "BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul",
    "snap-id": "EtvY9UZBXIFAN71hD4sk4JEnWRtrvdLI",
    "snap-name": "",
    "timestamp": "2017-05-24T09:11:36.259468Z",
    "type": "snap-declaration"
  }
}
$ curl -s https://assertions.ubuntu.com/v1/assertions/snap-declaration/16/8neFt3wtSaWGgIbEepgIJcEZ3fnz7Lwt | jq
{
  "headers": {
    "authority-id": "canonical",
    "publisher-id": "XVMUaIneCOdPP0pzMWLBHHjdkd9UCcDp",
    "series": "16",
    "sign-key-sha3-384": "BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul",
    "snap-id": "8neFt3wtSaWGgIbEepgIJcEZ3fnz7Lwt",
    "snap-name": "azure-iot-edge",
    "timestamp": "2017-05-24T09:11:54.523755Z",
    "type": "snap-declaration"
  }
}

The first of those is the one that the authorisation token stored by Launchpad is currently pointing to. It's a revoked snap-id (the snap-name is empty), which is why this doesn't work. It looks like it was deleted and then re-created in the store.

I know you said that you were prompted to reauthorise the snap in Launchpad, but I wonder if there was some kind of race condition at the time that meant that you ended up with the old revoked snap-id anyway. Could you please try reauthorising it once more? You can do that here:

  https://launchpad.net/~aziot/+snap/azure-iot-edge/+authorize

Revision history for this message
Microsoft Azure IoT (aziot) said :
#7

Thanks Colin Watson, that solved my question.