LXC doesn't find remote image

Hi all!
I’m using LXC 2.1 on Ubuntu 16.04. I’ve been already using LXC successfully for some time, but now I added a new image on the remote server, and I cannot access it from my computer.
The image server is https://sdk-images.ubports.com, and it looks like the image (the one whose name contains “amd64-amd64”) can be seen by LXC when listing the repo:

$ lxc image list ubports-sdk:
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
|                   ALIAS                   | FINGERPRINT  | PUBLIC |                 DESCRIPTION                 |  ARCH  |   SIZE   |         UPLOAD DATE          |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
| ubuntu-sdk-16.04-amd64-amd64-dev (3 more) | 0ac230571712 | yes    | ubuntu xenial x86_64 (sdk-amd64) (20181104) | x86_64 | 369.20MB | Nov 4, 2018 at 12:00am (UTC) |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
| ubuntu-sdk-16.04-amd64-armhf-dev (3 more) | 08eca38049fb | yes    | ubuntu xenial x86_64 (sdk-armhf) (20181104) | x86_64 | 443.90MB | Nov 4, 2018 at 12:00am (UTC) |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+

Yet, for some reason I cannot use it:

$ lxc init ubports-sdk:ubuntu-sdk-16.04-amd64-amd64-dev myimage
Creating myimage
error: The requested image couldn't be found.

Any idea what could be wrong? Is there a way to refresh the list of images that LXC knows about?

1 Like

Hi!

It worked for me (LXD 3.6, snap package):

$ lxc init ubports-sdk:ubuntu-sdk-16.04-amd64-amd64-dev myimage
Creating myimage
$ 

I did not find any information on how to set up this LXD remote. Here is the full info.

$ lxc remote add --protocol simplestreams ubports-sdk https://sdk-images.ubports.com/
$ lxc image list ubports-sdk:
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
|                   ALIAS                   | FINGERPRINT  | PUBLIC |                 DESCRIPTION                 |  ARCH  |   SIZE   |         UPLOAD DATE          |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
| ubuntu-sdk-16.04-amd64-amd64-dev (3 more) | 0ac230571712 | yes    | ubuntu xenial x86_64 (sdk-amd64) (20181104) | x86_64 | 369.20MB | Nov 4, 2018 at 12:00am (UTC) |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
| ubuntu-sdk-16.04-amd64-armhf-dev (3 more) | 08eca38049fb | yes    | ubuntu xenial x86_64 (sdk-armhf) (20181104) | x86_64 | 443.90MB | Nov 4, 2018 at 12:00am (UTC) |
+-------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+
$ lxc image info ubports-sdk:ubuntu-sdk-16.04-amd64-amd64-dev
Fingerprint: 0ac230571712de190fc915781f04dda3d4bca579d68411a9603a08058737f4ed
Size: 369.20MB
Architecture: x86_64
Public: yes
Timestamps:
    Created: 2018/11/04 00:00 UTC
    Uploaded: 2018/11/04 00:00 UTC
    Expires: 2019/04/17 00:00 UTC
    Last used: never
Properties:
    version: 16.04
    architecture: x86_64
    label: sdk-amd64
    serial: 20181104
    description: ubuntu xenial x86_64 (sdk-amd64) (20181104)
    os: ubuntu
    release: 16.04
Aliases:
    - ubuntu-sdk-16.04-amd64-amd64-dev
    - ubuntu-sdk-16.04-amd64-amd64-dev/x86_64
    - ubuntu-framework-16.04-amd64-amd64-dev
    - ubuntu-framework-16.04-amd64-amd64-dev/x86_64
Cached: no
Auto update: disabled

As far as I know, there is no caching for the list of container images. It checks the repository every time you ask it to list the container images.

I noticed that you have put the LXC tag for this question but the question is for LXD instead. I am changing it to LXD.

1 Like

Thanks @simos! After removing the remote and re-adding it, it worked for me as well. :slight_smile:

Still the question remains on why it happened, and on whether there is some other way to force refreshing the image list other than removing and re-adding the remote. It might be that this bug has been fixed in version 3, already.

Glad it worked!

LXD uses the instructions at https://sdk-images.ubports.com/streams/v1/com.ubuntu.sdkimage%3Areleased%3Adownload.json to locate the container image.

There are currently two container images (pair for lxd and root files),
https://sdk-images.ubports.com/releases/xenial/

These files have a timestamp of today at 9:15 (no indication of timezone) and you posted the question 11h ago.
Perhaps you tried to access them while they were being updated.

I strongly believe that LXD checks the repository (over the Internet) when you list the packages. Therefore, it is likely it was some issue relating to the repository.