Any way to get more details about "internal failure" errors reading gmail from googleapi?

时间:2015-10-30 21:27:10

标签: google-api-php-client gmail-api

I've run into a lot of cases where google's api yields a less-than-descriptive error message.

Now I'm getting this:

Google_Service_Exception Object
(
    [errors:protected] =>
    [message:protected] => {
 "error": "internal_failure",
 "error_description": "Backend Error"
}

I'm reading batches of 100 messages at a time with the php googleapi client listUsersMessages function call.

Interestingly, I notice that if I ask for a batch that's not a round mod 100 number, I get a result list rounded to 100. For example I ask for a batch size of 156 (just to test) and I get 100. That's just a side note. The real problem is everything works fine, until I get to some large number, like 8500, or 15000, and then I get the internal_failure error.

One thing I did notice, is that the exception object I get back from the php client is fantastically huge. Printed to my log file, it's 272162 lines long. There's a lot of repetition. There's many iterations of 85 array entries that look like this...

 [sorted:GuzzleHttp\Event\Emitter:private] => Array
      (
        [before] => Array
          (
             [0] => Array
                (
                  [0] => GuzzleHttp\Subscriber\Prepare Object
                      (
                      )
                  [1] => onBefore
                )
             [1] => Array
... this goes up  to 85 and then repeats all over again.

I'm thinking there's some object that needs to be reset somewhere because something is leaking in the api and after 85 calls, something on the google end blows up.

Am I missing some cleanup function call somewhere?

0 个答案:

没有答案