classic image can't get serial with a gadget without a brand store
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-
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.
{\"error_
```
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-
"node-red"
],
"timestamp": "2019-06-
}
```
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.
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.