OpenTreeOfLife / feedback

No code -- just an issue tracker for general feedback (sent here via GitHub's issues API)
1 stars 0 forks source link

Server error 500 #420

Closed wellcaffeinated closed 6 years ago

wellcaffeinated commented 6 years ago

I've been getting 500 errors recently (within the last week). I haven't changed anything on my end.

Here's the request/response data from chrome devtools:

Request URL: https://api.opentreeoflife.org/v3/tree_of_life/node_info Request Method: OPTIONS Status Code: 500 Internal Server Error Remote Address: 34.221.232.64:443 Referrer Policy: no-referrer-when-downgrade Connection: close Content-Length: 110 Content-Type: text/plain Date: Thu, 13 Sep 2018 20:06:06 GMT Server: waitress Provisional headers are shown Access-Control-Request-Headers: content-type Access-Control-Request-Method: POST DNT: 1 Origin: http://wellcaffeinated.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

jimallman commented 6 years ago

Just to note the nearly-obvious, this appears to be an error on the CORS "preflight" request before the true API method call. Strange...

wellcaffeinated commented 6 years ago

Yes, odd. But it was working last week. No changes...

mtholder commented 6 years ago

We did redeploy the back-end server software this week, so that is the likely culprit...

@bredelings , can you look into this?

bredelings commented 6 years ago

It looks like there may be some problem with the formatting of the JSON you were sending.  I think I've fixed it to give a reasonable response:

$ curl -X POST https://api.opentreeoflife.org/v3/tree_of_life/subtree -d '{"yo' [/v3/tree_of_life/subtree] Error: Could not parse body of call as JSON.

I guess this raises the question: do you think your JSON is OK?

The time of the error was really helpful; it allowed me to find a trace in the log for the python wrapper. The problem was in get_json_or_none( ). For some reason "except json.decoder.JSONDecodeError" doesn't work on api, although it does locally.  I changed this to "except ValueError:" and now it works.

-BenRI

On 09/13/2018 06:04 PM, Mark T. Holder wrote:

We did redeploy the back-end server software this week, so that is the likely culprit...

@bredelings https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_bredelings&d=DwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=-917dFNSkAENPyKsb02Ab0bD9u9pj8-AdDJ5OuiW_fQ&s=_rJuXH6w1xdxaGjEkuojDU7aW-DLZ08Wn7gnwUxUw_k&e= , can you look into this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenTreeOfLife_feedback_issues_420-23issuecomment-2D421167800&d=DwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=-917dFNSkAENPyKsb02Ab0bD9u9pj8-AdDJ5OuiW_fQ&s=FKc7QS_pRhNCIvdhFwoX7c8NSYAgBiTHB4nvulzGZOE&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAIj7NMpubFVgcrRaUmfQx9J8wYmMrCHks5uatZegaJpZM4WoH3b&d=DwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=-917dFNSkAENPyKsb02Ab0bD9u9pj8-AdDJ5OuiW_fQ&s=yhbRp_EukkD7_QsPseWyjnJ46wJuz__6qPgPaUAmTd4&e=.

mtholder commented 6 years ago

We should be catching this exception and reporting some 400-type error, or 200 if we want to allow incorrect JSON with the OPTIONS verb. Treemachine was probably just more lenient and allowed it. I don't see the harm in doing that...

wellcaffeinated commented 6 years ago

It seems to be working now. I'm not sure about the json. It should be correct though...

On Fri, Sep 14, 2018, 12:55 Mark T. Holder notifications@github.com wrote:

We should be catching this exception and reporting some 400-type error, or 200 if we want to allow incorrect JSON with the OPTIONS verb. Treemachine was probably just more lenient and allowed it. I don't see the harm in doing that...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenTreeOfLife/feedback/issues/420#issuecomment-421420180, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE552zSZzHHaBlZtkoYWVEKqgabmF26ks5ua9-JgaJpZM4WoH3b .

bredelings commented 6 years ago

OK, glad to here things are working.  In retrospect, I don't think there was any reason to think the JSON is bad.

Let us know if you have any more questions! :-)

-BenRI

On 09/14/2018 07:00 PM, Jasper wrote:

It seems to be working now. I'm not sure about the json. It should be correct though...

On Fri, Sep 14, 2018, 12:55 Mark T. Holder notifications@github.com wrote:

We should be catching this exception and reporting some 400-type error, or 200 if we want to allow incorrect JSON with the OPTIONS verb. Treemachine was probably just more lenient and allowed it. I don't see the harm in doing that...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub

https://github.com/OpenTreeOfLife/feedback/issues/420#issuecomment-421420180, or mute the thread

https://github.com/notifications/unsubscribe-auth/ABE552zSZzHHaBlZtkoYWVEKqgabmF26ks5ua9-JgaJpZM4WoH3b .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenTreeOfLife_feedback_issues_420-23issuecomment-2D421505480&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=_OC1QYgXkBeS6OzxJOVQKeiavF-DLwi-wG3WUZux4_Q&s=e7cfs4U7v8KsIFiCNDfAMm2ddIApreXl2wT0EfUtNh4&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAIj7IHoF3MMwlh5FiDj9xJCJK73xVIPks5ubDTygaJpZM4WoH3b&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=_OC1QYgXkBeS6OzxJOVQKeiavF-DLwi-wG3WUZux4_Q&s=68IozxWKWrONTkGcDc-0OzQT7x0DG6yYaEIvAOFN_NI&e=.

wellcaffeinated commented 6 years ago

Thanks!

On Sat, Sep 15, 2018, 12:03 Benjamin Redelings notifications@github.com wrote:

OK, glad to here things are working. In retrospect, I don't think there was any reason to think the JSON is bad.

Let us know if you have any more questions! :-)

-BenRI

On 09/14/2018 07:00 PM, Jasper wrote:

It seems to be working now. I'm not sure about the json. It should be correct though...

On Fri, Sep 14, 2018, 12:55 Mark T. Holder notifications@github.com wrote:

We should be catching this exception and reporting some 400-type error, or 200 if we want to allow incorrect JSON with the OPTIONS verb. Treemachine was probably just more lenient and allowed it. I don't see the harm in doing that...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub

< https://github.com/OpenTreeOfLife/feedback/issues/420#issuecomment-421420180 , or mute the thread

< https://github.com/notifications/unsubscribe-auth/ABE552zSZzHHaBlZtkoYWVEKqgabmF26ks5ua9-JgaJpZM4WoH3b

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenTreeOfLife_feedback_issues_420-23issuecomment-2D421505480&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=_OC1QYgXkBeS6OzxJOVQKeiavF-DLwi-wG3WUZux4_Q&s=e7cfs4U7v8KsIFiCNDfAMm2ddIApreXl2wT0EfUtNh4&e=>,

or mute the thread < https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAIj7IHoF3MMwlh5FiDj9xJCJK73xVIPks5ubDTygaJpZM4WoH3b&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=yDQgdhRIVlGWlo1dehDX4FDHdLhgFHI_XNBo6vRcIuw&m=_OC1QYgXkBeS6OzxJOVQKeiavF-DLwi-wG3WUZux4_Q&s=68IozxWKWrONTkGcDc-0OzQT7x0DG6yYaEIvAOFN_NI&e= .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenTreeOfLife/feedback/issues/420#issuecomment-421591788, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE557kZ_2Ehc9HMHItnQI8JHEsSDIxBks5ubSTmgaJpZM4WoH3b .

wellcaffeinated commented 6 years ago

Hmm... it started doing the same thing again just now.

Request URL: https://api.opentreeoflife.org/v3/tree_of_life/node_info
Request Method: OPTIONS
Status Code: 500 Internal Server Error
Remote Address: 34.221.232.64:443
Referrer Policy: no-referrer-when-downgrade
Connection: close
Content-Length: 78
Content-Type: text/html; charset=UTF-8
Date: Mon, 17 Sep 2018 18:12:41 GMT
Server: waitress
Provisional headers are shown
Access-Control-Request-Headers: content-type
Access-Control-Request-Method: POST
Origin: http://localhost:8080
Referer: http://localhost:8080/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3554.0 Safari/537.36

Response

Error: could not connect to 'http://localhost:1984/v3/tree_of_life/node_info'

mtholder commented 6 years ago

We had some issues with the deployment of the fix (and the redirections on the servers side were not working for a few minutes). I think it is fixed and the deployment is now working... sorry for the repeated errors.

bredelings commented 6 years ago

It is still a 500 error, but not for the same reason.

Port 1984 is where the otcetera server runs. When we restart it, you'll see this message for a minute until if reloads. If you see this for longer than about a minute, then if might actually be down.

Hmm... I suppose we could add an explanation to the "can't connect" message, like "Please wait for a minute and try again, you might have caught us in the middle of restarting the API server."

jar398 commented 6 years ago

Sounds like 503 would be the machine readable version of that situation. But human readable is good too.