Problem with the UK mirror?

Is there an issue with the UK LXD mirror?

I created a minimal example to reproduce the issue:

import pylxd

def __get_remote_image_fingerprint(remote, image_name):
    image_fingerprint = image_name
    if remote:
        remote_client = pylxd.Client(remote)
    else:
        remote_client = pylxd.Client()
    if remote_client.images.exists(image_name, alias=True):
        image_fingerprint = remote_client.images.get_by_alias(image_name).fingerprint
    else:
        if not remote_client.images.exists(image_name):
            raise LxdImageNotFoundError(
                "Image '{}' not found on server '{}'".format(image_name, remote)
            )
    return image_fingerprint


remote = "https://images.linuxcontainers.org"
image_name = "debian/buster/i386"

__get_remote_image_fingerprint(remote, image_name)

This worked before and now fails with a 404.
Interestingly enough:

lxc remote list
+-----------------+-------------------------------------------------------+---------------+-------------+--------+--------+
|      NAME       |                          URL                          |   PROTOCOL    |  AUTH TYPE  | PUBLIC | STATIC |
+-----------------+-------------------------------------------------------+---------------+-------------+--------+--------+
| images          | https://images.linuxcontainers.org                    | simplestreams | none        | YES    | NO     |


lxc launch images:debian/10/i386

Still works fine.

What is the full URL you are requesting?

I’m guessing its https://images.linuxcontainers.org/1.0

@ack is this something you would know about? Thanks

Perhaps related to

@tomp I don’t know how official image mirros are setup, but AFAICS the issue there is that the page redirects to https://uk.lxd.images.canonical.com/1.0 which is a 404:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): images.linuxcontainers.org:443
DEBUG:urllib3.connectionpool:https://images.linuxcontainers.org:443 "GET /1.0 HTTP/1.1" 302 154
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): uk.lxd.images.canonical.com:443
DEBUG:urllib3.connectionpool:https://uk.lxd.images.canonical.com:443 "GET /1.0 HTTP/1.1" 404 290

I get the same behavior if I visit https://images.linuxcontainers.org/1.0 from the browser.

@stgraber is perhaps something missing on that mirror set up?

I wonder if the python client is reliant on the deprecated (actually removed) behaviour mentioned here:

As I have launched instances from those mirrors this morning and its working fine with LXD’s go client.

@l33tname I think the issue there is that you’re trying to interact with the simplestreams-based image server as if it were a LXD remote.

Pylxd doesn’t support simplestreams directly, you can tell LXD to create an instance from an image from a simplestreams remote of course, but in that case it’s LXD that talks to the image server.

So there is no way to the a fingerprint for a image alias from a simplestream server?

I think you need to use the simplestreams python library for that.

1 Like