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
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de Travis Bell
le 24 février 2013 à 10h37
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
Réponse de Dale
le 24 février 2013 à 16h33
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
Réponse de Dale
le 2 mars 2013 à 16h43
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.
Réponse de frankglaser
le 19 mars 2013 à 03h14
Hello,
I pay attention to the request limit and run into the same problem. Any solution?
Thanks Frank
Réponse de Travis Bell
le 19 mars 2013 à 10h55
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.
Réponse de frankglaser
le 19 mars 2013 à 11h55
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.
Réponse de Travis Bell
le 19 mars 2013 à 12h13
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.
Réponse de frankglaser
le 19 mars 2013 à 12h35
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:
Réponse de Travis Bell
le 20 mars 2013 à 15h57
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?
Réponse de Travis Bell
le 21 mars 2013 à 11h30
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.
Réponse de Travis Bell
le 21 mars 2013 à 15h50
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.
Réponse de Dale
le 21 mars 2013 à 17h09
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.
Réponse de frankglaser
le 22 mars 2013 à 04h32
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?
Réponse de Carlo
le 22 mars 2013 à 07h11
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.
Réponse de frankglaser
le 22 mars 2013 à 07h46
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?