classic image can't get serial with a gadget without a brand store

Bug #1834686 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Unassigned

Bug Description

Currently, if you create a classic model with a gadget snap and seed it onto an image such as a cloud image, the device is unable to acquire a serial from the store:

```
ubuntu@ubuntu:~$ snap changes
ID Status Spawn Ready Summary
1 Done today at 18:36 UTC today at 18:38 UTC Initialize system state
2 Error today at 18:37 UTC today at 18:37 UTC Initialize device

ubuntu@ubuntu:~$ snap tasks 2
Status Spawn Ready Summary
Done today at 18:37 UTC today at 18:37 UTC Generate device key
Error today at 18:37 UTC today at 18:37 UTC Request device serial

......................................................................
Request device serial

2019-06-28T18:37:11Z ERROR cannot deliver device serial request: Cannot process serial request for device with brand "MY_UBUNTU_ID" and model "test-model"

ubuntu@ubuntu:~$ snap known serial
ubuntu@ubuntu:~$
```

Going through the debug logs for snapd the store is returning 403 (newlines added for clarity):

```
Jun 28 18:44:17 ubuntu snapd[2287]: logger.go:74: DEBUG: < "
HTTP/1.1 403 FORBIDDEN
Content-Length: 324
Content-Type: application/json
Date: Fri, 28 Jun 2019 18:44:17 GMT
Server: gunicorn/19.7.1
Snap-Store-Version: 14
X-Request-Id: SOME-BIG-ID
X-Vcs-Revision: 21acec0
X-View-Name: snapdevicegw.webapi_auth.device_registration

{\"error_list\":[{\"code\":\"device-registration-forbidden\",\"message\":\"Cannot process serial request for device with brand \\\"MY_UBUNTU_ID\\\" and model \\\"test-model\\\"\"}],\"errors\":[\"Cannot process serial request for device with brand \\\"MY_UBUNTU_ID\\\" and model \\\"test-model\\\"\"],\"result\":\"error\"}\n"
```

I reproduced this with the following model.json:

```
{
    "type": "model",
    "authority-id": "MY_UBUNTU_ID",
    "brand-id": "MY_UBUNTU_ID",
    "series": "16",
    "model": "test-model",
    "architecture": "amd64",
    "classic": "true",
    "gadget": "pc",
    "required-snaps": [
        "node-red"
    ],
    "timestamp": "2019-06-25T04:40:53+00:00"
}
```

I can provide more information on how to boot this image to perform a first-boot with the seed and reproduce it (I did this with qemu). It's a bit more involved and this bug is just to explain the root issue with not getting a serial.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

This issue also prevents any gadget installed in the image from processing the auto-connection rules specified in the `connections` stanza of the gadget.yaml.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I believe this is going to be addressed by improvements to the snap store and the serial vault, where a brand may get a serial assertion for a given model from the generic / shared serial vault. Having said that I'm not aware of the status of this work. I'm marking it as confirmed though.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Medium
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.