Skip to content

Unable to Download ePSF Files: 403 Forbidden Error in psf_retriever Function #213

@haticekaratay

Description

@haticekaratay

Description

I'm encountering a 403 Forbidden error when trying to download focus-diverse ePSF files using the psf_retriever function from the acstools.focus_diverse_epsfs module. This error occurs in both local environments and containerized environments (e.g., GitHub Codespaces).

The error arises while running a Jupyter notebook that demonstrates the workflow for downloading and examining a single focus-diverse ePSF file. You can view the notebook here: https://github.com/spacetelescope/hst_notebooks/blob/main/notebooks/ACS/acs_focus_diverse_epsfs/acs_focus_diverse_epsfs.ipynb

Expected behavior

The psf_retriever function should successfully download the specified ePSF FITS file when provided with a valid observation rootname as demonstrated in the notebook.

Actual behavior

The function returns a 403 Forbidden error from the AWS API Gateway, indicating that access to the resource is denied.

Steps to Reproduce

  1. Open the notebook and set up the download location in the current working directory:
download_location = os.path.join(os.getcwd(), 'downloads')
os.makedirs(download_location, exist_ok=True)
  1. Attempt to retrieve the file by running:
download_location = os.path.join(os.getcwd(), 'downloads')
os.makedirs(download_location, exist_ok=True)
  1. Observe the 403 Forbidden error response.
image

System Details

Environment: Tested in local Python environment and GitHub Codespaces.
Python Version: 3.11, and 3.12
Operating System: macOS locally, Ubuntu in Codespaces

I attempted to access the API directly using curl commands with and without authentication. Below are the outputs from these attempts:

curl -I https://8cclxcxse4.execute-api.us-east-1.amazonaws.com/main/psf-server-ops/

$ curl -I https://8cclxcxse4.execute-api.us-east-1.amazonaws.com/main/psf-server-ops/
HTTP/2 403
content-type: application/json
content-length: 0
date: Mon, 28 Oct 2024 19:24:02 GMT
x-amz-apigw-id: AYCw-FVWIAMEhHQ=
x-amzn-requestid: dc6c6afd-0059-4861-8db2-0f81c41a5dfc
x-amzn-errortype: ForbiddenException
x-cache: Error from cloudfront
via: 1.1 6d5b0fa46ef77b2ff227bdbcee6603ee.cloudfront.net (CloudFront)
x-amz-cf-pop: IAD55-P4
x-amz-cf-id: eSPdYfE1MQb0DvGIIp8ZfsEieuqly7q9PIWHINoLwSZkDp4mAin5OA

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions