awslabs/mountpoint-s3

Support for Reading Files from Mounted S3 Object Lambda Access Point

Closed this issue · 3 comments

Hello,

I attempted to use the alias of an Object Lambda Access Point as the bucket name and successfully mounted it to the local file system, allowing me to view the file list. However, when reading a text file, an error occurs, as shown below:

2024-10-17T09:05:16.853893Z ERROR read{req=280 ino=3 fh=7 offset=0 size=4096 name="plain.txt"}:prefetch{range=0..35 out of 35}: mountpoint_s3::prefetch::part_stream: GetObject body part failed key="plain.txt" error=ClientError(ResponseError(MetaRequestResult { response_status: 501, crt_error: Error(14343, "aws-c-s3: AWS_ERROR_S3_INVALID_RESPONSE_STATUS, Invalid response status from request"), error_response_headers: Some(Headers { inner: 0x7fbe04047780 }), error_response_body: Some("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>NotImplemented</Code><Message>Operation Not Implemented.</Message><RequestId>74708ebe-6e62-4609-98b5-41f3aff9319e</RequestId><HostId>{host-id}</HostId></Error>") }))

If I use aws s3api get-object without the --range option, the file content can be retrieved successfully. Could this be because S3 Object Lambda does not support the Range header? Is there a possibility that mountpoint-s3 could support reading S3 objects behind an Object Lambda Access Point?

Thank you.

Hey @h2cone. Mountpoint relies on the Range HTTP header for fetching S3 object content with high throughput. Mountpoint does support S3 Object Lambda Access Points, but the access point must support range headers for GetObject.

Range support is something that needs to be implemented in the AWS Lambda function supporting the S3 Object Lambda Access Point. You can find more information on how to do this in the S3 User Guide: https://docs.aws.amazon.com/AmazonS3/latest/userguide/range-get-olap.html

Hey @h2cone. If you wouldn't mind sharing, we'd love to hear more about your use case combining Mountpoint with S3 Object Lambda. I previously worked on S3 Object Lambda itself so I'm personally curious too!

For reference, a list of the limitations Mountpoint has for usage with S3 Object Lambda are mentioned here in our configuration documentation: https://github.com/awslabs/mountpoint-s3/blob/main/doc/CONFIGURATION.md#s3-object-lambda