Downloading L1C products from Scihub Long Term Archive fails
Bug description
Downloading L1C products from Scihub long term archive fails. Exceptions are not catched, leading to errors when trying to copy the ghost SAFE to L1C library.
Tiled: 6
Non tiled: 0
191395:2021-06-22 18:38:19:INFO:sen2chain.download_and_process:--> downloading S2B_MSIL1C_20180830T063459_N0206_R134_T40KCB_20180830T095521 from scihub
191395:2021-06-22 18:38:19:INFO:sen2chain.library:S2B_MSIL1C_20180830T063459_N0206_R134_T40KCB_20180830T095521: creating temp folder
191395:2021-06-22 18:38:19:INFO:sen2chain.download_and_process:--> downloading S2A_MSIL1C_20180825T063511_N0206_R134_T40KCB_20180825T081246 from scihub
191395:2021-06-22 18:38:19:INFO:sen2chain.library:S2A_MSIL1C_20180825T063511_N0206_R134_T40KCB_20180825T081246: creating temp folder
191395:2021-06-22 18:38:31:INFO:sentinelsat.SentinelAPI:Found 1 products
191395:2021-06-22 18:38:31:INFO:sentinelsat.SentinelAPI:Will download 1 products using 2 workers
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:Found 1 products
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:Will download 1 products using 2 workers
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:Product 66dcb09f-2f1c-4664-8bba-bcf721bb0e98 is in LTA.
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:Product 6f547640-3f0f-423d-846b-e900c52bdd80 is in LTA.
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:66dcb09f-2f1c-4664-8bba-bcf721bb0e98 is not online.
191395:2021-06-22 18:38:32:INFO:sentinelsat.SentinelAPI:6f547640-3f0f-423d-846b-e900c52bdd80 is not online.
191395:2021-06-22 18:38:34:ERROR:sentinelsat.SentinelAPI:Trying to download an offline product
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/user/.local/share/virtualenvs/sen2chain/lib/python3.8/site-packages/sentinelsat/sentinel.py", line 837, in _trigger_offline_retrieval_until_stop
status_code = self._trigger_offline_retrieval(product_info["url"])
File "/home/user/.local/share/virtualenvs/sen2chain/lib/python3.8/site-packages/sentinelsat/sentinel.py", line 666, in _trigger_offline_retrieval
raise SentinelAPILTAError("Trying to download an offline product", r)
sentinelsat.sentinel.SentinelAPILTAError: HTTP status 500 Internal Server Error: Trying to download an offline product
191395:2021-06-22 18:38:34:ERROR:asyncio:Exception in callback _chain_future.<locals>._set_state(<Future pendi...821f8e1f0>()]>, <Future at 0x...StopIteration>) at /usr/lib/python3.8/asyncio/futures.py:354
handle: <Handle _chain_future.<locals>._set_state(<Future pendi...821f8e1f0>()]>, <Future at 0x...StopIteration>) at /usr/lib/python3.8/asyncio/futures.py:354>
Traceback (most recent call last):
File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.8/asyncio/futures.py", line 356, in _set_state
_copy_future_state(other, future)
File "/usr/lib/python3.8/asyncio/futures.py", line 332, in _copy_future_state
dest.set_exception(_convert_future_exc(exception))
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future
191395:2021-06-22 18:38:34:INFO:sentinelsat.SentinelAPI:6f547640-3f0f-423d-846b-e900c52bdd80 accepted for retrieval
191395:2021-06-22 18:38:34:INFO:sen2chain.download_and_process:--> --> S2A_MSIL1C_20180825T063511_N0206_R134_T40KCB_20180825T081246 downloaded from scihub
Steps to reproduce
>>> import sen2chain as sc
>>> request = sc.DataRequest("2018-08-01", "2018-08-31")
>>> prod_ids = request.from_tiles(["40KCB"])
>>> sc.DownloadAndProcess(identifiers=prod_ids, hubs_limit={"scihub": 2, "peps": 0})
System description
- Ubuntu 20.04 LTS
- Python3.8