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

Getting "HTTP 500: Internal Server Error - Server got itself in trouble" when taxon names have single quotes in them #84

Closed
salix-d opened this issue Apr 26, 2022 · 2 comments
Labels
API-related API-side problem needing work around
Milestone

Comments

@salix-d
Copy link
Collaborator

salix-d commented Apr 26, 2022

Seems like the Taxonomy API server can't handle single quotes characters.

  • curl::curl_escape : Server doesn't return error, but also doesn't return the record(s).
  • \' : same error
  • \\' : returns record(s)
> bold::bold_tax_name("Chlamydomonas sp. 'Chile J'")
Error: Internal Server Error (HTTP 500)
> bold::bold_tax_name(curl::curl_escape("Chlamydomonas sp. 'Chile J'"))
                                  input
1 Chlamydomonas%20sp.%20%27Chile%20J%27
> bold::bold_tax_name("Chlamydomonas sp. \'Chile J\'")
Error: Internal Server Error (HTTP 500)
> bold::bold_tax_name("Chlamydomonas sp. \\'Chile J\\'")
    taxid                      taxon tax_rank tax_division parentid    parentname specimenrecords                           input
1 1082557 Chlamydomonas sp. 'Chile J  species      Plantae   440637 Chlamydomonas               1 Chlamydomonas sp. \\'Chile J\\'

The arguments should be checked for single quotes and fixed before building the URL(s).

@salix-d salix-d added bug Something to fix API-related API-side problem needing work around and removed bug Something to fix labels Apr 26, 2022
@salix-d salix-d added this to the v1.3.0 milestone Mar 2, 2023
@salix-d
Copy link
Collaborator Author

salix-d commented Mar 2, 2023

related: #85 (comment)

salix-d added a commit that referenced this issue Mar 4, 2023
update to assert to be able to check params needing not to be empty or needing to be of length one.
update to setread to be able to add more options if needed.
new function to fix taxon names with single quotes or ending with a parenthesis or dot. see issues #84 & #85
@salix-d
Copy link
Collaborator Author

salix-d commented Mar 6, 2023

Made a check and fix function to fix this and the problem with names ending with a dots (sp.) or closing parenthesis (#85).
Will contact bold to let them know.

@salix-d salix-d closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API-related API-side problem needing work around
Projects
None yet
Development

No branches or pull requests

1 participant