← Back to issue list

Unable to deploy charm using multi-arch OCI uploaded with charmcraft 3

View original Github issue

Metadata

Project
charmcraft
Number
#2020
Type
issue
State
closed
Author
carlcsaposs-canonical
Labels
—
Created
Updated
Closed

Current evaluation

Fixed in canonical/charmcraft#2037 (commit e84fd122): Skopeo now copies multi-architecture OCI resources with --all, preserving every architecture for deployment.

Resolution: closed resolved

Reason: Merged PR #2037 added Skopeo's --all option so resource uploads include all architectures rather than only the current architecture, resolving the missing-image deployments.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description Uploading a multi-arch OCI with charmcraft 3 (from edge) `upload-resource` causes the charm to not be deployable on Juju on amd64 or arm64 ### To Reproduce 1. On amd64 machine, upload resource (we had to create a new hash for `charmed-mysql` since uploading a hash already in Charmhub uses the existing upload) ``` $ charmcraft upload-resource --format json mysql-router-k8s mysql-router-image --image docker://ghcr.io/canonical/charmed-mysql@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054 {tatus checked: {'revisions': [{'errors': None, 'revision': 59, 'status': 'approved', 'upload-id': 'cf949687-4ce3-4647-b693-1857792cfc3c'}]} "revision": 59 } ``` 2. Release charm ``` $ charmcraft release mysql-router-k8s --revision 543 --channel 8.0/edge/test-cc-poetry-plugin --resource mysql-router-image:59 Revision 543 of 'mysql-router-k8s' released to 8.0/edge/test-cc-poetry-plugin (attaching resources: 'mysql-router-image' r59) ``` 3. On arm64 machine, deploy charm ``` $ juju deploy mysql-router-k8s --channel 8.0/edge/test-cc-poetry-plugin -n 3 --base ubuntu@22.04 Deployed "mysql-router-k8s" from charm-hub charm "mysql-router-k8s", revision 543 in channel 8.0/edge/test-cc-poetry-plugin on ubuntu@22.04/stable ``` 4. Juju status shows ``` Unit Workload Agent Address Ports Message mysql-router-k8s/0 error idle 10.1.215.20 unknown container reason "ImagePullBackOff": Back-off pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3... mysql-router-k8s/1* error idle 10.1.215.22 unknown container reason "ImagePullBackOff": Back-off pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3... mysql-router-k8s/2 error idle 10.1.215.21 unknown container reason "ImagePullBackOff": Back-off pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3... ``` ``` $ kubectl -n foo3 describe pod mysql-router-k8s-0 [...] Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 86s default-scheduler Successfully assigned foo3/mysql-router-k8s-0 to test2 Normal Pulled 86s kubelet Container image "docker.io/jujusolutions/jujud-operator:3.6.0" already present on machine Normal Created 86s kubelet Created container charm-init Normal Started 86s kubelet Started container charm-init Normal Pulled 85s kubelet Container image "docker.io/jujusolutions/charm-base:ubuntu-22.04" already present on machine Normal Created 85s kubelet Created container charm Normal Started 85s kubelet Started container charm Normal BackOff 55s (x5 over 83s) kubelet Back-off pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054" Warning Failed 55s (x5 over 83s) kubelet Error: ImagePullBackOff Normal Pulling 43s (x3 over 85s) kubelet Pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054" Warning Failed 42s (x3 over 83s) kubelet Failed to pull image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": rpc error: code = NotFound desc = failed to pull and unpack image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": failed to resolve reference "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054: not found Warning Failed 42s (x3 over 83s) kubelet Error: ErrImagePull ``` ### Environment Ubuntu 22.04 on amd64 machine ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 0.0.0 x1 - - classic core18 20240920 2846 latest/stable canonical✓ base core20 20240911 2434 latest/stable canonical✓ base core22 20241119 1722 latest/stable canonical✓ base core24 20240920 609 latest/stable canonical✓ base juju 3.6.0 29130 3/stable canonical✓ - lxd 5.0.4-497fe1e 31333 5.0/stable/… canonical✓ - microk8s v1.29.11 7435 1.29-strict/stable canonical✓ - snapcraft 8.5.0 13008 latest/stable canonical✓ classic snapd 2.66.1 23258 latest/stable canonical✓ snapd ``` installed charmcraft is https://github.com/canonical/charmcraft/tree/9ff19c328e23b50cc06f04e8a5ad4835740badf4 plus ``` $ git diff diff --git a/charmcraft/dispatch.py b/charmcraft/dispatch.py index cd02457b..77df77d7 100644 --- a/charmcraft/dispatch.py +++ b/charmcraft/dispatch.py @@ -27,7 +27,7 @@ dispatch_path="$(dirname $(realpath $0))" venv_bin_path="${{dispatch_path}}/venv/bin" python_path="${{venv_bin_path}}/python" if [ ! -e "${{python_path}}" ]; then - mkdir -p "{{venv_bin_path}}" + mkdir -p "${{venv_bin_path}}" ln -s $(which python3) "${{python_path}}" fi diff --git a/requirements.txt b/requirements.txt index dc5b6a33..15b11368 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ craft-application==4.4.0 craft-archives==2.0.1 craft-cli==2.10.1 craft-grammar==2.0.1 -craft-parts==2.1.3 +craft-parts==2.1.4 craft-platforms==0.4.0 craft-providers==2.0.4 craft-store==3.0.2 ``` on arm64 machine where charm built (same git diff to charmcraft as above) ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 3.2.2.post82+g9ff19c32 x1 - - classic core20 20240911 2437 latest/stable canonical✓ base core22 20241119 1720 latest/stable canonical✓ base core24 20240920 612 latest/stable canonical✓ base juju 3.6.0 29131 3/stable canonical✓ - lxd 5.21.2-084c8c8 31216 5.21/stable/… canonical✓ - microk8s v1.29.11 7437 1.29-strict/stable canonical✓ - snapcraft 8.5.0 13016 latest/stable canonical✓ classic snapd 2.66.1 23259 latest/stable canonical✓ snapd ``` on arm64 machine where charm deployed ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 3.2.2 5306 latest/stable canonical✓ classic core20 20240911 2437 latest/stable canonical✓ base core22 20241119 1720 latest/stable canonical✓ base core24 20240920 612 latest/stable canonical✓ base juju 3.6.0 29131 3/stable canonical✓ - lxd 5.0.4-497fe1e 31335 5.0/stable/… canonical✓ - microk8s v1.29.11 7437 1.29-strict/stable canonical✓ - snapd 2.66.1 23259 latest/stable canonical✓ snapd ``` ### charmcraft.yaml ```yaml # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. type: charm base: ubuntu@22.04 platforms: arm64: # Files implicitly created by charmcraft without a part: # - dispatch (https://github.com/canonical/charmcraft/pull/1898) # - manifest.yaml # (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L259) # Files implicitly copied/"primed" by charmcraft without a part: # - actions.yaml, config.yaml, metadata.yaml # (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L290-L293 # https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L156-L157) parts: # "poetry-deps" part name is a magic constant # https://github.com/canonical/craft-parts/pull/901 poetry-deps: plugin: nil build-packages: - curl override-build: | python3 -m pip install --upgrade pip==24.3.1 curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 ln -sf $HOME/.local/bin/poetry /usr/local/bin/poetry # "charm-poetry" part name is arbitrary; use for consistency # Avoid using "charm" part name since that has special meaning to charmcraft charm-poetry: # By default, the `poetry` plugin creates/primes these directories: # - lib, src # (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/parts/plugins/_poetry.py#L76-L78) # - venv # (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/parts/plugins/_poetry.py#L95 # https://github.com/canonical/craft-parts/blob/afb0d652eb330b6aaad4f40fbd6e5357d358de47/craft_parts/plugins/base.py#L270) plugin: poetry source: . after: - poetry-deps poetry-with: - charm-libs build-snaps: - rustup build-packages: - libffi-dev - libssl-dev - pkg-config override-build: | rustup default stable craftctl default # "files" part name is arbitrary; use for consistency files: plugin: dump source: . build-packages: - git override-build: | # Workaround to add unique identifier (git hash) to charm version while specification # DA053 - Charm versioning # (https://docs.google.com/document/d/1Jv1jhWLl8ejK3iJn7Q3VbCIM9GIhp8926bgXpdtx-Sg/edit?pli=1) # is pending review. python3 -c 'import pathlib; import shutil; import subprocess; git_hash=subprocess.run(["git", "describe", "--always", "--dirty"], capture_output=True, check=True, encoding="utf-8").stdout; file = pathlib.Path("charm_version"); shutil.copy(file, pathlib.Path("charm_version.backup")); version = file.read_text().strip(); file.write_text(f"{version}+{git_hash}")' craftctl default prime: - LICENSE - charm_version - workload_version - scripts - templates ``` ### Relevant log output ```shell Normal Pulling 43s (x3 over 85s) kubelet Pulling image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054" Warning Failed 42s (x3 over 83s) kubelet Failed to pull image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": rpc error: code = NotFound desc = failed to pull and unpack image "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": failed to resolve reference "registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054": registry.jujucharms.com/charm/g78qli3013qicvevb3oj4z8u0zhjod1agws2d/mysql-router-image@sha256:458dbc8d0759136a57882a28d83e90132c109f9ca3fb75761ce593d8217b6054: not found Warning Failed 42s (x3 over 83s) kubelet Error: ErrImagePull ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed in canonical/charmcraft#2037 (commit e84fd122): Skopeo now copies multi-architecture OCI resources with --all, preserving every architecture for deployment.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #2037 (commit e84fd122): Charmcraft now passes Skopeo’s all-images option, preserving amd64 and arm64 layers in uploaded multi-arch OCI resources.
stealth/space-bunny-alpha — closed resolved Multi-arch OCI resource uploads were fixed in canonical/charmcraft#2037 (commit e84fd122) by passing Skopeo --all so both amd64 and arm64 images reach Charmhub.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/charmcraft#2037 (e84fd122): Charmcraft now passes Skopeo --all when uploading OCI resources, preserving every architecture so deployed charms can pull the correct image.
stealth/space-bunny-alpha — closed resolved Fixed in charmcraft PR #2037 (commit e84fd122), which made Skopeo copy multi-architecture OCI images with --all so both amd64 and arm64 layers reach Charmhub.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The issue was abandoned and moved to internal tracking via Jira ticket CRAFT-3804. The reporter suspected docker versus skopeo handling issues in charmcraft 3, but no fix was provided.
qwen/qwen3.6-35b-a3b — — Closed without a public fix. Tracked internally as CRAFT-3804. The reporter confirmed the issue persists across charmcraft 3.x and suggested docker, not skopeo, may be causing the multi-arch OCI upload failure.
qwen/qwen3.6-35b-a3b — — Closed and deferred to internal ticket CRAFT-3804. The reporter confirmed the multi-arch OCI upload failure persists in charmcraft 3.2/stable, likely due to docker versus skopeo handling. No fix was applied.
qwen3.6-35b-a3b-mtp-q6 — — Closed without a public fix. Internal ticket CRAFT-3804 created to track multi-arch OCI upload failures on Juju. Reporter suspected docker vs skopeo issues. Issue remains abandoned or pending internal resolution.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#2037 (confidence 100%)

    PR #2037, merged as commit e84fd122, updates image copying to preserve all OCI architectures.

Related issues

Issue Project State Summary Similarity
#1685 Multi-arch OCI image incorrectly uploaded to Charmhub registry charmcraft closed Fixed multi-architecture resource uploads in Charmcraft 2.7 by PR #1462 (commit 566103b8), ensuring complete OCI images reach Charmhub.
78%