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
Non riesci a trovare un film o una serie Tv? Accedi per crearlo.
Vuoi valutare o aggiungere quest'elemento a una lista?
Non sei un membro?
Risposta da Travis Bell
il 24 febbraio, 2013 alle 10:37AM
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
Risposta da Dale
il 24 febbraio, 2013 alle 4:33PM
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
Risposta da Dale
il 2 marzo, 2013 alle 4:43PM
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.
Risposta da frankglaser
il 19 marzo, 2013 alle 3:14AM
Hello,
I pay attention to the request limit and run into the same problem. Any solution?
Thanks Frank
Risposta da Travis Bell
il 19 marzo, 2013 alle 10:55AM
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.
Risposta da frankglaser
il 19 marzo, 2013 alle 11:55AM
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.
Risposta da Travis Bell
il 19 marzo, 2013 alle 12:13PM
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.
Risposta da frankglaser
il 19 marzo, 2013 alle 12:35PM
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:
Risposta da Travis Bell
il 20 marzo, 2013 alle 3:57PM
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?
Risposta da Travis Bell
il 21 marzo, 2013 alle 11:30AM
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.
Risposta da Travis Bell
il 21 marzo, 2013 alle 3:50PM
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.
Risposta da Dale
il 21 marzo, 2013 alle 5:09PM
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.
Risposta da frankglaser
il 22 marzo, 2013 alle 4:32AM
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?
Risposta da Carlo
il 22 marzo, 2013 alle 7:11AM
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.
Risposta da frankglaser
il 22 marzo, 2013 alle 7:46AM
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?