#2267 copr-cli, unable to connect
Closed: Fixed 2 years ago by praiskup. Opened 2 years ago by szydell.

Hi,

copr version 1.101

copr-cli build and list-permissions finish with errors:

$ copr-cli list-permissions system76

Something went wrong:
Error: Unable to connect to https://copr.fedorainfracloud.org/api_3/.

This is how it looks with --debug:

$ copr-cli --debug list-permissions system76
#  Debug log enabled  #
[15:23:47] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 140030383009808 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:47] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 140030383009808 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:47] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 140030383009808 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:47] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 140030383009808 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:47] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:23:48] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/project/permissions/get/szydell/system76?ownername=szydell&projectname=system76 HTTP/1.1" 401 135
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 140030383006304 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 140030383006304 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 140030383006304 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 140030383006304 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:23:48] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/project/permissions/get/szydell/system76?ownername=szydell&projectname=system76 HTTP/1.1" 401 135
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 140030383008320 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 140030383008320 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 140030383008320 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 140030383008320 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:48] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:23:49] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/project/permissions/get/szydell/system76?ownername=szydell&projectname=system76 HTTP/1.1" 401 135
[15:23:49] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 140030383011440 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:49] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 140030383011440 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:49] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 140030383011440 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:23:49] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 140030383011440 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock

Something went wrong:
Error: Unable to connect to https://copr.fedorainfracloud.org/api_3/.

curl to the above location works fine:

$ curl "https://copr.fedorainfracloud.org/api_3/project/permissions/get/szydell/system76?ownername=szydell&projectname=system76"
{"error":"Login invalid/expired. Please visit https://copr.fedorainfracloud.org/api to get or renew your API token.","output":"notok"}

copr build:

$ copr-cli --debug build system76 .rpkg-build/system76-power-1.1.22-3.src.rpm
#  Debug log enabled  #
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 139659505446352 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 139659505446352 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 139659505446352 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 139659505446352 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:48:06] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 401 135
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 139659505442032 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 139659505442032 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 139659505442032 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 139659505442032 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:06] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:48:07] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 401 135
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 139659505443904 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 139659505443904 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 139659505443904 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 139659505443904 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1001} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[15:48:07] {/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:456} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 401 135
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:153} DEBUG - Attempting to acquire lock 139659505445056 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:157} DEBUG - Lock 139659505445056 acquired on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:187} DEBUG - Attempting to release lock 139659505445056 on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock
[15:48:07] {/usr/lib/python3.10/site-packages/filelock/_api.py:190} DEBUG - Lock 139659505445056 released on /home/szydell/.cache/copr/copr.fedorainfracloud.org-session.lock

Something went wrong:
Error: Unable to connect to https://copr.fedorainfracloud.org/api_3/.

Not all copr-cli commands return error (I haven't tested all). i.e. list-packages works just fine.
I believe issue is related to commands that require auth.

Please advice.


It seems that you just need to renew your API token:

{"error":"Login invalid/expired. Please visit https://copr.fedorainfracloud.org/api to get or renew your API token.","output":"notok"}

Thank you for the report.

Agreed with @gotmax23. Plus, there is a bug in the client version you are using
that swallows the error message. This should be fixed in the actual client.
Please update to:

copr-cli-1.102-1
python-copr-1.121-1

For more info see #2235, #2242 and #2256.

Metadata Update from @praiskup:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Log in to comment on this ticket.

Metadata