Hello, 

I've been trying to retrieve some ERA5 data (retrieve_ERA5.py) with cdstoolbox, however upon running my script I recieve this error:

2022-05-26 11:15:11,283 INFO Welcome to the CDS
2022-05-26 11:15:11,283 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/tasks/services/tool/toolbox/orchestrator/run_workflow/clientid-b138264220c44ee39a47f5638285a0f2
2022-05-26 11:15:11,443 INFO Request is queued
2022-05-26 11:15:12,594 INFO Request is failed
2022-05-26 11:15:12,594 ERROR Message:
2022-05-26 11:15:12,594 ERROR Reason: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jsonrequest/requests.py", line 71, in jsonrequestcall
resp = coding.encode(req.callable(*req.args, **req.kwargs), register=encoders, **context)
File "/usr/local/lib/python3.6/dist-packages/cdsworkflows/submit_workflow.py", line 51, in submit_workflow
workflow_bare_func = runpy.run_path(workflow_path)[workflow_name]
KeyError: 'application'

And when importing the api:

python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cdstoolbox
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jada/.local/lib/python3.8/site-packages/cdstoolbox/__init__.py", line 8, in <module>
    with open(__main__.__file__) as f:
AttributeError: module '__main__' has no attribute '__file__'

If anyone has any suggestions as to how I can fix this, please let me know. Any help is appreciated.

Thanks, 

Jada Lynch

1 Comment

  1. Hi Jada,

    Rather than running the Toolbox workflow on your local system, you would usually run your workflow in the Toolbox editor itself :

    https://cds.climate.copernicus.eu/user/login?destination=/toolbox-user

    or

    call the toolbox workflow as a service using the CDS API:

    Call a service with the CDS API

    Hope that helps,

    Kevin