-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
On download, ensure resolve() endpoints exhaust all object locations #415
Comments
Moving comments from https://github.com/NCEAS/metacat/1407
|
Thanks for bringing the details in here. (2) doesn't sound too bad. Other ideas might be:
|
Yeah @amoeba - I like the negotiated |
More comments and ideas from a Slack thread: lauren 1:44 PM rossdm 1:45 PM chris: 1:48 PM lauren 1:48 PM chris: 1:49 PM lauren 1:50 PM chris: 1:51 PM lauren 1:52 PM chris: 1:54 PM davev 1:54 PM chris: 1:57 PM |
Bump. @laurenwalker - In the ESS-DIVE discussion today, this bug came up as a priority. Can we add this into a up and coming milestone? |
Ok, I added it to 2.12.0 |
This issue came up again today. A user tried to access a PNDB-hosted resource map through DataONE, but it failed because of the CORS config on PNDB. The resource is actually available through the CN, and the CN object url is listed in the
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:objectLocationList xmlns:ns2="http://ns.dataone.org/service/types/v1">
<identifier>resource_map_urn:uuid:2d9baf2c-62c8-41b2-9178-dd68af3b3379</identifier>
<objectLocation>
<nodeIdentifier>urn:node:PNDB</nodeIdentifier>
<baseURL>https://pndb.fr/metacat/d1/mn</baseURL>
<version>v1</version>
<version>v2</version>
<url>https://pndb.fr/metacat/d1/mn/v2/object/resource_map_urn:uuid:2d9baf2c-62c8-41b2-9178-dd68af3b3379</url>
</objectLocation>
<objectLocation>
<nodeIdentifier>urn:node:CN</nodeIdentifier>
<baseURL>https://cn.dataone.org/cn</baseURL>
<version>v1</version>
<version>v2</version>
<url>https://cn.dataone.org/cn/v2/object/resource_map_urn:uuid:2d9baf2c-62c8-41b2-9178-dd68af3b3379</url>
</objectLocation>
</ns2:objectLocationList> As pointed out earlier in this issue and confirmed again today with testing, there is unfortunately no way to access the
The solution makes sense for requesting resource maps, but still makes getting the URL for the download buttons complicated, as Lauren pointed out: the download functionality only sends XHR when the object is private. Otherwise, we just make an HTML link and just lets the browser handle it. |
Here is a summary of the suggested server-side solutions to this problem, in case the client-side solutions are not as feasible as we hope: 1. CN returns 200 with the
2. CN accepts custom header to skip 303 redirects
3. CN checks replica availability and re-prioritizes accordingly
4. CN accepts feedback from client and re-prioritizes accordingly
|
Here's a couple options:
others? |
|
for 5. - need to verify none of the existing MN or CN code relies on resolve response in text/xml. Might be better to have a custom content type, e.g. |
wrt responding to a custom header, this is where response status code is being set in d1_cn_rest: https://github.com/DataONEorg/d1_cn_rest/blob/0609c11d66605a60a297a2264ae58120c11eb371/src/main/java/org/dataone/cn/rest/v2/ResolveFilter.java#L307 |
We enable direct object downloads using the
Download
button in theMetadataView
, and the URLs in thedataone
theme default to CNresolve()
URL endpoints. This call returns a response body with aTypes.ObjectLocationList
payload, and an HTTP303
redirection code to the first URL in the object location list. If there is any failure on the redirected request, we need to catch the exception and iterate through the rest of theObjectLocationList
to try each replica URL until we succeed with the download. Only after exhausting the list should we show any sort of error message. Currently, we don't catch the error to provide a message - the browser just shows an error in the download status.We should also think about providing a configuration flag in all themes to request to use the CN resolve URL by default, or to just go straight to the MN
get()
endpoint.The text was updated successfully, but these errors were encountered: