microsoft / PlanetaryComputer

Issues, discussions, and information about the Microsoft Planetary Computer
https://planetarycomputer.microsoft.com/
MIT License
178 stars 7 forks source link

Planetary Computer stac catalog is not accessible #262

Open gtgrp-user opened 1 year ago

gtgrp-user commented 1 year ago

Hi,

I am trying to access the stac catalog using the following piece of code

from pystac_client import Client URL = 'https://planetarycomputer.microsoft.com/api/stac/v1' cat = Client.open(URL) cat

And getting the following error APIError: HTTPSConnectionPool(host='planetarycomputer.microsoft.com', port=443): Max retries exceeded with url: /api/stac/v1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5f0a547e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

TomAugspurger commented 1 year ago

That should be working. Here's my local session:

In [3]: from pystac_client import Client; URL = 'https://planetarycomputer.microsoft.com/api/stac/v1'; cat = Client.open(URL); cat
Out[3]: <Client id=microsoft-pc>

I wonder if you have a firewall or network setting blocking access. Can you access https://planetarycomputer.microsoft.com/api/stac/v1 on a browser, either on that same machine or a different one on a different network?

TomAugspurger commented 1 year ago

The error message in https://github.com/stac-utils/pystac-client/issues/383 is a bit different (custom cert vs. DNS error) but maybe some of the links there will be helpful.

gtgrp-user commented 1 year ago

That should be working. Here's my local session:

In [3]: from pystac_client import Client; URL = 'https://planetarycomputer.microsoft.com/api/stac/v1'; cat = Client.open(URL); cat
Out[3]: <Client id=microsoft-pc>

I wonder if you have a firewall or network setting blocking access. Can you access https://planetarycomputer.microsoft.com/api/stac/v1 on a browser, either on that same machine or a different one on a different network?

The frustrating aspect is that sometimes I can access the catalog, while other times I can't, and I can indeed access the STAC URL. I'll investigate the issue with the pystac-client. Just so you know, occassionaly, I receive this APIError too;

APIError: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' '[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'%3E%3Chtml) xmlns='[http://www.w3.org/1999/xhtml'><head><meta](http://www.w3.org/1999/xhtml'%3E%3Chead%3E%3Cmeta) content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body {font-family:Arial; margin-left:40px; }img { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p { font-size: 13px; color: #000000; margin: 7px 0px 0px0px}#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Service unavailable</title></head><body><div id='content'><div id='message'><h2>Our services aren't available right now</h2><p>We're working to restore all services as soon as possible. Please check back soon.</p></div><div id='errorref'><span>0yfnxZAAAAABT8YZH/hThSoe0oboPnfqYTE9OMjFFREdFMTYxNAA5MjdhYmZhNi0xOWY2LTRhZjEtYTA5ZC1jOTU5ZDlhMWU2NDQ=</span></div></div></body></html>

gtgrp-user commented 1 year ago

Hi @TomAugspurger

The information you provided didn't offer much assistance in our specific situation. I've confirmed that I'm not utilizing a proxy server and attempted to resolve the issue by disabling the firewall, yet the intermittent APIError mentioned earlier persists.

I attempted to replicate the issue on the Planetary Computer Hub, even trying it with CPU instances, but unfortunately, I couldn't access the platform. Similarly, I encountered the same issue while using the Digital Earth Africa sandbox, both on my home network and mobile hotspot.

I've been a regular user of your STAC catalog for quite some time without any issues, up until last week.

TomAugspurger commented 1 year ago

Interesting, thanks.

Just so you know, occassionaly, I receive this APIError too;

That is a somewhat known issue that we're looking into. In the meantime, https://pystac-client.readthedocs.io/en/stable/usage.html#configuring-retry-behavior has the documentation for configuring retries in pystac-client, or anything that uses urllib3.

It's hard to say, but "Temporary failure in name resolution" really does sound like a networking issue between your machine and the Planetary Computer's API servers.

gtgrp-user commented 1 year ago

"Temporary failure in name resolution" is indeed a network issue.

I have configured retries in pystac-client and still geting APIError for landsat collections. However, sentinel 2 L2A, ESA and ESRI landcover collections are working fine.

Service unavailable error: APIError: HTTPSConnectionPool(host='planetarycomputer.microsoft.com', port=443): Max retries exceeded with url: /api/stac/v1/search (Caused by ResponseError('too many 503 error responses'))

mehran66 commented 11 months ago

@gtgrp-user that issue has occured on my side too...did you figure it out?

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body {font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px0px}#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Service unavailable</title></head><body><div id='content'><div id='message'><h2>Our services aren't available right now</h2><p>We're working to restore all services as soon as possible. Please check back soon.</p></div><div id='errorref'><span>0UYcdZQAAAADSxwGZbLbCR4ywAGvllIoWTU5aMjIxMDYwNjExMDQ1ADkyN2FiZmE2LTE5ZjYtNGFmMS1hMDlkLWM5NTlkOWExZTY0NA==</span></div></div></body></html>
TomAugspurger commented 11 months ago

@mehran66 that indicates an error somewhere on the service's end. You might want to add retries on whatever request generated that error (that response probably had a 500 status code).