WinError 10060 - sentinelsat library on python

I use sentinelsat library in python for some period of time without any problem at the company I work on. the company has a basic account. Suddenly, I got the following error that I have attached below. I have written a simple script of code to find the source of the error. My code just finds some images of Sentinel based on some criteria and downloads one of them (the username and password are declared but not shown). The problem occurs when api.query is executed.

from datetime import date
import sentinelsat

api = sentinelsat.SentinelAPI(username, password)
start_date = date(2023, 12, 1)
end_date = date(2023, 12, 10)
platform_name = ‘Sentinel-2’
product_type = ‘S2MSI1C’ # Sentinel-2 Level-1C product

tile_coords = ‘30TVK’ # Replace this with the specific tile you want to download
Define the search parameters for the specific tile
tile_query = f’tileid={tile_coords}’

Search for available images based on the defined criteria

products = api.query(tileid = ‘30TVK’,
date=(start_date, end_date),
platformname=platform_name,
producttype=product_type)

for product_id, product_info in products.items():
print(product_info)

Download the desired image (change product_id to the one you want to download)

api.download(product_id)

The error I encountered is:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

<urllib3.connection.HTTPSConnection object at 0x000001C910FAC850>: Failed to establish a new connection: [WinError 10060]

After some search (Proxy configuration settings · Issue #542 · sentinelsat/sentinelsat · GitHub), I found that it may be related to the network. I am not familiar with proxies. I added the two following lines but there is still no improvement.

import os
os.environ[‘HTTP_PROXY’] = …
os.environ[‘HTTPS_PROXY’] = …

recently, I checked the following post:
Please note that due to a migration to a newer authentication system planned for release on 2023-11-14 15:00 UTC, client credentials containing special characters ‘+%’ sent in the Basic HTTP Authentication header will have to be URL encoded according to RFC6749 section 2.3.1

My password includes ‘#’. Is there any problem with this special character or not?

Hi,

We do not own or maintain the sentinelsat library, this is not related to Sentinel Hub services at all.

I expect your issue is related to this though.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.