Hello trying to access the api and I keep gettting a error like below:
Fatal error: Uncaught exception 'TMDbException' with message 'Server error on "http://api.themoviedb.org/3/movie//trailers?api_key=APIKEY&language=en": HTTP/1.1 503 Service Unavailable Age: 0 Content-Type: text/html; charset=utf-8 Date: Sat, 23 Feb 2013 20:00:09 GMT Retry-After: 0 Server: nginx Via: 1.1 varnish X-Cache: MISS X-Varnish: 642980785 X-Varnish-Sid: tm-v-p-1100 Content-Length: 418 Connection: keep-alive Error 503 Service Unavailable
Service Unavailable
Guru Meditation:
XID: 642980785
Varnish cache server
' in /var/www/master/TMDb2.php:870 Stack trace: #0 /var/www/master/TMDb2.php(243): TMDb->_makeCall('movie//trailers', Array) #1 /var/www/master/cache_image-trail in /var/www/master/TMDb2.php on line 870
Any information you can provided would be most appreciated.
Thanks
No trobeu una pel·lícula o una sèrie? Inicieu la sessió per a crear-la.
Desitgeu valorar o afegir aquest element a una llista?
No en sou membre?
Resposta per Travis Bell
el 24 i de 2013 a les 10:37 A.M.
Hi Dale,
There haven't been any reported issues with any other users nor our external monitoring which makes me think you might be tripping the request rate limiting. You can read about it here:
http://help.themoviedb.org/kb/general/api-request-limits
Resposta per Dale
el 24 i de 2013 a les 4:33 P.M.
Hello Travis,
Thank for getting back to me. OK this might explain the issue.
I will put some code into count the requests and see if I'm hitting this.
Thanks.
Dale
Resposta per Dale
el 2 l de 2013 a les 4:43 P.M.
Hello Travis,
I have put a cap on the requests to 10 every 10 seconds and I am still getting the error message.
Could I work with you in private message to see if It is something I am doing wrong.
Thanks,
Dale.
Resposta per frankglaser
el 19 l de 2013 a les 3:14 A.M.
Hello,
I pay attention to the request limit and run into the same problem. Any solution?
Thanks Frank
Resposta per Travis Bell
el 19 l de 2013 a les 10:55 A.M.
Hi Frank/Dale,
There are no reported issues with the API.
What are the requests you are making that throw the error?
I feel fairly confident that it pretty much has to be the rate limiting. Try limiting it more. It's not just "10 requests per second" it's "30 requests every 10 seconds", so you can burst to 30. If you use up those 30 before 10 seconds is up you will get an error until 10 seconds has passed which will reset the request counter.
Resposta per frankglaser
el 19 l de 2013 a les 11:55 A.M.
Hi Travis,
I limited the requests down to 20 requests every 12 seconds and printed the timestamps of the last requests to check it myself and the limit was not exceeded. The requests are done with a PHP script using curl. It utilizes several API functions: getMovie, getMovieTranslations, getMovieCast, getMovieTitles
I will check if it is always the same function which will return the error.
Resposta per Travis Bell
el 19 l de 2013 a les 12:13 P.M.
Ok, let me know.
P.S. Just in case you are indeed still using 2.1 (based on those method names…), 2.1 was deprecated over a year ago and will be on the chopping block soon. If you are developing an application now, it's a waste of your time to use anything but v3.
Resposta per frankglaser
el 19 l de 2013 a les 12:35 P.M.
No, it is based on V3, I've just copied the function names.
Actually I'm extending the PHP wrapper https://github.com/glamorous/TMDb-PHP-API to take care on the request limits. When it is working I will send it back to the developer.
Here are the results of the log files:
The Header is always:
The Content / Body is always:
Here the timestamps of the 20 requests per 12 seconds:
Resposta per Travis Bell
el 20 l de 2013 a les 3:57 P.M.
Hey Frank,
Mind privately emailing me your IP? I'm working with out ops guy to understand what's happening here and we can have a better insight with the IP that you're using. You can email me personally at travis [at] themoviedb.org
Also, are you hitting our production API directly (api.themoviedb.org) or are you going through Apiary?
Resposta per Travis Bell
el 21 l de 2013 a les 11:30 A.M.
Hey guys,
I think we've tracked this down. It is indeed a load issue that we will have to address on our side. We're looking into it and will update this thread once we've attempted to fix it. Thanks for finding this and also providing so much detail. Very helpful.
Resposta per Travis Bell
el 21 l de 2013 a les 3:50 P.M.
There's still some work to be done but can you give your script a try and see how you make out? We did make one change that we're hoping will help until we address another larger issue.
P.S. the limiting is slightly different than I explained earlier. This didn't change, I was simply wrong with the original information.
We limit the requests to 4 requests per second with an allowable burst of 40. We restrict your connections to 8 allowed per IP.
UPDATE @ 2:02 PM MST I'm pretty sure our little gap measure has no effect. I'll update you guys once the proper fix has gone been pushed live.
Resposta per Dale
el 21 l de 2013 a les 5:09 P.M.
Thank you frankglaser for helping proving it wasn't me going made.
Big thanks to Travis to looking into it in more detail. I currently do not have the script running as my servers are down for maintenance.
If the maintenance is finished tomorrow I will start one and see what happens.
Just want to be clear with the limits. If i have a loop that is using your site and requesting 10 movies every 10 seconds i shouldn't hit the request limit.
thanks
Dale.
Resposta per frankglaser
el 22 l de 2013 a les 4:32 A.M.
Thanks for Your support Travis. I have adapted the script to handle 4 requests per second and just started it.
Can You explain, how the bursts are handled. For e.g. is one burst allowed per hour?
Resposta per Carlo
el 22 l de 2013 a les 7:11 A.M.
I'm getting the 503 error as well, but I'm pretty sure the script isn't tripping the request limits. Sometimes with the "Guru Meditation: XID: xxxxxx" message below it, sometimes without.
Resposta per frankglaser
el 22 l de 2013 a les 7:46 A.M.
I tried it a few times and still getting the 503 errors.
Here are the timestamps of the 4 requests per 1 second tests:
Because of the timestamps, it doesn't look like the script reaches the request limitation.
Is there any way to differ between the connection and request limit?