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

classretry now retries auth failure #156

Closed
xarses opened this issue Sep 16, 2024 · 2 comments
Closed

classretry now retries auth failure #156

xarses opened this issue Sep 16, 2024 · 2 comments

Comments

@xarses
Copy link
Contributor

xarses commented Sep 16, 2024

Introduced in #155, By moving from sys.exit(...) to raise(...) I now see that auth failures are now retried by the classretry decorator

I'm partial to implementing a custom Exception and using that to short circuit the retry decorators thoughts?

Currently:

[2024-09-15T11:42:55.778-0700] {logger.py:246} INFO - Retrying in 3 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:42:59.083-0700] {logger.py:246} INFO - Retrying in 5 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:04.566-0700] {logger.py:246} INFO - Retrying in 11 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:16.477-0700] {logger.py:246} INFO - Retrying in 29 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:46.062-0700] {logger.py:246} INFO - Retrying in 83 seconds - error: Cannot respond to request for authentication.
ERR: Failure fetching config: docker.io/ymuski/curl-http3:latest

After adding an explicit raise to the retry decorator

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/Users/andrew.woodward/git/system/container.py", line 80, in update_images
    item.get_config()
  File "/Users/andrew.woodward/git/system/models/container.py", line 61, in get_config
    i for i in get_container_details(self.key) if i.get("architecture")
  File "/Users/andrew.woodward/git/system/libs/container/registry.py", line 132, in get_container_details
    data = client.get_manifest(container)
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 36, in __call__
    return self.func(cls, *args, **kwargs)
  File "/Users/andrew.woodward/git/system/libs/container/registry.py", line 48, in get_manifest
    response = self.do_request(uri, "GET")
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 57, in __call__
    raise e
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 55, in __call__
    return self.func(cls, *args, **kwargs)
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/provider.py", line 985, in do_request
    raise oras.auth.AuthenticationException(
oras.auth.AuthenticationException: Cannot respond to request for authentication.
@vsoch
Copy link
Contributor

vsoch commented Sep 16, 2024

That would work - could you please open a PR? I didn't do a release for that change so we should be able to still tweak and not be worried it went into a release.

@xarses
Copy link
Contributor Author

xarses commented Sep 18, 2024

resolved in #158

@xarses xarses closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants