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.
tomp
(Thomas Parrott)
November 15, 2021, 8:39am
2
What is the full URL you are requesting?
I’m guessing its https://images.linuxcontainers.org/1.0
tomp
(Thomas Parrott)
November 15, 2021, 8:47am
4
@ack is this something you would know about? Thanks
Perhaps related to
Hello,
We’ve recently been doing some work to modernize and improve our image servers.
New mirrors
The two frontend servers provided by Canonical Ltd. have been replaced by four new servers, two in the UK and two in the US, providing additional capacity and making maintenance easier by not having to temporarily re-route all traffic to another continent.
We always recommend everyone interact with our image servers through https://images.linuxcontainers.org which will then send you to the clos…
ack
(Alberto Donato)
November 15, 2021, 9:06am
5
@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?
tomp
(Thomas Parrott)
November 15, 2021, 9:19am
6
I wonder if the python client is reliant on the deprecated (actually removed) behaviour mentioned here:
Hello,
We’ve recently been doing some work to modernize and improve our image servers.
New mirrors
The two frontend servers provided by Canonical Ltd. have been replaced by four new servers, two in the UK and two in the US, providing additional capacity and making maintenance easier by not having to temporarily re-route all traffic to another continent.
We always recommend everyone interact with our image servers through https://images.linuxcontainers.org which will then send you to the clos…
As I have launched instances from those mirrors this morning and its working fine with LXD’s go client.
ack
(Alberto Donato)
November 15, 2021, 9:55am
7
@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?
ack
(Alberto Donato)
November 15, 2021, 1:28pm
9
I think you need to use the simplestreams python library for that.
1 Like