WARNING Recovering from connection error [('Connection aborted.', ResponseNotReady())], attemps 0 of 500

WARNING Recovering from connection error [(‘Connection aborted.’, ResponseNotReady())], attemps 0 of 500

I have an API retrieve call to ERA5 that gives me the following message more then half the time and works some of the time:


2020-10-12 14:39:14,978 WARNING Recovering from connection error [('Connection aborted.', ResponseNotReady())], attemps 0 of 500

2020-10-12 14:39:14,979 WARNING Retrying in 120 seconds


IS there a way to minimize the likelihood of this error arriving.


My code is:

import cdsapi

ct = cdsapi.Client()

variable=['10m_u_component_of_wind', '10m_v_component_of_wind']

year=[
    '1979', '1980', '1981',
    '1982', '1983', '1984',
    '1985', '1986', '1987',
    '1988', '1989', '1990',
    '1991', '1992', '1993',
    '1994', '1995', '1996',
    '1997', '1998', '1999',
    '2000', '2001', '2002',
    '2003', '2004', '2005',
    '2006', '2007', '2008',
    '2009', '2010', '2011',
    '2012', '2013', '2014',
    '2015', '2016', '2017',
    '2018', '2019', '2020'
]
dataset = 'reanalysis-era5-single-levels-monthly-means'
kwargs = {
        'variable': variable,
        'product_type': 'monthly_averaged_reanalysis',
        'year': year,
        'month': [
            '01', '02', '03',
            '04', '05', '06',
            '07', '08', '09',
            '10', '11', '12',
        ],
        'time': '00:00',
        'area': limits,
        'format': 'netcdf',
        }

data = ct.retrieve(dataset, kwargs, file_to_download)