asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
544 stars 152 forks source link

$entry->update() fails #132

Closed gustvao closed 8 years ago

gustvao commented 8 years ago

Hey, first of all congrats for the wrapper, it has helped me a lot.

Once in a while it happens that the update fails, I managed to reproduce the error and get the output..

Could you pls help me understand why? Do you need any extra info?

object(Google\Spreadsheet\Exception)#703 (7) {
  ["message":protected]=>
  string(23) "Error in Google Request"
  ["string":"Exception":private]=>
  string(0) ""
  ["code":protected]=>
  int(409)
  ["file":protected]=>
  string(134) "/home/gustvao/coding/php/boleto-pontotel/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php"
  ["line":protected]=>
  int(285)
  ["trace":"Exception":private]=>
  array(3) {
    [0]=>
    array(6) {
      ["file"]=>
      string(134) "/home/gustvao/coding/php/boleto-pontotel/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php"
      ["line"]=>
      int(201)
      ["function"]=>
      string(7) "execute"
      ["class"]=>
      string(40) "Google\Spreadsheet\DefaultServiceRequest"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        resource(18) of type (curl)
      }
    }
    [1]=>
    array(6) {
      ["file"]=>
      string(122) "/home/gustvao/coding/php/boleto-pontotel/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ListEntry.php"
      ["line"]=>
      int(97)
      ["function"]=>
      string(3) "put"
      ["class"]=>
      string(40) "Google\Spreadsheet\DefaultServiceRequest"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(2) {
        [0]=>
        string(129) "https://spreadsheets.google.com/feeds/list/1qK9hIbIICReN4tNAbxRzy8aFDX7OGjImMqq3t3OC7g8/oupk8vz/private/full/df9om/39necd7lc3jb6i"
        [1]=>
        string(418) "https://spreadsheets.google.com/feeds/list/1qK9hIbIICReN4tNAbxRzy8aFDX7OGjImMqq3t3OC7g8/oupk8vz/private/full/df9om"
      }
    }
    [2]=>
    array(6) {
      ["file"]=>
      string(52) "/home/gustvao/coding/php/boleto-pontotel/boletos.php"
      ["line"]=>
      int(132)
      ["function"]=>
      string(6) "update"
      ["class"]=>
      string(28) "Google\Spreadsheet\ListEntry"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        array(4) {
          ["bdenv"]=>
          string(10) "ENVIADO-22"
          ["vencorig"]=>
          string(10) "03/28/2016"
          ["venc"]=>
          string(10) "03/28/2016"
          ["total"]=>
          float(40.89)
        }
      }
    }
  }
  ["previous":"Exception":private]=>
  NULL
}
asimlqt commented 8 years ago

Hi Gustavo,

Is this still an issue for you?

Some more info would definitely be useful:

  1. Is there any way of reliably reproducing this error or does it just happen randomly? If I can reproduce it then it will be much easier for me to debug it.
  2. Can you provide the source code which causes this error?
gustvao commented 8 years ago

@asimlqt $entry->update method is definetly not reliable but I ended up resolving this by using batchUpdate as suggested in docs... never had an error again