Multi-arch OCI image incorrectly uploaded to Charmhub registry
Metadata
Current evaluation
Fixed in Charmcraft 2.7. The upload-resource command now correctly pushes full multi-arch OCI images to Charmhub instead of only the host architecture layer. Future versions may require explicit local Docker daemon paths.
Suggested action: —
No scores available.
Issue body
### Bug Description
`charmcraft upload-resource` with a multi-arch image (e.g. https://github.com/canonical/charmed-postgresql-rock/pkgs/container/charmed-postgresql/208426154?tag=14.11-22.04_edge) uploads the amd64 image (if running charmcraft on amd64 machine) to the Charmhub registry
Context:
https://warthogs.atlassian.net/browse/DPE-4280
https://matrix.to/#/!LhFxJIPEcCacgdMghH:ubuntu.com/$JMmA26BWFkqAKsCJ0tfAx4fpVOSndhej3-CYHwHyBpc?via=ubuntu.com&via=matrix.org
### To Reproduce
1. Release charm with multi-arch image using charmcraft on amd64 machine (using upload-resource with `ghcr.io/canonical/charmed-postgresql:14.11-22.04_edge@sha256:31cf150b4523481202c1ff9b7b5d7f0b36729edad89d61242d8f1eb56b2912c0`)
2. `juju deploy` charm on arm64 machine
3. Inspect juju debug-log
```
ops.pebble.ChangeError: cannot perform the following tasks:
- Start service "postgresql" (cannot start service: fork/exec /usr/bin/patroni: exec format error)
```
Note: if `juju deploy ./postgresql-k8s.charm --resource postgresql-image=ghcr.io/canonical/charmed-postgresql:14.11-22.04_edge@sha256:31cf150b4523481202c1ff9b7b5d7f0b36729edad89d61242d8f1eb56b2912c0` is used on amd64 or arm64, the charm deploys correctly
### Environment
Ubuntu 22.04 amd64
### charmcraft.yaml
```shell
type: "charm"
bases:
- name: ubuntu
channel: "22.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [arm64]
parts:
charm:
override-pull: |
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
build-packages:
- libffi-dev
- libssl-dev
- rustc
- cargo
- pkg-config
- libpq-dev
charm-strict-dependencies: true
libpq:
build-packages:
- libpq-dev
plugin: dump
source: /usr/lib/
source-type: local
prime:
- lib/
organize:
"*-linux-gnu/libpq.so*": lib/
```
### Relevant log output
```shell
ops.pebble.ChangeError: cannot perform the following tasks:
- Start service "postgresql" (cannot start service: fork/exec /usr/bin/patroni: exec format error)
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in Charmcraft 2.7. The upload-resource command now correctly pushes full multi-arch OCI images to Charmhub instead of only the host architecture layer. Future versions may require explicit local Docker daemon paths. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in charmcraft 2.7. upload-resource now correctly pushes multi-arch OCI images instead of defaulting to the host architecture. Maintainers noted future versions may require explicit local daemon references. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 2.7. The upload-resource command now correctly handles multi-arch OCI images instead of defaulting to amd64. Maintainers noted potential future deprecation of local image uploads in Charmcraft 4. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 2.7. upload-resource now correctly pushes multi-arch OCI images instead of only the host variant. Maintainers may require explicit docker-daemon: paths in Charmcraft 4. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in Charmcraft 2.7. The upload-resource command now correctly uploads multi-arch OCI images instead of defaulting to the host architecture. Local upload deprecation remains under consideration for a future major release. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in Charmcraft 2.7. Multi-arch OCI images were incorrectly uploaded to Charmhub, causing architecture mismatch errors. The bug was resolved and confirmed by the reporter. Future versions may require explicit local image references. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2020 Unable to deploy charm using multi-arch OCI uploaded with charmcraft 3 | charmcraft | closed | 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. | |
| #2428 docs: dedicated doc for uploading of OCI images | charmcraft | open | Request for a dedicated doc on uploading OCI images as charm resources, plus two reported gaps: skopeo digest method failing with 'Unknown OCI image reference' and multi-arch images listing only amd64. Triaged; maintainer suggested a 'rock as resource' doc; reporter noted --help text conflicts with docs. |