CS-SI / eodag

Earth Observation Data Access Gateway
https://eodag.readthedocs.io
Apache License 2.0
316 stars 43 forks source link

Error at retrieval of data from cop_dataspace, when searching with scene ID #1291

Closed HamedElgizery closed 1 month ago

HamedElgizery commented 1 month ago

Describe the bug When attempting to search for a scene using its ID from cop_dataspace, it fails to find it with an error and returns an empty SearchResult.

Code To Reproduce

from eodag import EODataAccessGateway
from eodag import setup_logging

dag = EODataAccessGateway()
setup_logging(3)

scene_id = "S2A_MSIL2A_20240716T100601_N0510_R022_T33TTG_20240716T160254"
search_result = dag.search(id=scene_id, provider="cop_dataspace", count=True)
print(search_result)

Output

2024-08-09 11:05:47,209 eodag.core                       [INFO    ] (tid=140704552112064) Searching product with id 'S2A_MSIL2A_20240716T100601_N0510_R022_T33TTG_20240716T160254' on provider: cop_dataspace
2024-08-09 11:05:47,210 eodag.core                       [DEBUG   ] (tid=140704552112064) Using plugin class for search: ODataV4Search
2024-08-09 11:05:47,210 eodag.core                       [INFO    ] (tid=140704552112064) Iterate search over multiple pages: page #1
2024-08-09 11:05:47,210 eodag.search.base                [INFO    ] (tid=140704552112064) cop_dataspace is configured with default sorting by 'startTimeFromAscendingNode' in ascending order
2024-08-09 11:05:47,210 eodag.core                       [INFO    ] (tid=140704552112064) No result from provider 'cop_dataspace' due to an error during search.
2024-08-09 11:05:47,210 eodag.core                       [WARNING ] (tid=140704552112064) error at retrieval of data from cop_dataspace, for params: {'id': 'S2A_MSIL2A_20240716T100601_N0510_R022_T33TTG_20240716T160254', 'page': 1, 'items_per_page': 1000}
[]

Environment:

Additional context

veroandreo commented 1 month ago

I can confirm these errors, both with usgs and cop_dataspace, using eodag 3.0.0.b3.

sbrunato commented 1 month ago

Hello @HamedElgizery and @veroandreo , and thanks for submitting this issue. There is a problem when searching by id with no productType specified. Until this is fixed, you can bypass the issue using:

dag.search(id=scene_id, provider="cop_dataspace", productType="S2_MSI_L2A")

And in a general way, you'd better specify the productType if you know it. It will avoid looping over provider's endpoints when searching by id.