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

No such file or directory: 'search.json' #16

Open
pgmgsw opened this issue Feb 25, 2020 · 2 comments
Open

No such file or directory: 'search.json' #16

pgmgsw opened this issue Feb 25, 2020 · 2 comments

Comments

@pgmgsw
Copy link

pgmgsw commented Feb 25, 2020

Hi,
I'm trying to upload images, but the script says I can't find the json file.

here's the request I make and the answer I get:

python ./theia_download.py -t T31UET -c SENTINEL2 -a config_theia.cfg -d 2019-01-01 -f 2020-02-25 -p SENTINEL2A -m 50 -r 51
Get theia single sign on token
Done
https://theia.cnes.fr/atdistrib/resto2/api/collections/SENTINEL2/search.json?location=T31UET&platform=SENTINEL2A&startDate=2019-01-01&completionDate=2020-02-25&maxRecords=500&processingLevel=LEVEL2A&relat
iveOrbitNumber=51
curl -k -o search.json "https://theia.cnes.fr/atdistrib/resto2/api/collections/SENTINEL2/search.json?location=T31UET&platform=SENTINEL2A&startDate=2019-01-01&completionDate=2020-02-25&maxRecords=500&proc
essingLevel=LEVEL2A&relativeOrbitNumber=51"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
Traceback (most recent call last):
File "./theia_download.py", line 292, in
with open('search.json') as data_file:
FileNotFoundError: [Errno 2] No such file or directory: 'search.json'

I had used this kind of request successfully in September, but it doesn't work anymore.

I downloaded the latest version of the script on GitHub and checked that my theia account was still valid; but it doesn't work any better...

Do I need to change something in the query syntax?

Thank you

@chauvenne
Copy link

The bug comes from the fact that the curl command does not create any output due to the SSL_read error. Any idea on how to solve that @olivierhagolle ?

@chauvenne
Copy link

chauvenne commented Nov 3, 2020

@pgmgsw I observed that making the request directly inside my browser was working. So by adding -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36" to the cURL command, it seems to do the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants