CAMS API BadRequestException
name: General Issue (FA)
about: Use this template for reporting an anomaly.
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues and build/installation issues on GitHub.
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
- Maja installed from (source or binary): source
- Maja version (use command below): 4.3
- Maja commit sha (if Maja is installed from source):
- Python version (From binpkg or custom):
- Complementary info (i.e. GCC/Compiler version)
Describe the current behavior
Error while using download_CAMS_daily
:
==================================
Downloading files for date 2021-03-01 00:00:00
==================================
00
Current_date = 20210301
Download new cams
Nom fichier de sortie AOT : /work/scratch/colinj/sandbox/tmpdir/CAMS_AOT_20210301UTC000000.nc
ERROR:cdsapi:Message: an internal error occurred processing your request
ERROR:cdsapi:Reason: {'traceback': 'Traceback (most recent call last):\nException\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/opt/cds/cdsinf/python/lib/cdsinf/runner/dispatcher.py", line 616, in handle_request\n context.get("method_config", None))\n File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 55, in handle_request\n result = cached(context.method, proc, context, context.args, context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached\n result = proc(context, *context.args, **context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__\n return p(*args, **kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__\n return self.proc(context, *args, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 52, in external\n return mars(context, request, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 17, in mars\n requests, info = preprocess_request(context, request, temp, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 21, in preprocess_request\n requests = basic_preprocessing(requests, kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 91, in basic_preprocessing\n repr(r[\'area\']), \'\')\ncdsinf.exceptions.BadRequestException: Area is not a Python list of 4 numbers: [\'G\']\n'}
ERROR:cdsapi: Traceback (most recent call last):
ERROR:cdsapi: File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 55, in handle_request
ERROR:cdsapi: result = cached(context.method, proc, context, context.args, context.kwargs)
ERROR:cdsapi: File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached
ERROR:cdsapi: result = proc(context, *context.args, **context.kwargs)
ERROR:cdsapi: File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__
ERROR:cdsapi: return p(*args, **kwargs)
ERROR:cdsapi: File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__
ERROR:cdsapi: return self.proc(context, *args, **kwargs)
ERROR:cdsapi: File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 57, in internalexternal
ERROR:cdsapi: return call_internal_or_external(context, request)
ERROR:cdsapi: File "/home/cds/cdsservices/services/mars_constrained/mars/call_internal_or_external.py", line 64, in call_internal_or_external
ERROR:cdsapi: result = context.call_resource(dataset, requests)
ERROR:cdsapi: File "/opt/cdstoolbox/cdscompute/cdscompute/context.py", line 307, in call_resource
ERROR:cdsapi: return c.call_resource(service, *args, **kwargs).value
ERROR:cdsapi: File "/opt/cdstoolbox/cdsworkflows/cdsworkflows/future.py", line 76, in value
ERROR:cdsapi: raise self._result
ERROR:cdsapi: cdsworkflows.error.ClientError: {'traceback': 'Traceback (most recent call last):\nException\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/opt/cds/cdsinf/python/lib/cdsinf/runner/dispatcher.py", line 616, in handle_request\n context.get("method_config", None))\n File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 55, in handle_request\n result = cached(context.method, proc, context, context.args, context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached\n result = proc(context, *context.args, **context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__\n return p(*args, **kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__\n return self.proc(context, *args, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 52, in external\n return mars(context, request, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 17, in mars\n requests, info = preprocess_request(context, request, temp, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 21, in preprocess_request\n requests = basic_preprocessing(requests, kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 91, in basic_preprocessing\n repr(r[\'area\']), \'\')\ncdsinf.exceptions.BadRequestException: Area is not a Python list of 4 numbers: [\'G\']\n'}
Traceback (most recent call last):
File "/home/ad/colinj/code/StartMaja/cams_download/download_CAMS_daily.py", line 235, in <module>
aot, rh, mr = download_files(date, ftype, time[t], step_choice, args.write_dir)
File "/home/ad/colinj/code/StartMaja/cams_download/download_CAMS_daily.py", line 77, in download_files
path_aot)
File "/home/ad/colinj/code/StartMaja/cams_download/cdsapi/api.py", line 348, in retrieve
result = self._api("%s/resources/%s" % (self.url, name), request, "POST")
File "/home/ad/colinj/code/StartMaja/cams_download/cdsapi/api.py", line 508, in _api
% (reply["error"].get("message"), reply["error"].get("reason"))
Exception: an internal error occurred processing your request. {'traceback': 'Traceback (most recent call last):\nException\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/opt/cds/cdsinf/python/lib/cdsinf/runner/dispatcher.py", line 616, in handle_request\n context.get("method_config", None))\n File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 55, in handle_request\n result = cached(context.method, proc, context, context.args, context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached\n result = proc(context, *context.args, **context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__\n return p(*args, **kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__\n return self.proc(context, *args, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 52, in external\n return mars(context, request, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/mars.py", line 17, in mars\n requests, info = preprocess_request(context, request, temp, **kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 21, in preprocess_request\n requests = basic_preprocessing(requests, kwargs)\n File "/home/cds/cdsservices/services/mars_constrained/mars/preprocess_request.py", line 91, in basic_preprocessing\n repr(r[\'area\']), \'\')\ncdsinf.exceptions.BadRequestException: Area is not a Python list of 4 numbers: [\'G\']\n'}.
Not sure whether the error is on our side though (bad request from Maja or bug on CAMS side?).
Describe the expected behavior
Urgency/Criticity
- Urgency (Select Low/Medium/High): Low
- Criticity (Select Low/Medium/High): Low
Code to reproduce the issue
Called the following command:
python /home/ad/colinj/code/StartMaja/cams_download/download_CAMS_daily.py -d 20210301 -f 20210331 -a /work/CESBIO/projects/Maja/CAMS_ADS_137/ -w /work/scratch/colinj/sandbox/tmpdir/ -p s2
Correction
(Optional) Provide a version number (Major.Minor.Patch, e.g. 3.2.1) when the correction shall be introduced.