Skip to content

fix: route worms taxa provider through Fast WoRMS to avoid 500s - #36

Closed
jacobptnguyen wants to merge 1 commit into
fathomnet:mainfrom
jacobptnguyen:fix/taxa-worms-provider-500
Closed

jacobptnguyen wants to merge 1 commit into
fathomnet:mainfrom
jacobptnguyen:fix/taxa-worms-provider-500

Conversation

@jacobptnguyen

Copy link
Copy Markdown

The worms taxa provider returns a 500 error for any rank other than genus (species, family, etc.). This routes worms queries through the existing fathomnet.api.worms client instead, which handles every rank correctly. Other providers are unchanged.

The worms taxa provider returns a 500 error for any rank other than genus (species, family, etc.). This routes worms queries through the existing fathomnet.api.worms client instead, which handles every rank correctly. Other providers are unchanged.
@kevinsbarnard

Copy link
Copy Markdown
Member

Hi @jacobptnguyen , thanks for the contribution! Can you give me some more details on the calls that are giving you 500s?

By the way, the fathomnet taxonomy provider is already doing this; the taxa endpionts in the FathomNet Database REST API are simply adapter proxies for different taxonomy services. The fathomnet one targets the Fast WoRMS API served at https://database.fathomnet.org/worms/.

@hohonuuli

Copy link
Copy Markdown
Member

@jacobptnguyen Can you provide example code the duplicates the error?

@hohonuuli

Copy link
Copy Markdown
Member

@kevinsbarnard From the server logs, my guess is that Jacob was trying to get a very large taxa branch from the server. Since everything was running in memory, I was using Vert.x event loop for all calls. But building the JSON for large branches takes a relatively long time (> 2000 ms), so Vert.x was killing the response. I've moved the taxa calls to their own worker pool of threads. (See PR fathomnet/worms-server#15) So this seems to address any issues from the worms-server itself.

Test case

curl -X 'GET' \
  'http://database.fathomnet.org:8888/taxa/descendants/Animalia' \
  -H 'accept: application/json' > Desktop/Animalia.json

Runs in about 6 seconds on my 10G connection and creates a 121.6MB file.

Followup

If Jacob provides sample code that still produces the error we can investigate further.

@jacobptnguyen

Copy link
Copy Markdown
Author

Hey @kevinsbarnard and @hohonuuli, I was trying to solve issue #35. The issue said that taxa.find_taxa("worms", "MYCTEROPERCA MICROLEPIS") returns 500.

@hohonuuli

Copy link
Copy Markdown
Member

@jacobptnguyen Thanks for your contribution, it’s very much appreciated. I investigated the root cause in #35 and have fixed it in the upstream REST API we use to retrieve data from WoRMS, which is the most appropriate place for the change.

Since the issue is now resolved upstream, I’ll close this pull request without merging it.

@hohonuuli hohonuuli closed this Sep 11, 2026
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

Successfully merging this pull request may close these issues.

3 participants