awslabs / aws-js-s3-explorer

AWS JavaScript S3 Explorer is a JavaScript application that uses AWS's JavaScript SDK and S3 APIs to make the contents of an S3 bucket easy to browse via a web browser.
Apache License 2.0
818 stars 273 forks source link

Error accessing S3 bucket test-browse. Error: NetworkingError: Network Failure #92

Closed jinthoa closed 3 years ago

jinthoa commented 3 years ago

Hello,

I followed the instruction for bucket policy and CORS configuration but I can't make this to work on my bucket.

My bucket policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicListGet",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:List*",
                "s3:Get*"
            ],
            "Resource": [
                "arn:aws:s3:::test-browse",
                "arn:aws:s3:::test-browse/*"
            ]
        }
    ]
}

My CORS configuration:

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
                    <CORSRule>
                      <AllowedOrigin>http://MY-BUCKET-NAME.s3-website-us-west-1.amazonaws.com</AllowedOrigin>
                      <AllowedMethod>HEAD</AllowedMethod>
                      <AllowedMethod>GET</AllowedMethod>
                      <AllowedHeader>*</AllowedHeader>
                      <ExposeHeader>ETag</ExposeHeader>
                      <ExposeHeader>x-amz-meta-custom-header</ExposeHeader>
                    </CORSRule>
</CORSConfiguration>

At the address: https://MY-BUCKET-NAME.s3-us-west-1.amazonaws.com/index.html, I get the following error:

v07osn

At the address: https://s3.amazonaws.com/MY-BUCKET-NAME/index.html, I get this:

v07p17

At the address: http://MY-BUCKET-NAME.s3-website-us-west-1.amazonaws.com/, I get this:

v07paq

index.html is at the root of my bucket, guessing this is the right place. Any help would be appreciated, thanks.

danil-smirnov commented 3 years ago

The last error advises you haven't enabled "Static website hosting" feature in the bucket. The second issue is that you are trying to reach the bucket via https which is not supported by the mentioned feature at the moment as far as I know.

john-aws commented 3 years ago

@danil-smirnov thanks for jumping in to help.

@jinthoa can you confirm that you followed the Static Website Hosting instructions?

jinthoa commented 3 years ago

The last error advises you haven't enabled "Static website hosting" feature in the bucket. The second issue is that you are trying to reach the bucket via https which is not supported by the mentioned feature at the moment as far as I know.

Thank you, it worked!