Cannot download snap file

I am trying to create an image with ubuntu-image and the process fails when trying to download from the public store a private devmode snap, saying

error: cannot download snap "iris-incuvers": snap not found

I am logged in and can snap info correctly, I’m targeting the edge channel. Since the snap I need is built for ARM64 and ubuntu-image is running on AMD64, I make sure to set the UBUNTU_STORE_ARCH=arm64 environment variable.

I can try to install the snap (from an ARM64 host) and I actually see the download progress, but a pure download operation setill fails. The snap confinement is still in devmode, and as I understand do not appear in search results, does it also prevent snap download ?

Don’t do that …
The architecture is defined in your model assertion, ubuntu-image knows exactly what to do to get the binaries for the target arch, just let it do its job, there is no need to set the STORE_ARCH for it…

are you able to publish your model assertion so we can see if there is anything wrong in the snap list definitions ?

Yes of course.

{
    "type": "model",
    "series": "16",
    "authority-id": "BZn14KGiwBc3TVYC0rgBvDtkHrbYbspY",
    "brand-id": "BZn14KGiwBc3TVYC0rgBvDtkHrbYbspY",
    "model": "iris",
    "architecture": "arm64",
    "timestamp": "<TIMESTAMP>",
    "base": "core20",
    "grade": "dangerous",
    "snaps": [
        {
            "name": "pi-iris",
            "type": "gadget"
        },
        {
            "name": "iris-incuvers",
            "type": "app",
            "default-channel": "latest/edge",
            "id": "JsYa4C4zXTON8ycQXgRZVtgBol21swB6"
        },
        {
            "name": "pi-kernel",
            "type": "kernel",
            "default-channel": "20/stable",
            "id": "jeIuP6tfFrvAdic8DMWqHmoaoukAPNbJ"
        },
        {
            "name": "core20",
            "type": "base",
            "default-channel": "latest/stable",
            "id": "DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q"
        },
        {
            "name": "snapd",
            "type": "snapd",
            "default-channel": "latest/stable",
            "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
        }
    ]
}

For context: I’m still exploring the snap process and plan to eventually bring our snaps in a properly confined state. I’m playing around with image making at the moment to make sure I understand the pipeline all the way to deployment (before requesting a brand store).

I inject a date and create a signed model via a script.
I use the --snap pi-iris_20-1_arm64.snap arguments to add the gadget from a file (build on ARM64):
ubuntu-image snap --snap pi-iris_20-1_arm64.snap iris-model.model
The problem arises while trying to download iris-incuvers (which is a devmode ARM64 private snap on the edge channel of the ubuntu store).

This looks all fine, my guess is that ubutu-image can simply not see the snap because it is private (though perhaps @ijohnson has any other idea) … what you can do is to pre-download the snap and simply use a second --snap argument for it to have it locally installed …

ubuntu-image does not use the login info of snap from your host, the ubuntu-image snap ships it’s own version of the snap command, and even then it uses the snap download command which does not use the login credentials of snap info.

What you can do is define the UBUNTU_STORE_AUTH_DATA_FILENAME env var to point to a file that you create with snapcraft export-login ... with appropriate access granted to the macaroon created by snapcraft.

Oh, great it’s downloading right now! Thanks, you two unblocked me once again.

1 Like