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

The client.package_proxy can become None when network fails? #2893

Closed
praiskup opened this issue Aug 31, 2023 · 3 comments
Closed

The client.package_proxy can become None when network fails? #2893

praiskup opened this issue Aug 31, 2023 · 3 comments
Labels

Comments

@praiskup
Copy link
Member

Packit is using this hack.

@lachmanfrantisek is this still an issue in python-copr, or just a leftover in wait-for-copr?

@FrostyX
Copy link
Member

FrostyX commented Sep 3, 2023

I tried --max-tries 1000 and it didn't trigger the if not copr_package_proxy: condition.

python wait_for_copr/__init__.py python-copr 100.130-2 --owner @copr --project copr --interval 0 --max-tries 1000

I also tried disconnecting from my WIFI while running the command, it raised a traceback rather than triggering the condition.

Traceback (most recent call last):
  File "/home/jkadlcik/git/wait-for-copr/wait_for_copr/__init__.py", line 87, in <module>
    wait_for_copr()
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jkadlcik/git/wait-for-copr/wait_for_copr/__init__.py", line 66, in wait_for_copr
    built_version = copr_package_proxy.get(
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/copr/v3/helpers.py", line 73, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/copr/v3/proxies/package.py", line 34, in get
    response = self.request.send(endpoint=endpoint, params=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/copr/v3/requests.py", line 44, in send
    response = self._send_request_repeatedly(request_params, auth)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/copr/v3/requests.py", line 67, in _send_request_repeatedly
    raise CoprRequestException("Unable to connect to {0}.".format(self.api_base_url))
copr.v3.exceptions.CoprRequestException: Unable to connect to https://copr.fedorainfracloud.org/api_3/.

@lachmanfrantisek
Copy link
Contributor

Jirka Kyjovsky has hit this a few times when running in Copr. Locally, I wasn't able to reproduce this.

@praiskup
Copy link
Member Author

praiskup commented Sep 7, 2023

Closing in favor of #2819 which is older.

@praiskup praiskup closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants