igvteam/juicebox.js

Cannot load public Google Cloud Storage URL

Closed this issue · 5 comments

Hello,

I'm trying to visualize a hic file living on Google Cloud Storage. After making the object publicly readable I copied the public URL and pasted it in via Load Map > URL. However, a dialog box popped up containing the following error (I've truncated the full path for legibility):

Error loading https://storage.googleapis.com/path/file.hic: Error accessing resource: https://storage.googleapis.com/path/file.hic?altMedia=true&key=AIzaSyBzAhlusZQCoMMV4dHS548t60qz6OJgTtE&someRandomSeed=0.cy3cfhjqqwr Status: 0

Upon submitting the URL I am also prompted to log into Google via a pop up which is a little odd, since the URL is public I wouldn't expect to have to log in. Any insight would be appreciated.

Thanks,

Paul

@paul-sud If you can share the public URL I will look into it.

This repository is for the juicebox.js component, which supports Google access but only if the embedding site does. You didn't state where you were trying this from, but I will assume it was aidenlab.org.

It looks like that bucket does not have CORS configured, in other words it does not allow access from other hosts (other than storage.google.apis, aidenlab.org for example). CORS is configured for most public GCS repositories, but I guess its not by default. I found this by by web search, there is lots of information on CORS available on the web: https://cloud.google.com/storage/docs/configuring-cors

If you can configure CORS for that bucket it should work, there's nothing the client (juicebox.js) can do about this.

BTW the reason the login popups up is it interprets the load failure as an authorization failure, but logging in doesn't help since the underlying problem is CORS permissions. I will see if anything can be done to present a more informative error. This is difficult because the client (juicebox.js) is given no information in a CORS failure, probably to prevent someone from hacking around it.

Ah makes sense, thanks for the help. After enabling CORS on the bucket I was able to visualize the file.