Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: invalid checksum digest format. #178

Open
hector-medina-nubosas opened this issue Jun 15, 2023 · 2 comments
Open

Error: invalid checksum digest format. #178

hector-medina-nubosas opened this issue Jun 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@hector-medina-nubosas
Copy link

hector-medina-nubosas commented Jun 15, 2023

Hello community!

I'm using PyDO for cleaning a Container Registry in DigitalOcean so we fit under our plan without spending extra credits.

When trying to delete an image from its manifest with the delete_repository_manifest() method, I'm getting the following error:

Traceback (most recent call last):
File "/...../pydo/do.py", line 36, in
client.registry.delete_repository_manifest(registry, repositories[0],response['manifests'][0]['digest'])
File "/...../pydo/venv/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/...../pydo/venv/lib/python3.11/site-packages/pydo/operations/_operations.py", line 112200, in delete_repository_manifest
raise HttpResponseError(response=response)
azure.core.exceptions.HttpResponseError: (None) invalid digest: invalid checksum digest format
Code: None
Message: invalid digest: invalid checksum digest format

I have checked the digest hash value and it's the same I'm trying to delete. According to the API docs:

The manifest digest of a container registry repository tag.
https://docs.digitalocean.com/reference/api/api-reference/#operation/registry_delete_repositoryManifest

This is the first time for me to use this library, so I might be doing something wrong too.

Thanks in advance.


Update:

As an update, I have tried to use the DigitalOcean HTTP API itself to delete the resource. I could delete it without any problem with the API. I have used the same parameters I'm sending to the delete_repository_manifest(), so it's definitely a bug.

@danaelhe
Copy link
Member

Hi there,

Thanks for the write up- we will investigate further on our end and give an update here when we can.

@danaelhe
Copy link
Member

After investigating further, we have found that when calling:
client.registry.delete_repository_manifest(registry_name="cgtest-12345", repository_name="getting-started", manifest_digest="sha256:123456")

the : in the manifest_digest arg is being url escaped to %3A: sha256%3A123456

Currently, the API endpoint does not support URL Encoding. We believe it should. We have created a ticket for our internal Container Registry Development team to add this support. We will close this issue once that support is added.

Thank you so much for bringing this to our attention.

@danaelhe danaelhe added the bug Something isn't working label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants