Skip to main content

Hello,

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

eo-learn.readthedocs.io

How To: Land-Use-Land-Cover Prediction for Slovenia — eo-learn 0.8.0...









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

pastebin - outil de debug collaboratif









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


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) : Creating timelapse animations — eo-learn 1.4.1 documentation


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 🙂


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. 😕


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.


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


from sentinelhub import SHConfig

config = SHConfig()

config.sh_client_id = “your_new_id”.

config.sh_client_secret = “your_new_secret”


config.save()

Here your_new_id mean which ID?? Is there any specific ID where I can get it?

I used my user_id and instance_id both but not worked.


Your ID and Secret come from the OAuth Client.


To create a new OAuth Client open your account settings page then click the Create a new OAuth client button (Green + sign on the right).



Set the Client grant type to Client Credentials . Save the secret value as this will no longer be visible after creation! When done, click Create Client and you will see the new OAuth clien with its ID value in the list.


Thanks a ton, Brother. It’s worked. Take Love


Reply