qoomon / aws-s3-bucket-browser

Single page application to browse AWS S3 bucket content
https://qoomon.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.amazonaws.com/spacenet-dataset#
MIT License
246 stars 85 forks source link

ListBucketResponse error rendering on index.html #3

Closed pschloss closed 4 years ago

pschloss commented 4 years ago

I'm trying to implement your bucket viewer, but am hitting the error at https://github.com/qoomon/aws-s3-bucket-browser/blob/master/index.html#L313. Do you have any insights as to what I might be doing wrong? My index page is at https://mothur.s3.us-east-2.amazonaws.com/index.html.

qoomon commented 4 years ago

probably your bucket does not have the right permissions.

How does the response of following Url looks like, <YOUR BUCKET URL>?list-type=2

e.g. https://s3.eu-west-1.amazonaws.com/data.openspending.org?list-type=2

It should contains following element <ListBucketResult>... </ListBucketResult>

pschloss commented 4 years ago

Thanks, that was the problem!

qoomon commented 4 years ago

@pschloss I've added some documentation how to setup needed permissions to README.md

coolbeans321 commented 3 years ago

Hi, I have a similar problem outlined above. The link with adding <YOUR BUCKET URL>?list-type=2 yields the element <ListBucketResult>... </ListBucketResult>. However, I get a page with an empty directory listing. For context, I'm not sure that it matters, but if it does, I'm using CloudFront with route53.

https://s3.us-east-1.amazonaws.com/BUCKET-NAME/index.html returns the correct response with a directory listing as expected, but when I change the bucket URL to exactly that, I still get an empty bucket directory listing

What would you suggest to resolve this?

Thank you!

qoomon commented 3 years ago

@coolbeans321 my app works with direct access to s3 bucket address. I don't know how cloudfront affects calls to s3 buckets. Maybe it does not proxy the whole request or you having trouble with caching by cloudfront.

coolbeans321 commented 3 years ago

I just tried disabling object caching, but that didn't seem to do the trick. What do you mean by not proxying the full request?

qoomon commented 3 years ago

@coolbeans321 could you post an example response from cloudfront? I think the behaviours of direkt s3 access and cloudfront are different because cloudfront uses another s3 url than the s3 api url. However if you provide me an response example and a public test cloudfront setup I could update this webapp to support cloudfront setup as well.

qoomon commented 3 years ago

there are multiple urls to access an s3 bucket

see https://aws.amazon.com/de/premiumsupport/knowledge-center/s3-returns-objects/

qoomon commented 3 years ago

@coolbeans321 may you provide the index.html url you use andconfig.bucketUrl if you set it manually?