Skip to content

bootc switch/upgrade fails with 1.5.1 (and later) when remote registry doesn't include Content-Length #1567

@ver4a

Description

@ver4a

(Edited by @cgwalters )

The core issue here appears when a registry doesn't include a Content-Length: HTTP header for GetBlob requests. Most registries do, but apparently some don't (and they're arguably a bit buggy) but we must work with them.

Original issue text

Reproducer:

  1. Copy image using skopeo from docker transport to containers-storage:
skopeo copy docker://quay.io/fedora-ostree-desktops/kinoite:42 containers-storage:registry.uncontrol.me/ver4a/onc-kde:42-upstream
  1. Copy the image back into a registry:
skopeo copy containers-storage:registry.uncontrol.me/ver4a/onc-kde:42-upstream docker://registry.uncontrol.me/ver4a/onc-kde:42-upstream

Essentially if an image is copied using skopeo from containers-storage transport to docker transport, at least annotations are lost podman-container-tools/skopeo#2686 (not caused by missing annotations) and bootc upgrade/switch to such an image using docker transport fails.

root@desktop:~# bootc switch registry.uncontrol.me/ver4a/onc-kde:42-upstream
layers already present: 0; layers needed: 65 (3.1 GB)
Fetched layers: 0 B in 0 seconds (0 B/s)
error: Switching: Pulling: Importing: Unencapsulating base: serialization error: invalid value: integer `-1`, expected u64

If such an image is copied to containers-storage beforehand, bootc switch --transport containers-storage works.

root@desktop:~# bootc switch --transport containers-storage registry.uncontrol.me/ver4a/onc-kde:42-upstream
layers already present: 4; layers needed: 61 (2.6 GB)
Fetched layers: 2.43 GiB in 47 seconds (53.23 MiB/s)
Deploying: done (20 seconds)
Pruned images: 0 (layers: 0, objsize: 1.6 GB)

This behavior changed between 1.4.0 (which works) and 1.5.1, I've also tested latest builds after 1.7.1 was released and they had the same behavior as 1.5.1.

error: Switching: Pulling: Importing: Unencapsulating base: serialization error: invalid value: integer `-1`, expected u64

Metadata

Metadata

Assignees

Labels

triagedThis issue appears to be valid

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions