EGA-archive/ega-download-client

[Errno 111] Connection refused - Docker

Closed this issue · 1 comments

[Errno 111] Connection refused - Docker

Error when downloading EGA datasets and testing pyEGA3 installation using Docker

I used the following command to test pyEGA3 installation before downloading files from authorized EGA dataset:
docker run --rm -v $PWD:/task/config/ -w /app quay.io/biocontainers/pyega3:3.4.0--py_0 pyega3 -d -t datasets

And got this error:

[2023-05-12 09:42:44 +0000] 
[2023-05-12 09:42:44 +0000] pyEGA3 - EGA python client version 3.4.0 (https://github.com/EGA-archive/ega-download-client)
[2023-05-12 09:42:44 +0000] Parts of this software are derived from pyEGA (https://github.com/blachlylab/pyega) by James Blachly
[2023-05-12 09:42:44 +0000] Python version : 3.9.0
[2023-05-12 09:42:44 +0000] OS version : Linux #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023
[2023-05-12 09:42:44 +0000] Server URL: https://ega.ebi.ac.uk:8052/elixir/data
[2023-05-12 09:42:44 +0000] Session-Id: 3468122609
[2023-05-12 09:42:44 +0000] Starting new HTTPS connection (1): ega.ebi.ac.uk:8443
[2023-05-12 09:42:45 +0000] https://ega.ebi.ac.uk:8443 "POST /ega-openid-connect-server/token HTTP/1.1" 200 None
[2023-05-12 09:42:45 +0000] 
[2023-05-12 09:42:45 +0000] Authentication success for user 'ega-test-data@ebi.ac.uk'
[2023-05-12 09:42:45 +0000] Starting new HTTPS connection (1): ega.ebi.ac.uk:8052
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 309, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f5951419070>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ega.ebi.ac.uk', port=8052): Max retries exceeded with url: /elixir/data/metadata/datasets (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5951419070>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pyega3", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/pyega3/pyega3.py", line 647, in main
    reply = api_list_authorized_datasets(token)
  File "/usr/local/lib/python3.9/site-packages/pyega3/pyega3.py", line 162, in api_list_authorized_datasets
    r = requests.get(url, headers=headers)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='ega.ebi.ac.uk', port=8052): Max retries exceeded with url: /elixir/data/metadata/datasets (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5951419070>: Failed to establish a new connection: [Errno 111] Connection refused'))

It seems that the ega.ebi.ac.uk server is not working.

Hi @bertagayete
Thanks for submitting this. The problem is with the pyega3 version. According to the log, you were using 3.4.0 which is using our old data api, however the old data api was retired in March (hence the connection was refused).
Please use the most recent version of the pyega3 client (5.0.2), as newer versions were configured to use our new data api endpoints.