I was using sentinel hub OGC API to download some Sentinel 2A products and was using Jupiter notebook to download the data. As a process I mention my configuration id that gives access to the data layer and then call for the download request. It was working perfectly fine until today when I upgraded the sentinel hub library in python 3.9 and now its constantly throwing the error of permission denied (Err no 13)
As part of the new release of the Sentinel Hub Python Package, changes were made regarding the Sentinel Hub configuration file. You can read more about this in the Release Notes.
I would suggest reading through them and adjusting your configuration accordingly.
As I said, changes have been made to the configuration. Please go through the documentation on this here.
I have also just updated my Sentinel Hub Python Package to 3.9.0 and needed to reenter my sh_client_id and sh_client_secret so I expect that you will need to do the same.
still same error William, its not even allowing me to touch the config file or do any changes in them. but this same things works completely on a different windows computer and without specifically mentioning the client id
OK I don’t have enough knowledge of the permissions and settings that are on your system. Can you confirm your operating system and environment please, I am confused as you mention Windows but your screenshot is from Mac OS.
yes I am working on macOS Monterey, version 12.0.1. Also I am using python 3.9 to download data from sentinel hub WCS layers. I have been doing this since last year and never have I faced any problem. Today morning, I was showing it to one of my colleagues who has a windows system and it ran completely fine on his laptop.
during the same time, I accidentally upgraded sentinel hub and since then I am facing this issue. I tried uninstalling and reinstalling sentinel hub again, but the moment I call sentinel hub as a library, it says the permission is denied.
# Set up configuration tool
config = SHConfig()
if not config.sh_client_id or not config.sh_client_secret:
print("Warning! To use Process API, please provide the credentials (OAuth client ID and client secret).")
Running the below cell will return your configuration (don’t share this in the public forum). If your client id and client secret are empty you will need reenter these credentials.
Hi @jagriti, in the recent update the configuration file was moved to the ~/.config/sentinelhub/config.toml, and, judging by the error, your python process seems to not have permissions to access/modify it.
Workaround
To avoid you having issues, here is a possible workaround:
config = SHConfig(use_defaults=True)
# this will completely ignore looking into the file
# so the permission error should go away
config.instance_id = "somethingsomething"
...
You then have to pass this config around explicitly, any method that will be called without config=config might try to call SHConfig() inside and crash. So this is clearly just a temporary workaround so you can continue your work.
Possible solution
Looking at your full stack-trace, it could just be that the process does not have sufficient permissions to CREATE things. So try creating the following manually:
create the folder .config in /Users/jagriti/, inside create a folder sentinelhub
in /Users/jagriti/.config/sentinelhub/ create a file named config.toml
put the following in the config file (filling in the appropriate credentials ofcourse):
For now I have installed sentinel hub version 3.8.4 and its working fine. I’ll try this solution next week as I am in process of executing an important code.