Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[URGENT] Unable to download products from CreoDIAS due to authentification change #752

Closed
filippogrz opened this issue Jun 28, 2023 · 3 comments · Fixed by #763
Closed
Labels
bug Something isn't working

Comments

@filippogrz
Copy link

filippogrz commented Jun 28, 2023

Describe the bug
When searching for Sentinel-1 GRD products with CreoDIAS as a provider, the download command returns an error.

It seems than CreoDIAS has recently updated their website (see new website "CreoDIAS 2.0" that now requires MFA to sign in) and their authentification method through the API.

Code To Reproduce
With CreoDIAS as main provider configured, search will pass successfully but download will fail:

eodag search --productType S1_SAR_GRD --start 2023-06-01 --end 2023-06-02
eodag -vvv download --search-results search_results.geojson

Output
The download command will return an authentification error:

eodag.utils.exceptions.AuthenticationError: Something went wrong while trying to get access token:
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 59, in authenticate
    response.raise_for_status()
  File "/home/username/.local/lib/python3.8/site-packages/requests/models.py", line 1022, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://identity.cloudferro.com/auth/realms/dias/protocol/openid-connect/token
See the full error below returned by the `download` command
2023-06-28 14:37:35,395 eodag.config                     [INFO    ] (config           ) Loading user configuration from: /home/username/.config/eodag/eodag.yml
2023-06-28 14:37:35,468 eodag.core                       [INFO    ] (core             ) usgs: provider needing auth for search has been pruned because no crendentials could be found
2023-06-28 14:37:35,468 eodag.core                       [INFO    ] (core             ) aws_eos: provider needing auth for search has been pruned because no crendentials could be found
2023-06-28 14:37:35,468 eodag.core                       [INFO    ] (core             ) meteoblue: provider needing auth for search has been pruned because no crendentials could be found
2023-06-28 14:37:35,468 eodag.core                       [INFO    ] (core             ) hydroweb_next: provider needing auth for search has been pruned because no crendentials could be found
2023-06-28 14:37:35,540 eodag.core                       [DEBUG   ] (core             ) Opening product types index in /home/username/.config/eodag/.index
2023-06-28 14:37:35,546 eodag.core                       [INFO    ] (core             ) Locations configuration loaded from /home/username/.config/eodag/locations.yml
2023-06-28 14:37:35,549 eodag.core                       [INFO    ] (core             ) Downloading 20 products
Downloaded products:   0%|                                                                                                                       | 0/20 [00:00<?, ?product/s]2023-06-28 14:37:35,686 eodag.plugins.download.base      [ERROR   ] (base             ) Stopped because of credentials problems with provider creodias
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 59, in authenticate
    response.raise_for_status()
  File "/home/username/.local/lib/python3.8/site-packages/requests/models.py", line 1022, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://identity.cloudferro.com/auth/realms/dias/protocol/openid-connect/token

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/download/base.py", line 453, in download_all
    product.download(
  File "/home/username/.local/lib/python3.8/site-packages/eodag/api/product/_product.py", line 304, in download
    self.downloader_auth.authenticate()
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 77, in authenticate
    raise AuthenticationError(
eodag.utils.exceptions.AuthenticationError: Something went wrong while trying to get access token:
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 59, in authenticate
    response.raise_for_status()
  File "/home/username/.local/lib/python3.8/site-packages/requests/models.py", line 1022, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://identity.cloudferro.com/auth/realms/dias/protocol/openid-connect/token

Downloaded products:   0%|                                                                                                                       | 0/20 [00:00<?, ?product/s]
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 59, in authenticate
    response.raise_for_status()
  File "/home/username/.local/lib/python3.8/site-packages/requests/models.py", line 1022, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://identity.cloudferro.com/auth/realms/dias/protocol/openid-connect/token

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/.local/bin/eodag", line 8, in <module>
    sys.exit(eodag())
  File "/home/username/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/username/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/username/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/username/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/username/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/username/.local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/username/.local/lib/python3.8/site-packages/eodag/cli.py", line 573, in download
    downloaded_files = satim_api.download_all(search_results)
  File "/home/username/.local/lib/python3.8/site-packages/eodag/api/core.py", line 1612, in download_all
    paths = download_plugin.download_all(
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/download/http.py", line 718, in download_all
    return super(HTTPDownload, self).download_all(
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/download/base.py", line 453, in download_all
    product.download(
  File "/home/username/.local/lib/python3.8/site-packages/eodag/api/product/_product.py", line 304, in download
    self.downloader_auth.authenticate()
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 77, in authenticate
    raise AuthenticationError(
eodag.utils.exceptions.AuthenticationError: Something went wrong while trying to get access token:
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/eodag/plugins/authentication/keycloak.py", line 59, in authenticate
    response.raise_for_status()
  File "/home/username/.local/lib/python3.8/site-packages/requests/models.py", line 1022, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://identity.cloudferro.com/auth/realms/dias/protocol/openid-connect/token

Environment:

  • Python version: 3.8.10
  • EODAG version: 2.10.0
@filippogrz filippogrz added the bug Something isn't working label Jun 28, 2023
@sbrunato
Copy link
Collaborator

Hello @filippogrz and thanks for submitting this issue.
creodias has moved to a new commercial service. Before the provider is updated with this new authentication service, I can suggest you to use the cop_dataspace provider with eodag (see provider registration). It will be the closest provider to the previous creodias and you should have similar results

@varisht-tathya
Copy link

varisht-tathya commented Jun 30, 2023

I am facing a similar issue as well when downloading Sen 3 SLSTR products from creodias. Are there any alternate sources that give access to historical data and compatible with EODAG?

@sbrunato
Copy link
Collaborator

Hello @varisht-tathya , for Sentinel 3 SLSTR, you can try cop_dataspace, mundi or onda (also sara for australian data).
See:

>>> from eodag import EODataAccessGateway
>>> dag = EODataAccessGateway()
>>> dag.available_providers("S3_SLSTR_L1RBT")
['cop_dataspace', 'creodias', 'mundi', 'onda', 'sara']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants