Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5Web (NetCDF) previewer issue #73

Open
meghangoodchild opened this issue Jun 25, 2024 · 5 comments
Open

H5Web (NetCDF) previewer issue #73

meghangoodchild opened this issue Jun 25, 2024 · 5 comments

Comments

@meghangoodchild
Copy link

Borealis recently upgraded to version 6.2 and we installed the new previewers.

We are having trouble configuring the NetCDF previewer. When attempting to preview, an error message appears that says "something went wrong with the request." We're unable to determine the issue.

Please see the screenshots below.

image

2024-06-25_10-38-55

@pdurbin
Copy link
Member

pdurbin commented Jul 8, 2024

@meghangoodchild hi! I tried going to https://test.borealisdata.ca but it says my IP is blocked. Would you be able to unblock me so I can troubleshoot? My IP is 65.112.8.49.

@meghangoodchild
Copy link
Author

@pdurbin - sorry about that! We've added the test files to our demo environment. You can see them here: https://demo.borealisdata.ca/dataset.xhtml?persistentId=doi:10.80240/FK2/GNCJZ5

Please let us know if you have any other questions.

@pdurbin
Copy link
Member

pdurbin commented Aug 23, 2024

Me again. I think this is a problem in Harvard Dataverse too.

I checked https://dataverse.harvard.edu/file.xhtml?fileId=6987711&datasetVersionId=342792 and the NcmlPreview doesn't work.

It has a callback URL but I also tried a vanilla version which also fails: https://gdcc.github.io/dataverse-previewers/previewers/v1.4/NcmlPreview.html?siteUrl=https://dataverse.harvard.edu&fileid=6987711&datasetid=6987552&datasetversion=1.0

Maybe I have something wrong. Not sure. Needs more investigation, I'm afraid. 🫤

@pdurbin
Copy link
Member

pdurbin commented Feb 27, 2025

Two things. Now that I'm looking at this closer I see that @meghangoodchild is reporting problems with hdf5.js, which is the "displayName":"H5Web" previewer.

After talking to @cmbz just now about how this previewer isn't installed on Harvard Dataverse, I tried installing it on https://demo.dataverse.org . Here's the command I used:

curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
  "displayName":"H5Web",
  "description":"Explore and visualize HDF5 files",
  "toolName":"HDF5Preview",
  "scope":"file",
  "types":["preview"],
  "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/HDF5Preview.html",
  "toolParameters": {
      "queryParameters":[
        {"fileid":"{fileId}"},
        {"siteUrl":"{siteUrl}"},
        {"datasetid":"{datasetId}"},
        {"datasetversion":"{datasetVersion}"},
        {"locale":"{localeCode}"}
      ]
    },
  "contentType":"application/netcdf",
  "allowedApiCalls": [
    {
      "name": "retrieveFileContents",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
      "timeOut": 3600
    },
    {
      "name": "downloadFile",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
      "timeOut": 3600
    },
    {
      "name": "getDatasetVersionMetadata",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
      "timeOut": 3600
    }
  ]
}'

I'm getting the same Axios error @meghangoodchild is reporting. Here's a screenshot from a file at https://demo.dataverse.org/file.xhtml?persistentId=doi:10.70122/FK2/DKHR2D/JQ7TS3&version=2.0

Image

@meghangoodchild I'm going to rename this issue to be about the H5Web, specifically. We'd like to demo it ( IQSS/dataverse.harvard.edu#336 ) and unfortunately, it isn't working.

@JR-1991 you added the H5Web previewer in #35 . Any ideas what might be wrong? 😅

The OTHER NetCDF previewer we have is the NcML previewer, which I confusedly talked about above. We are aware that this is broken in version 1.4. @qqmyers fixed it in the "betatest" version in 39a9fab for this issue:

@qqmyers
Copy link
Member

qqmyers commented Feb 27, 2025

My guess is it's similar to the NcML issue - when using signedUrls, the HDF preview is looking for query params that don't exist.

The fix is probably modifying lines around

// Parse URL parameters
const queryString = window.location.search
const urlParams = new URLSearchParams(queryString)
const fileID = urlParams.get('fileid') || ''
const APIToken = urlParams.get('apiToken') || ''
let siteURL = urlParams.get('siteUrl') || ''
to get the queryParams differently - not sure if the same fix as for ncml works in a react app or not.

A work-around would be to use an api key for the preview.

@pdurbin pdurbin changed the title NetCDF previewer issue H5Web (NetCDF) previewer issue Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants