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

Clarify which DAACs can be accessed with maap.aws.earthdata_s3_credentials (NSIDC error) #352

Open
wildintellect opened this issue Oct 20, 2023 · 0 comments
Assignees

Comments

@wildintellect
Copy link
Collaborator

wildintellect commented Oct 20, 2023

MAAP has the ability to authenticate to S3 endpoints for EarthDataCloud.
The Docs needs to specifically state which DAACs this works with and what credentials url to use.

NSIDC seems to be throwing an error for users.
Seems we knew about this, but I don't have a record of the issue. @bsatoriu is it just that NSIDC doesn't support federated tokens?

  • The work around is Direct Access chore: add direct access #344
  • Alternative which is not DPS compatible is to use the earthaccess library with non-federated tokens.

Example Code

from maap.maap import MAAP
maap = MAAP()

check = maap.aws.earthdata_s3_credentials("https://data.nsidc.earthdatacloud.nasa.gov/s3credentials")
check
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Input In [9], in <cell line: 1>()
----> 1 check = maap.aws.earthdata_s3_credentials("https://data.nsidc.earthdatacloud.nasa.gov/s3credentials")
      2 check

File /maap-py/maap/AWS.py:61, in AWS.earthdata_s3_credentials(self, endpoint_uri)
     56 _url = self._earthdata_s3_credentials_endpoint.replace(
     57     "{endpoint_uri}", _parsed_endpoint
     58 )
     60 response = requests.get(url=_url, headers=self._api_header)
---> 61 response.raise_for_status()
     63 result = json.loads(response.text)
     64 result["DAAC"] = urllib.parse.urlparse(endpoint_uri).netloc

File ~/.local/lib/python3.10/site-packages/requests/models.py:960, in Response.raise_for_status(self)
    957     http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
    959 if http_error_msg:
--> 960     raise HTTPError(http_error_msg, response=self)

HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: https://api.maap-project.org/api/members/self/awsAccess/edcCredentials/https%253A%252F%252Fdata.nsidc.earthdatacloud.nasa.gov%252Fs3credentials
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

3 participants