Downloading images using API

Hi, I’m downloading images using API and keep getting download rate limit hit warnings:

.conda\envs\sentinel\lib\site-packages\sentinelhub\download\sentinelhub_client.py:87: SHRateLimitWarning: Download rate limit hit warnings.warn("Download rate limit hit", category=SHRateLimitWarning)

… and when I look at generated report I see:

sentinelhub.exceptions.DownloadFailedException: Failed to download from:
https ://services.sentinel-hub.com/api/v1/process
with HTTPError:
400 Client Error: Bad Request for url: https ://services.sentinel-hub.com/api/v1/process
Server response: "{"status": 400, "reason": "Bad Request", "message": "Output VV requested but missing from function setup()", "code": "COMMON_BAD_PAYLOAD"}"

2023-05-24 11:48:47,691 eolearn.core.eoworkflow DEBUG    EOWorkflow ended with results WorkflowResults(outputs={}, start_time=datetime.datetime(2023, 5, 24, 11, 47, 59, 37730), end_time=datetime.datetime(2023, 5, 24, 11, 48, 47, 691355), stats={'CreateEOPatchTask-10f862a1fa1811edbf1d-b837194abb42': NodeStats(node_uid='CreateEOPatchTask-10f862a1fa1811edbf1d-b837194abb42', node_name='Create S2 EOPatch', start_time=datetime.datetime(2023, 5, 24, 11, 47, 59, 42714), end_time=datetime.datetime(2023, 5, 24, 11, 47, 59, 42714), exception=None, exception_traceback=None), 'SentinelHubInputTask-10f862a6fa1811edafe1-a854cf5187d4': NodeStats(node_uid='SentinelHubInputTask-10f862a6fa1811edafe1-a854cf5187d4', node_name='Add S1_ASC data', start_time=datetime.datetime(2023, 5, 24, 11, 47, 59, 45854), end_time=datetime.datetime(2023, 5, 24, 11, 48, 47, 689361), exception=DownloadFailedException('Failed to download from:\nhttps ://services.sentinel-hub.com/api/v1/process\nwith HTTPError:\n400 Client Error: Bad Request for url: https ://services.sentinel-hub.com/api/v1/process\nServer response: "{"status": 400, "reason": "Bad Request", "message": "Output VV requested but missing from function setup()", "code": "COMMON_BAD_PAYLOAD"}"'), exception_traceback='Traceback (most recent call last):\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\handlers.py", line 38, in new_download_func\n    return download_func(self, request)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\sentinelhub_client.py", line 90, in _execute_download\n    response.raise_for_status()\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\requests\\models.py", line 1021, in raise_for_status\n    raise HTTPError(http_error_msg, response=self)\nrequests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https ://services.sentinel-hub.com/api/v1/process\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\eolearn\\core\\eoworkflow.py", line 267, in _execute_task\n    return task.execute(*task_args, **task_kwargs), True\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\eolearn\\io\\sentinelhub_process.py", line 124, in execute\n    responses = client.download(requests, max_threads=self.max_threads)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\sentinelhub_client.py", line 62, in download\n    return super().download(*args, **kwargs)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\client.py", line 104, in download\n    raise download_exception\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\client.py", line 101, in download\n    results[future_order[future]] = future.result()\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\concurrent\\futures\\_base.py", line 451, in result\n    return self.__get_result()\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\concurrent\\futures\\_base.py", line 403, in __get_result\n    raise self._exception\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\concurrent\\futures\\thread.py", line 58, in run\n    result = self.fn(*self.args, **self.kwargs)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\client.py", line 117, in _single_download_decoded\n    response = self._single_download(request)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\client.py", line 130, in _single_download\n    response = self._execute_download(request)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\handlers.py", line 65, in new_download_func\n    return download_func(self, request)\n  File "C:\\Users\\Username\\.conda\\envs\\sentinel\\lib\\site-packages\\sentinelhub\\download\\handlers.py", line 44, in new_download_func\n    raise DownloadFailedException(\nsentinelhub.exceptions.DownloadFailedException: Failed to download from:\nhttps ://services.sentinel-hub.com/api/v1/process\nwith HTTPError:\n400 Client Error: Bad Request for url: https ://services.sentinel-hub.com/api/v1/process\nServer response: "{"status": 400, "reason": "Bad Request", "message": "Output VV requested but missing from function setup()", "code": "COMMON_BAD_PAYLOAD"}"\n')}, error_node_uid='SentinelHubInputTask-10f862a6fa1811edafe1-a854cf5187d4')
2023-05-24 11:48:47,692 eolearn.core.eoworkflow DEBUG    EOWorkflow execution failed!

However,

  1. I’m not using a trial account to hit the download limit so soon (?) and
  2. then I’m also not sure about the part Output VV requested but missing in:

https://services.sentinel-hub.com/api/v1/process with HTTPError: 400 Client Error: Bad Request for url: https://services.sentinel-hub.com/api/v1/process Server response: "{"status": 400, "reason": "Bad Request", "message": "Output VV requested but missing from function setup()", "code": "COMMON_BAD_PAYLOAD"}"

Is there something else I am missing within my API call?

Hi,

Can you please provide more details on your API request. Even better, if you’re able to share the code you are using we can replicate your error and help debug it :slight_smile:

Thanks

Hi, code is available on Github, here is the link to line where evalscript is defined. Hope code is sufficient to get a better picture of what is going on. Some sensitive info like instance id, client id, etc. is removed though.

For debugging purposes, only first five bbox-es are selected to make the EOPatches. Since time series is needed, there is one time interval defined in the code, and additional dates listed in input_files/valid_dates_S2.txt

Hi, the link you included does not seem to be working. Is it a private repository?

Apologies, it was mistakenly set to private before, it is now public!