Eo-learn tutorial issue

Hello,
i’m currently following this tutorial via jupyter-notebook :


But when I need to execute my workflow, the eopatch insn’t created and I have this error :

So I have changed this line executor.run(workers=5, multiprocess=True) into executor.run() but my eopatch folder is still empty.

I have not found anything on this topic yet. Is there any solution you could think about?
Besnier Jean-Baptiste

here is one of the error log file : http://pastebin.fr/72420

Hi Jean-Baptiste,

Be careful when posting full logs, you can expose private information.

I checked the log from your second post: the client_id that you have set does not exist in your dashboard.

I would suggest the following: create an Oauth client/secret pair in the dashboard under “User settings” (see point 4. on this page). Make sure you note the secret, it will appear only once. Then you can pass the credentials either globally or within the workflow:

from sentinelhub import SHConfig   
config = SHConfig()
config.sh_client_id = "your_new_id"
config.sh_client_secret = "your_new_secret"

That should do the job.

For your first problem, maybe @maleksandrov has an idea.

Maxim

1 Like

Thank you for your prompt response!

just to make sure I don’t make any mistakes,
my sh_client_id is the ID linked to my account (left) or to my OAuth JB clients ?

Because I tried in the tutorial where you create a timelapse in Sypder (to avoid the empty EOpatch) : https://eo-learn.readthedocs.io/en/latest/examples/core/TimeLapse.html

and I have this error:
oauthlib.oauth2.rfc6749.errors.CustomOAuth2Error: (During execution of task SentinelHubInputTask: ({‘status’: 400, ‘reason’: ‘Bad Request’, ‘message’: ‘Illegal client_id’, ‘code’: ‘OAUTH_ERROR’}) )

Thank you again for helping me.
Besnier Jean-Baptiste

You need an OAuth client, not you user ID. In the image above, you would create a new ID / secret pair by clicking on the green button with the white cross in the OAuth clients section on the right.

In theory you could use the JB client but only if you have saved the secret somewhere. If you haven’t got the secret, you can’t see it anymore (security feature), but since you can create new pairs it doesn’t matter :slight_smile:

1 Like

I did as you said and so I used my sh_client_id / sh_client_secret couple from my OAuth JB client.
I then added the following code at the beginning of my script:

from sentinelhub import SHConfig   
config = SHConfig()
config.sh_client_id = "your_new_id".
config.sh_client_secret = "your_new_secret"

But I always have the same error in the timelapse tutorial:
CustomOAuth2Error: (During execution of task SentinelHubInputTask: ({‘status’: 400, ‘reason’: ‘Bad Request’, ‘message’: ‘Illegal client_id’, ‘code’: ‘OAUTH_ERROR’}) )

I don’t know what to do. But once again thank you for your time. :confused:

Hi @Jean-Baptiste,

After setting credentials into the config object you either have to save the config or pass it as a parameter to SentinelHubInputTask. So either:

from sentinelhub import SHConfig   
config = SHConfig()
config.sh_client_id = "your_new_id".
config.sh_client_secret = "your_new_secret"

config.save()

or

from sentinelhub import SHConfig   
config = SHConfig()
config.sh_client_id = "your_new_id".
config.sh_client_secret = "your_new_secret"

add_data = SentinelHubInputTask(
   <other parameters>,
   config=config
)

If this won’t help I recommend double-checking that values config.sh_client_id and config.sh_client_secret are exactly what they should be. If even that seems ok, then I recommend creating a new Oath client credentials and deleting current ones.

Let us know if any of this helped.

2 Likes

Hello,
Thank you very much for your advice to both of you.
Indeed the problem came from me forgetting config.save(), everything works now!

Thank you very much for sharing your time with me!
I am very grateful,
Besnier Jean-Baptiste