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

Preserve helpful responses in cache #200

Open
jimallman opened this issue Oct 6, 2016 · 0 comments
Open

Preserve helpful responses in cache #200

jimallman opened this issue Oct 6, 2016 · 0 comments

Comments

@jimallman
Copy link
Member

Trying to browse to this taxon fails in the webapp: https://tree.opentreeoflife.org/opentree/opentree7.0@ott765489/Chrysomeloidea

If i copy the browser request as cURL, i just get the response ‘ERROR’. but if I bypass the cache, like so:

curl 'https://api.opentreeoflife.org/cached/v3/tree_of_life/subtree' -H 'Origin: https://tree.opentreeoflife.org' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: text/plain, */*; q=0.01' -H 'Cache-Control: max-age=0' -H 'Referer: https://tree.opentreeoflife.org/opentree/argus/opentree7.0@ott765489/Chrysomeloidea' -H 'Connection: keep-alive' --data-binary '{"synth_id":"opentree7.0","format":"arguson","height_limit":3,"node_id":"ott765489"}' --compressed
curl 'https://api.opentreeoflife.org/v3/tree_of_life/subtree' -H 'Origin: https://tree.opentreeoflife.org' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: text/plain, */*; q=0.01' -H 'Cache-Control: max-age=0' -H 'Referer: https://tree.opentreeoflife.org/opentree/argus/opentree7.0@ott765489/Chrysomeloidea' -H 'Connection: keep-alive' --data-binary '{"synth_id":"opentree7.0","format":"arguson","height_limit":3,"node_id":"ott765489"}' —compressed

… I get a more helpful error message:

{
  "message" : "Requested tree (25993 tips) is larger than currently allowed by this service (25000 tips). For larger trees, please download the full tree directly from: http://files.opentreeoflife.org/trees/",
  "exception" : "BadInputException",
  "fullname" : "org.neo4j.server.rest.repr.BadInputException",
  "stacktrace" : [ "opentree.plugins.tree_of_life_v3.doSubtree(tree_of_life_v3.java:715)", "opentree.plugins.tree_of_life_v3.subtree(tree_of_life_v3.java:563)", "java.lang.reflect.Method.invoke(Method.java:498)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:498)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)" ]
}

Looks like we need to preserve this information in the RAM cache (not sure why it was lost, perhaps a redirect?) and show a sensible response to the user. Currently the webapp wrongly reports the problem:

This taxon is in our taxonomy but not in our tree synthesis database. This can happen for a variety of reasons, but the most probable is that is has a taxon flag (e.g. incertae sedis) that causes it to be pruned from the synthetic tree. See the taxonomy browser for more information about this taxon.

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

1 participant