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

Method registry.list_repository_tags throws JSONDecodeError due to extra data #173

Closed
chillidoor opened this issue Jun 6, 2023 · 4 comments

Comments

@chillidoor
Copy link

Python version: 3.7.16
pydo version: 0.1.4

How to replicate the issue:

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

client.registry.list_repository_tags(registry_name="example-registry", repository_name="example-repository")

Example stacktrace:

Traceback (most recent call last):
  File "registry-cleaner.py", line 13, in <module>
    print(client.registry.list_repository_tags(registry_name="example-registry", repository_name="example-repository"))
  File "/home/scripts/.local/lib/python3.7/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "/home/scripts/.local/lib/python3.7/site-packages/pydo/operations/_operations.py", line 96186, in list_repository_tags
    deserialized = response.json()
  File "/home/scripts/.local/lib/python3.7/site-packages/azure/core/rest/_http_response_impl.py", line 310, in json
    self._json = loads(self.text())
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)
@mikeberezowski
Copy link

Thanks for filing this issue. We will investigate this on our side to confirm.

@chillidoor
Copy link
Author

@mikeberezowski thanks. If it helps, here's the list of pydo dependencies that were installed:

azure-core==1.27.0
azure-identity==1.13.0
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
cryptography==41.0.1
idna==3.4
isodate==0.6.1
msal==1.22.0
msal-extensions==1.0.0
msrest==0.7.1
oauthlib==3.2.2
portalocker==2.7.0
pycparser==2.21
PyJWT==2.7.0
requests==2.31.0
requests-oauthlib==1.3.1
six==1.16.0
typing_extensions==4.6.3
urllib3==2.0.2

danaelhe added a commit to digitalocean/openapi that referenced this issue Jun 12, 2023
We had a Pydo user [open a github issue](digitalocean/pydo#173) regarding the [list registry repository tags endpoint](https://docs.digitalocean.com/reference/api/api-reference/#operation/registry_list_repositoryTags). 

Turns out the client wasn't working because we were documenting the wrong endpoint path for the container registry endpoints, resulting in a "Not Found" 404 error.
danaelhe added a commit to digitalocean/openapi that referenced this issue Jun 12, 2023
We had a Pydo user [open a github issue](digitalocean/pydo#173) regarding the [list registry repository tags endpoint](https://docs.digitalocean.com/reference/api/api-reference/#operation/registry_list_repositoryTags). 

Turns out the client wasn't working because we were documenting the wrong endpoint path for the container registry endpoints, resulting in a "Not Found" 404 error.
@danaelhe
Copy link
Member

Thanks for bringing this to our attention. I have created a PR for this fix in #174

Once this is merged, we will cut a new release and close this issue. Thanks again!

@danaelhe
Copy link
Member

A new release has been cut with the fix. Thank you for bringing this to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants