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

Proxy configuration settings #542

Closed
miguelgcg opened this issue Sep 29, 2021 · 1 comment
Closed

Proxy configuration settings #542

miguelgcg opened this issue Sep 29, 2021 · 1 comment
Labels

Comments

@miguelgcg
Copy link

miguelgcg commented Sep 29, 2021

Hi,

When trying to download S1 products:

from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt


footprint = 'POLYGON((13.6887 50.9976,13.6887 51.0641,13.8274 51.0641,13.8274 50.9976,13.6887 50.9976))'

api = SentinelAPI('u', 'p!', 'https://scihub.copernicus.eu/dhus')

# Set request parameters 
kw = {
      'date': ('20210901', '20210915'),          
      'platformname': 'Sentinel-1',             
      'producttype': 'GRD',                   
      'filename': 'S1B*',
      'area_relation': 'Intersects'                 # or Contains, IsWithin
}

products = api.query(footprint, **kw)

I am facing the following error:

ConnectionError: HTTPSConnectionPool(host='scihub.copernicus.eu', port=443): Max retries exceeded with url: /dhus/search?format=json&rows=100&start=0&q=beginPosition%3A%5B%222021-09-01T00%3A00%3A00Z%22+TO+%222021-09-15T00%3A00%3A00Z%22%5D+filename%3AS1B%2A+platformname%3A%22Sentinel-1%22+producttype%3A%22GRD%22+footprint%3A%22Intersects%28POLYGON%28%2813.6887+50.9976%2C13.6887+51.0641%2C13.8274+51.0641%2C13.8274+50.9976%2C13.6887+50.9976%29%29%29%22 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001EDE4CEDDC0>: Failed to establish a new connection: [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'))

I am guessing this is related to the fact of working behind a company proxy. My conda env has been set for it, by setting the proxy servers in my .condarc file.

So, is this a proxy-related issue? If so, is there a way to pass specific proxy settings in the api.query function?

@miguelgcg miguelgcg changed the title Pass proxy settings while Proxy configuration settings Sep 29, 2021
@kr-stn
Copy link
Member

kr-stn commented Oct 12, 2021

sentinelsat is using the requests module under the hood and not overwriting any proxy settings. Therefore you should be able to just use the environment variables, as outlined in the requests documentation - using proxies.

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

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

No branches or pull requests

3 participants