← 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

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Superseded by charmcraft 1.1.1, which changes OCI image uploads to use local digests. The issue was closed as the upcoming release resolves the parsing behavior. Documentation updates were suggested for clarity.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1051 Fix digest check for uploading OCI resource charmcraft closed Closed after fixing the OCI image upload digest check in charmcraft. The validation logic was corrected to check for @ instead of :, resolving failures when uploading tagged images.
80%
#1953 Charmcraft 3 should still accept image digests for `upload-resource` charmcraft open Charmcraft 3 `upload-resource` rejects bare image digests (e.g. sha256:…) that charmcraft 2 accepted; the ImageService lacks a digest-based lookup via RepoDigests. Unlabeled, no maintainer response, only a bot Jira-sync comment.
72%
#871 Support both image id and digest when uploading oci-image resources (CRAFT-1324). charmcraft merged Merged implementation supporting both image ID and digest for OCI image uploads. ID usage bypasses remote registry checks for faster processing, while improved messaging handles missing images gracefully. Resolves #853.
72%
#906 `charmcraft upload-resource` 2.1.0 removes ability to pass tagged image names to `--image` argument charmcraft closed Closed as solved. Affected teams migrated CI to use image digests instead of tags. Rather than reverting the change, PR #912 was created to improve error messaging when tagged image names are provided.
70%