← Back to issue list

unable to upload oci-image resource from dockerhub using image digest

View original Github issue

Metadata

Project
charmcraft
Number
#444
Type
issue
State
closed
Author
baycarbone
Labels
—
Created
Updated
Closed

Current evaluation

Closed by maintainer facundobatista as superseded: charmcraft 1.1.1 (in candidate at the time) reworked OCI uploads to push images from the local machine and always reference them by digest, so the reported remote-digest limitation no longer applied.

Resolution: closed superseded

Reason: facundobatista closed it on 2021-07-12, noting charmcraft 1.1.1 changed OCI resource uploads to come from the user's local machine and always use the digest reference, documented at juju.is/docs/sdk/publishing-resources. The reporter confirmed he was unblocked, attributing the confusion to docs matching1.1.1 ahead of stable.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Trying to upload an oci-image resource from dockerhub to charmhub for my charm fails if I specify the image digest but is working when giving the image name and tag. ![image](https://user-images.githubusercontent.com/78857322/125141006-19993a80-e114-11eb-834e-285650b54801.png) Failing with image digest: ``` $ charmcraft upload-resource --image=sha256:ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d rancher-integrator rancher-integrator-image The 'ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d' image does not exist in the destination registry (full execution logs in /home/ubuntu/snap/charmcraft/common/charmcraft-log-v3zhisoq) 1 ubuntu@node07:~/charm-rancher-integrator$ cat /home/ubuntu/snap/charmcraft/common/charmcraft-log-v3zhisoq 2021-07-09 22:13:40,472 charmcraft.guard DEBUG Starting charmcraft version 1.0.0 2021-07-09 22:13:40,472 charmcraft.main DEBUG Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'project_dir': None} filtered=['upload-resource', '--image=sha256:ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d', 'rancher-integrator', 'rancher-integrator-image'] 2021-07-09 22:13:40,472 charmcraft.commands DEBUG Couldn't find config file /home/ubuntu/charm-rancher-integrator/charmcraft.yaml 2021-07-09 22:13:40,473 charmcraft.main DEBUG General parsed sysargs: command='upload-resource' args=['--image=sha256:ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d', 'rancher-integrator', 'rancher-integrator-image'] 2021-07-09 22:13:40,474 charmcraft.main DEBUG Command parsed sysargs: Namespace(charm_name='rancher-integrator', filepath=None, image=OCIImageSpec(organization='library', name='sha256', reference='ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d'), resource_name='rancher-integrator-image') 2021-07-09 22:13:40,474 charmcraft.commands.store DEBUG Uploading resource from image OCIImageSpec(organization='library', name='sha256', reference='ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d') at Dockerhub 2021-07-09 22:13:40,474 charmcraft.commands.store.registry DEBUG Checking if manifest is already uploaded 2021-07-09 22:13:40,474 charmcraft.commands.store.registry DEBUG Hitting the registry: HEAD https://registry.hub.docker.com/v2/library/sha256/manifests/ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d 2021-07-09 22:13:40,918 charmcraft.commands.store.registry DEBUG Authenticating! {'realm': 'https://auth.docker.io/token', 'service': 'registry.docker.io', 'scope': 'repository:library/sha256:pull'} 2021-07-09 22:13:41,736 charmcraft.commands.store.registry DEBUG Bad response when checking for uploaded 'https://registry.hub.docker.com/v2/library/sha256/manifests/ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d': 401 (headers={'content-type': 'application/json', 'docker-distribution-api-version': 'registry/2.0', 'www-authenticate': 'Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:library/sha256:pull",error="insufficient_scope"', 'date': 'Fri, 09 Jul 2021 22:13:41 GMT', 'content-length': '157', 'strict-transport-security': 'max-age=31536000'}) 2021-07-09 22:13:41,737 charmcraft ERROR The 'ec7a755e6313da2f7db02d8e82f6b0813b176f06c5622174c8ab45feefc8096d' image does not exist in the destination registry (full execution logs in /home/ubuntu/snap/charmcraft/common/charmcraft-log-v3zhisoq) ``` Working with image name: ``` $ charmcraft upload-resource --image=python:slim-buster rancher-integrator rancher-integrator-image Revision 2 created of resource 'rancher-integrator-image' for charm 'rancher-integrator' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed by maintainer facundobatista as superseded: charmcraft 1.1.1 (in candidate at the time) reworked OCI uploads to push images from the local machine and always reference them by digest, so the reported remote-digest limitation no longer applied.
stealth/space-bunny-alpha — closed superseded Closed as superseded by Charmcraft 1.1.1, which changed OCI uploads to use images from the local machine and always reference them by digest.
qwen3.6-35b-a3b-mtp-q6 — — Superseded by charmcraft 1.1.1, which replaces remote digest uploads with local image uploads using digests. Closed as the upcoming release resolves the parsing limitation.
qwen/qwen3.6-35b-a3b — — Closed. The digest upload failure is resolved in charmcraft 1.1.1, which shifts to local image uploads using digests by default. Author confirmed not blocked and suggested documentation updates.
qwen/qwen3.6-35b-a3b — — Superseded by charmcraft 1.1.1, which shifts OCI image uploads to use local digests. The reported parsing failure is obsolete. Issue closed as superseded.
qwen3.6-35b-a3b-mtp-q6 — — Superseded by charmcraft 1.1.1, which replaces remote digest lookups with local image uploads. The reported parsing failure is resolved in the upcoming stable release. Closed as the new workflow addresses the limitation.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/charmcraft#871 (confidence 60%)

    Later merged PR adding explicit image ID and digest support for upload-resource (CRAFT-1324), resolving #853; addresses the same digest-vs-id handling area but for local images.

Related issues

Issue Project State Summary Similarity
#1953 Charmcraft 3 should still accept image digests for `upload-resource` charmcraft open Maintainer-filed Charmcraft 3 bug remains open: upload-resource still rejects bare OCI digests because Docker lookup returns only image IDs; no resolving change is present.
77%
#871 Support both image id and digest when uploading oci-image resources (CRAFT-1324). charmcraft merged Merged in canonical/charmcraft#871 via commit cefabea2, adding OCI image ID and digest support, faster local-ID handling, clearer missing-image errors, and resolution of #853.
76%
#350 Can't upload oci-image resources from any registry but Docker Hub charmcraft closed Registry restriction was lifted in Charmcraft 1.1 by PR #391 (commit bf2d2c5e), allowing upload-resource to use local images or images from any registry.
73%
#1051 Fix digest check for uploading OCI resource charmcraft closed PR #1051 proposed correcting OCI digest detection from ':' to '@', but was closed unmerged after 1,291 days without review, CI runs, or a documented resolution.
70%
#853 The upload-resource command should accept images id or digests charmcraft closed Merged PR #871 resolved support for OCI image IDs and digests in upload-resource, improving local ID handling and missing-image errors.
70%