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

ClientConnectorError: Cannot connect to host storage.googleapis.com:443 ssl:default #328

Open
ShmilyzqChen opened this issue Oct 12, 2023 · 2 comments

Comments

@ShmilyzqChen
Copy link

Hi all,

I have encountered a connection error in downloading the llc4320 data since June this year. Could someone help me to solve this?

My script can work normally before June, but breaks down since the error "ClientConnectorError: Cannot connect to host storage.googleapis.com:443 ssl:default" existed.

It seems this error is connected with module "aiohttp", but I reinstalled this module, and it still not works.
My network is normal and has a speed of more than 120MB/s. The python version is Python 3.8. The aiohttp version is 3.8.6.

Partial of my scripts are as follows:
**
from xmitgcm import llcreader
from retry import retry
import numpy as np

import xarray as xr

import datetime as dt
import scipy.io as scio
from dateutil.relativedelta import relativedelta
import os
import netCDF4 as nc

@retry(delay=1)
def read_data(model,face,varstr,kdep,kt):
    print(dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + \
          ' try to read data')
    ds = model.get_dataset(
        varnames = [varstr], type = 'faces',k_levels = [kdep])
    region_slice = {'i_g': slice(0, 4320), 'j': slice(0, 4320),
                    'i': slice(0, 4320), 'j_g': slice(0, 4320),
                    'face':slice(face-1,face),'time': slice(kt,kt+24)}
    region = ds.isel(**region_slice)
    varval = np.mean(region[varstr],axis=0).values
    varval = np.squeeze(varval,0)
    return varval

model = llcreader.ECCOPortalLLC4320Model()

varis = ['Theta','Salt','U','V','W']
kdeps = range(0,90)
face = 6
**

The reported error are :

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "H:\pyget_llc4320\MITgcm-oneface-onedepth.py", line 88, in
model = llcreader.ECCOPortalLLC4320Model()

File "C:\Anaconda\lib\site-packages\xmitgcm\llcreader\known_models.py", line 212, in init
super(ECCOPortalLLC4320Model, self).init(store)

File "C:\Anaconda\lib\site-packages\xmitgcm\llcreader\llcmodel.py", line 613, in init
self.masks = self._get_masks()

File "C:\Anaconda\lib\site-packages\xmitgcm\llcreader\llcmodel.py", line 623, in _get_masks
zgroup = self.store.open_mask_group()

File "C:\Anaconda\lib\site-packages\xmitgcm\llcreader\stores.py", line 115, in open_mask_group
zgroup = zarr.open_consolidated(mapper)

File "C:\Anaconda\lib\site-packages\zarr\convenience.py", line 1304, in open_consolidated
meta_store = ConsolidatedStoreClass(store, metadata_key=metadata_key)

File "C:\Anaconda\lib\site-packages\zarr\storage.py", line 2853, in init
meta = json_loads(self.store[metadata_key])

File "C:\Anaconda\lib\site-packages\zarr\storage.py", line 717, in getitem
return self._mutable_mapping[key]

File "C:\Anaconda\lib\site-packages\fsspec\mapping.py", line 132, in getitem
result = self.fs.cat(k)

File "C:\Anaconda\lib\site-packages\fsspec\asyn.py", line 227, in cat
raise ex

File "C:\Anaconda\lib\site-packages\fsspec\implementations\http.py", line 152, in _cat_file
async with self.session.get(url, **kw) as r:

File "C:\Anaconda\lib\site-packages\aiohttp\client.py", line 1167, in aenter
self._resp = await self._coro

File "C:\Anaconda\lib\site-packages\aiohttp\client.py", line 562, in _request
conn = await self._connector.connect(

File "C:\Anaconda\lib\site-packages\aiohttp\connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)

File "C:\Anaconda\lib\site-packages\aiohttp\connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)

File "C:\Anaconda\lib\site-packages\aiohttp\connector.py", line 1209, in _create_direct_connection
raise last_exc

File "C:\Anaconda\lib\site-packages\aiohttp\connector.py", line 1178, in _create_direct_connection
transp, proto = await self._wrap_create_connection(

File "C:\Anaconda\lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc

ClientConnectorError: Cannot connect to host storage.googleapis.com:443 ssl:default
"

@Timtthy
Copy link

Timtthy commented Nov 28, 2023

Hello, Have you solved the problem?

@ShmilyzqChen
Copy link
Author

ShmilyzqChen commented Nov 28, 2023 via email

@ShmilyzqChen ShmilyzqChen reopened this Nov 28, 2023
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