ecmwf / cdsapi

Python API to access the Copernicus Climate Data Store (CDS)
Apache License 2.0
218 stars 55 forks source link

An internal error occurred processing your request Reason: cannot import name 'make_traceback' #28

Closed samburu closed 1 year ago

samburu commented 3 years ago

The code I'm using

import cdsapi
c = cdsapi.Client()
c.retrieve('cems-glofas-historical',{'format': 'zip','variable': 'Upstream area',},'download.zip')

Traceback

020-11-02 07:13:18,908 INFO Welcome to the CDS
2020-11-02 07:13:18,908 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-glofas-historical
2020-11-02 07:13:19,726 INFO Request is queued
2020-11-02 07:13:20,914 INFO Request is failed
2020-11-02 07:13:20,914 ERROR Message: an internal error occurred processing your request
2020-11-02 07:13:20,914 ERROR Reason:  cannot import name 'make_traceback'
2020-11-02 07:13:20,914 ERROR   Traceback (most recent call last):
2020-11-02 07:13:20,914 ERROR     File "/opt/cds/adaptor/cdshandlers/adaptorlib/adaptorrequesthandler.py", line 66, in handle_request
2020-11-02 07:13:20,914 ERROR       return super().handle_request(cdsinf, data_request, self.config)
2020-11-02 07:13:20,915 ERROR     File "/opt/cds/cdsinf/python/lib/cdsinf/runner/requesthandler.py", line 113, in handle_request
2020-11-02 07:13:20,915 ERROR       return handler(cdsinf, request, config)
2020-11-02 07:13:20,915 ERROR     File "/opt/cds/adaptor/cdshandlers/url/handler.py", line 39, in handle_retrieve
2020-11-02 07:13:20,915 ERROR       dis = self._fetch_list(data_request["specific"])
2020-11-02 07:13:20,915 ERROR     File "/opt/cds/adaptor/cdshandlers/url/handler.py", line 91, in _fetch_list
2020-11-02 07:13:20,915 ERROR       pattern, valid_request, max_errors, patternmatchon, filename)
2020-11-02 07:13:20,915 ERROR     File "/opt/cds/adaptor/cdshandlers/adaptorlib/tools.py", line 141, in substitute
2020-11-02 07:13:20,916 ERROR       processed = template.render(r)
2020-11-02 07:13:20,916 ERROR     File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
2020-11-02 07:13:20,916 ERROR     File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
2020-11-02 07:13:20,916 ERROR       block_start_string,
2020-11-02 07:13:20,916 ERROR     File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 773, in handle_exception
2020-11-02 07:13:20,916 ERROR       except TemplateSyntaxError as e:
2020-11-02 07:13:20,916 ERROR   ImportError: cannot import name 'make_traceback'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.7/site-packages/cdsapi/api.py", line 317, in retrieve
    result = self._api('%s/resources/%s' % (self.url, name), request, 'POST')
  File "/opt/conda/lib/python3.7/site-packages/cdsapi/api.py", line 458, in _api
    raise Exception("%s. %s." % (reply['error'].get('message'), reply['error'].get('reason')))
EddyCMWF commented 1 year ago

Hi @samburu , As far as I can tell you are requesting data that is not available via the CDS. I think you will find the data you are after here: https://confluence.ecmwf.int/display/CEMS/Auxiliary+Data Thanks, Eddy

LuisHernandoG commented 1 year ago

Hi Eddy / Guys

I'm new in the community, .... would appreciate your support

I want to download daily precipitation data but got the below error, seems the parameter for the module "Project" shall be different than TBD (Note: I run the "test" to retrieve ERA5 data and it works well ....)

luis_h@LAPTOP-3D44S1T1:~$ python3 script.py Traceback (most recent call last): File "/home/luis_h/script.py", line 12, in "project": TBD, NameError: name 'TBD' is not defined

Below the script content ( taken from the C3S guide "Daily statistics calculated from ERA5 data" )

import cdsapi c = cdsapi.Client() MONTHS = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"] for month in MONTHS: result = c.service( "tool.toolbox.orchestrator.workflow", params={ "realm": "c3s", "project": TBD, "version": "master", "kwargs": { "dataset": "reanalysis-era5-single-levels", "product_type": "reanalysis", "variable": "total_precipitation", "statistic": "daily_mean", "year": "2020", "month": "month", "time_zone": "UTC+00:0", "frequency": "1-hourly", "grid": "0.25/0.25", "area": {"lat": [-20, -10], "lon": [40, 30]} }, "workflow_name": "daily_prec" }) c.download(result)

EddyCMWF commented 1 year ago

Hi @LuisHernandoG , please see the answer on #76