GlobalDataverseCommunityConsortium / dataverse-previewers

A collection of Datafile Previewers that can be configured to work with Dataverse
MIT License
13 stars 38 forks source link

Issues turning on Previewers in dataverse.harvard.edu #28

Closed djbrooke closed 4 years ago

djbrooke commented 4 years ago

We tried to turn on previewers in dataverse.harvard.edu and were mostly not successful. We've taken them down for now.

I discussed this with @kcondon and @scolapasta and the suspicion is that it has to do with redirects (I'll ask @scolapasta to fill in the details here).

More details in https://github.com/IQSS/dataverse.harvard.edu/issues/42

scolapasta commented 4 years ago

On S3, dataverse will redirect calls to an S3 link when you try to download the file.

By default the API for download (at least with curl) does not by follow the redirect. You have to add -L to the call. (we're currently unsure of why the tab* works, but it is the anomaly).

(*) due to ingest, it must do something differently

So basically, we think these previewers (and other external tools) should make sure to follow redirects.

qqmyers commented 4 years ago

If you're redirecting to S3 for downloads, you may be seeing a CORS issue unless you support that on S3.

scolapasta commented 4 years ago

Are you saying that the previewers already support redirects when calling the API? If so, sure we can also look re: cors on the s3 side.

qqmyers commented 4 years ago

I think they do because the browser does automatically. A CORS issue should be visible in the browser debug console, so you can tell before digging too far.

If you get details of what's needed at Amazon to enable CORS, let me know and I'll add it to the docs.

scolapasta commented 4 years ago

Aha, yes it is CORS: image

djbrooke commented 4 years ago

Thanks @qqmyers @scolapasta @kcondon - I've requested the Harvard LTS team to allow CORS for S3 on dataverse.harvard.edu. I'll close this and update the docs if this ends up being the solution.

djbrooke commented 4 years ago

LTS updated the CORS settings on Harvard Dataverse and we've since enabled the previewers. Will make a PR to the docs here when I have time.