Khan / khan-api

Documentation for (and examples of) using the Khan Academy API
http://www.khanacademy.org
377 stars 75 forks source link

API explorer 500 error on large API responses #115

Open trkrameshkumar opened 7 years ago

trkrameshkumar commented 7 years ago

500 error on topictree api

benjaminjkraft commented 7 years ago

Hi @trkrameshkumar,

We're aware of some general infrastructure issues affecting this endpoint. Are you consistently getting failures, or can you work around this by just retrying? Can you provide us with timestamps of exactly when you saw failures?

rootelement commented 7 years ago

We are seeing the same thing. 500 Error both in the API Explorer and in Postman. We're unable to get a response from Topictree, and Exercises https://gyazo.com/ed0858261bb6aa913de3dbc574d41298

benjaminjkraft commented 7 years ago

Hi all,

These endpoints both serve very large responses so we do sometimes have transient errors if you don't hit a cache. Can you work around this by retrying in case of a server error? It looks like we have a fairly small percentage of requests failing so that should generally work; while I'd certainly like to solve these problems I doubt we'll ever get the error rate to 0 given how much data we're returning in these endpoints.

rootelement commented 7 years ago

Can you give me an example request that succeeds? I'm unable to get a success from the exercises API given one or two filters. Such as this request: https://api-explorer.khanacademy.org/api/v1/exercises?edit=&tags=math%2Calgebra%2Cscientific_notation

benjaminjkraft commented 7 years ago

Ah! It looks like this is a bug in our API explorer, which is why I wasn't seeing many failures in our main logs. If you hit www.khanacademy.org it should work; we'll look into why the API explorer isn't working right.