# ERA5 requests fail intermittently

**URL:** <https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952>\
**Category:** API\
**Tags:** api, c3s, era5\
**Created:** [19 April 2022 04:55 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952 "2022-04-19T04:55:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zheng\_Liu](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/z/919ad9/32.png) [@Zheng\_Liu](https://forum.ecmwf.int/u/Zheng_Liu)\
**Post date:** [19 April 2022 04:55 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/1 "2022-04-19T04:55:51Z")

</div>

Hi,

I have been using my download script for ERA5 reanalysis before the recent weekend but am having some trouble now.

I am downloading a couple of surface variables:&nbsp;  
 &nbsp; &nbsp; '10m\_u\_component\_of\_wind', '10m\_v\_component\_of\_wind',&nbsp; &nbsp; '2m\_dewpoint\_temperature', '2m\_temperature',&nbsp; &nbsp; 'mean\_sea\_level\_pressure', &nbsp; &nbsp; 'surface\_latent\_heat\_flux', 'surface\_sensible\_heat\_flux',&nbsp; &nbsp; 'surface\_net\_solar\_radiation','surface\_net\_thermal\_radiation' .&nbsp;

The messages show the request failed but if I rerun the request it will succeed after one or two tries until it breaks down again after downloading 2-5 files. Now, I have to monitor the data request all the time to get a month of data. My understanding is that I should submit smaller rather than large request so I am requesting one file per day.&nbsp;Is there a requirement on the time between consecutive requests? I tried to add 30s sleep between request which does not seem to work. Are there recent changes to server rules? Any suggestions are appreciated.

Thanks,

Zheng

The error messages are given below.&nbsp;

_2022-04-18 21:47:09,452 INFO Welcome to the CDS_  
_2022-04-18 21:47:09,452 INFO Sending request to [https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels](https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels)_  
_2022-04-18 21:47:09,647 INFO Request is queued_  
_2022-04-18 21:47:10,825 INFO Request is failed_  
_2022-04-18 21:47:10,826 ERROR Message: the request you have submitted is not valid_  
_2022-04-18 21:47:10,826 ERROR Reason: &nbsp;_  
_2022-04-18 21:47:10,826 ERROR &nbsp; Traceback (most recent call last):_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 59, in handle\_request_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; &nbsp; result = cached(context.method, proc, context, context.args, context.kwargs)_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; &nbsp; result = proc(context, \*context.args, \*\*context.kwargs)_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 124, in \_\_call\_\__  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; &nbsp; return p(\*args, \*\*kwargs)_  
_2022-04-18 21:47:10,826 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 60, in \_\_call\_\__  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; &nbsp; return self.proc(context, \*args, \*\*kwargs)_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; File "/home/cds/cdsservices/services/mars/mars.py", line 47, in internal_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; &nbsp; return mars(context, request, \*\*kwargs)_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; File "/home/cds/cdsservices/services/mars/mars.py", line 19, in mars_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; &nbsp; execute\_mars(context, requests)_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; File "/home/cds/cdsservices/services/mars/execute\_mars.py", line 18, in execute\_mars_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; &nbsp; context.run\_command("/usr/local/bin/mars", tmp, exception=MarsException)_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/context.py", line 209, in run\_command_  
_2022-04-18 21:47:10,827 ERROR &nbsp; &nbsp; &nbsp; raise exception(call, proc.returncode, output)_  
_2022-04-18 21:47:10,827 ERROR &nbsp; home.cds.cdsservices.services.mars.\_\_init\_\_.py.exceptions.MarsException_

_---------------------------------------------------------------------------_  
_Exception &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Traceback (most recent call last)_  
_~/Codes/analysis/python/ERA5/era5down.py in \<module\>_  
_&nbsp; &nbsp; &nbsp;71 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '21:00','22:00','23:00' ],_  
_&nbsp; &nbsp; &nbsp;72 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'format' &nbsp; &nbsp; &nbsp; &nbsp;: 'netcdf' }_  
_---\> 73 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.retrieve('reanalysis-era5-single-levels',reqdict , outfn )_

_~/anaconda3/envs/polar/lib/python3.8/site-packages/cdsapi/api.py in retrieve(self, name, request, target)_  
_&nbsp; &nbsp; 346&nbsp;_  
_&nbsp; &nbsp; 347 &nbsp; &nbsp; def retrieve(self, name, request, target=None):_  
_--\> 348 &nbsp; &nbsp; &nbsp; &nbsp; result = self.\_api("%s/resources/%s" % (self.url, name), request, "POST")_  
_&nbsp; &nbsp; 349 &nbsp; &nbsp; &nbsp; &nbsp; if target is not None:_  
_&nbsp; &nbsp; 350 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result.download(target)_

_~/anaconda3/envs/polar/lib/python3.8/site-packages/cdsapi/api.py in \_api(self, url, request, method)_  
_&nbsp; &nbsp; 504 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break_  
_&nbsp; &nbsp; 505 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.error(" &nbsp;%s", n)_  
_--\> 506 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; raise Exception(_  
_&nbsp; &nbsp; 507 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "%s. %s."_  
_&nbsp; &nbsp; 508 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % (reply["error"].get("message"), reply["error"].get("reason"))_

_Exception: the request you have submitted is not valid. ._

---

<div class="post-metadata">

**Author:** ![Peter\_Lang\_Langen](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/p/d6d6ee/32.png) [@Peter\_Lang\_Langen](https://forum.ecmwf.int/u/Peter_Lang_Langen)\
**Post date:** [19 April 2022 08:11 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/2 "2022-04-19T08:11:32Z")

</div>

Hi,

I am very interested to hear more on how to solve this - or if there is an issue with the service. I have a script that has been downloading 2m-RH from CARRA (from [https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-carra-single-levels](https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-carra-single-levels)) for a couple of weeks with no issues. But now, since about noon on April 15, I have occasionally been getting the exact same error message as reported by Zheng Liu above. Sometimes it works fine, sometimes it doesn't. It fails about half of the time, with no apparent pattern in when.

Cheers,

Peter

---

<div class="post-metadata">

**Author:** ![Mark\_Elliott](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/m/e8c25b/32.png) [@Mark\_Elliott](https://forum.ecmwf.int/u/Mark_Elliott)\
**Post date:** [19 April 2022 09:39 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/3 "2022-04-19T09:39:34Z")

</div>

Hi all,  
  
 Same here - I've been getting these errors randomly for the last few days.  
  
  
 Is there any fix yet?  
  
 Thx

Mark

---

<div class="post-metadata">

**Author:** ![jussi\_ikaeheimo](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/b77776/32.png) [@jussi\_ikaeheimo](https://forum.ecmwf.int/u/jussi_ikaeheimo)\
**Post date:** [19 April 2022 10:14 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/4 "2022-04-19T10:14:52Z")

</div>

Same here. At least since Friday.

---

<div class="post-metadata">

**Author:** ![Kevin\_Marsh](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/kevin_marsh/32/368_2.png) [@Kevin\_Marsh](https://forum.ecmwf.int/u/Kevin_Marsh)\
**Post date:** [19 April 2022 15:24 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/5 "2022-04-19T15:24:24Z")

</div>

Hi All,

The CDS team have now made some changes which should mean that these errors should be less likely to occur, so your requests should run normally.

Hope that helps,

Kevin

---

<div class="post-metadata">

**Author:** ![Zheng\_Liu](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/z/919ad9/32.png) [@Zheng\_Liu](https://forum.ecmwf.int/u/Zheng_Liu)\
**Post date:** [19 April 2022 20:42 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/6 "2022-04-19T20:42:28Z")

</div>

It works fine now. Thanks.

Zheng

---

<div class="post-metadata">

**Author:** ![Mark\_Elliott](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/m/e8c25b/32.png) [@Mark\_Elliott](https://forum.ecmwf.int/u/Mark_Elliott)\
**Post date:** [20 April 2022 07:50 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/7 "2022-04-20T07:50:38Z")

</div>

Yes, now seems ok. Many thanks.

---

<div class="post-metadata">

**Author:** ![Peter\_Lang\_Langen](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/p/d6d6ee/32.png) [@Peter\_Lang\_Langen](https://forum.ecmwf.int/u/Peter_Lang_Langen)\
**Post date:** [20 April 2022 08:52 UTC](https://forum.ecmwf.int/t/era5-requests-fail-intermittently/952/8 "2022-04-20T08:52:59Z")

</div>

Yes, also for me. Thanks!
