Hello,
Asking for help to fix this issue. Thank you in advance!
I have re-installed API client, updated .cdsapirc (url: https://cds.climate.copernicus.eu/api)
below is my request (python):
import cdsapi
import numpy as np
year = [2006] #np.arange(2004,2017)
for year in year:
for ltime in np.arange(12, 2881, 12):
dataset = "seasonal-original-pressure-levels"
request = {
"originating_centre": "ecmwf",
"system": "51",
"variable": ["u_component_of_wind"],
"pressure_level": [
"10", "30", "50",
"100", "200", "300",
"400", "500", "700",
"850", "925", "1000"
],
"year": [str(year)],
"month": ["11"],
"day": ["01"],
"leadtime_hour": [str(ltime)],
"data_format": "netcdf"
}
target = f"./ecmwf/u/ecmwf_1101_u_{year}_{ltime:04}.nc"
client = cdsapi.Client()
client.retrieve(dataset, request, target)
then I get the error below:
/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/api_client.py:83: UserWarning: HTTPSConnectionPool(host=‘cds.climate.copernicus.eu’, port=443): Max retries exceeded with url: /api/catalogue/v1/messages (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)’)))
warnings.warn(str(exc), UserWarning)
Traceback (most recent call last):
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 386, in _make_request
self._validate_conn(conn)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 1042, in validate_conn
conn.connect()
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/connection.py”, line 414, in connect
self.sock = ssl_wrap_socket(
File "/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/util/ssl.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/util/ssl.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/ssl.py”, line 501, in wrap_socket
return self.sslsocket_class._create(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/ssl.py”, line 1041, in _create
self.do_handshake()
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/ssl.py”, line 1310, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/requests/adapters.py”, line 489, in send
resp = conn.urlopen(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 787, in urlopen
retries = retries.increment(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/urllib3/util/retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘cds.climate.copernicus.eu’, port=443): Max retries exceeded with url: /api/retrieve/v1/processes/seasonal-original-pressure-levels (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)’)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/gkim/cdi_test.py”, line 31, in
client.retrieve(dataset, request, target)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/legacy_api_client.py”, line 169, in retrieve
submitted = self.client.submit_and_wait_on_results(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/api_client.py”, line 413, in submit_and_wait_on_results
return self._retrieve_api.submit(collection_id, request).make_results()
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/processing.py”, line 727, in submit
return self.get_process(collection_id).submit(request)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/processing.py”, line 716, in get_process
return Process.from_request(“get”, url, **self._request_kwargs)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/datapi/processing.py”, line 172, in from_request
response = robust_request(
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/multiurl/http.py”, line 479, in wrapped
r = call(main_url, *args, **kwargs)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/requests/sessions.py”, line 587, in request
resp = self.send(prep, **send_kwargs)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/requests/sessions.py”, line 701, in send
r = adapter.send(request, **kwargs)
File “/home/gkim/miniconda3/envs/glab/lib/python3.9/site-packages/requests/adapters.py”, line 563, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘cds.climate.copernicus.eu’, port=443): Max retries exceeded with url: /api/retrieve/v1/processes/seasonal-original-pressure-levels (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)’)))