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

REST APIs broken for LOVD, depending on the internal method used to call it #628

Open
ifokkema opened this issue Jun 24, 2024 · 2 comments

Comments

@ifokkema
Copy link
Collaborator

Describe the bug
Depending on the internal method used by LOVD to call the APIs, they are now broken. Although I can't confirm that I've always used the same internal method to talk to the VV API, I do believe this problem highlights a configuration error in the server.

To Reproduce
Steps to reproduce the behavior:

  1. When LOVD, for example, calls this URL: https://rest.variantvalidator.org/VariantValidator/variantvalidator/GRCh38/NM_006015.4%3Ac.4811C%3ET/all?content-type=application%2Fjson, the server responds with a HTTP 308 PERMANENT REDIRECT to http://rest.variantvalidator.org/VariantValidator/variantvalidator/GRCh38/NM_006015.4:c.4811C%3ET/all/?content-type=application%2Fjson. Note that the https is gone, but also that a slash has been appended to the URL (which is likely the reason for the forward).
  2. Although this forward already breaks the API (because some internal connectors don't follow redirects by default, apparently), requesting the URL referred to generates yet another redirect: HTTP 302 Found to https://rest.variantvalidator.org/VariantValidator/variantvalidator/GRCh38/NM_006015.4:c.4811C%3eT/all/?content-type=application/json, restoring the https.

Expected behavior

  • In general, I feel the redirect doesn't need to be there at all. Not all API clients (well, us, apparently) support redirects.
  • If it can't be helped, then it should at least redirect to https, so we won't have to process two redirects.

In the meantime, I'll enforce respecting redirects in LOVD to unbreak the APIs.

@ifokkema
Copy link
Collaborator Author

Now, the hello service (what LOVD uses to test the connection) is broken; it returns an HTTP 500.

https://rest.variantvalidator.org/hello/?content-type=application%2Fjson

GET https://rest.variantvalidator.org/hello?content-type=application%2Fjson
308 PERMANENT REDIRECT
GET http://rest.variantvalidator.org/hello/?content-type=application%2Fjson
302 Found
GET https://rest.variantvalidator.org/hello/?content-type=application/json
500 Internal Server Error
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache Server at rest.variantvalidator.org Port 80</address>
</body></html>

ifokkema added a commit to LOVDnl/LOVD3 that referenced this issue Jul 3, 2024
VV never used to redirect us, but now, it does. Reported it to VV,
 but also updated the code in case they keep it.
See: openvar/variantValidator#628
@Peter-J-Freeman
Copy link
Collaborator

Ah, this was ab accidental bug. Will be bringing back the old method later this week. Should not have happened. So will be reverted. Sorry about that

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

2 participants