googleads / googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP
Apache License 2.0
656 stars 768 forks source link

Weird fatal error #308

Closed vovan47 closed 7 years ago

vovan47 commented 7 years ago

Hi Knack!

That's me with heavy long-running scripts again! Actually I managed to optimize them with your help and get rid of FD leak and memory leak (that was mostly Doctrine misuse, not your library). Script was performing stable for couple of weeks. But suddenly I got this:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Google\AdsApi\AdWords\AdWordsNormalizer::isOneOrMany() must be of the type array, null given, called in /xxx/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201705/ReportDownloader.php on line 145 and defined in /xxx/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsNormalizer.php:281
Stack trace:
#0 /xxx/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201705/ReportDownloader.php(145): Google\AdsApi\AdWords\AdWordsNormalizer::isOneOrMany(NULL)
#1 /xxx/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201705/ReportDownloader.php(117): Google\AdsApi\AdWords\Reporting\v201705\ReportDownloader->makeReportRequest(Array)
#2 /xxx/application/Modules/marketingengine/src/Service/NewAdwords/NewAdwordsReportService.php(431): Google\AdsApi\AdWords\Reporting\v201705\ReportDownloader->downloadRep in /xxx/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsNormalizer.php on line 281

My script goes through hundreds of accounts and downloads report with downloadReportWithAwql method. How is that error possible and what could I do to fix it? Again, it occured randomly once per two weeks and I don't know what specifially could cause it, maybe some environment conditions at that moment. Could you give me some clue where to dig in?

Thanks, Vladimir.

fiboknacky commented 7 years ago

Hello Vladimir,

Glad that you can solve many issues along the way. :)

By the way, regarding this one, could you please confirm two things for me?

Thanks in advance!

Best, Knack

vovan47 commented 7 years ago

Hi Knack,

I've sent some logs to adwordsapiadvisor+thanet@google.com. From what I got, it looks like that this error most likely happens when server response is 404 Not Found. Investigating the variable will take some time, I'll let you know. But maybe it will be possible to reproduce it with data from logs?

Thanks. Vladimir.

fiboknacky commented 7 years ago

Hello Vladimir,

Sorry for taking long time before getting back to you. I've been trying to reproduce the issue, but wasn't faced with the same one as yours. Occasionally, I did face with an issue of "failed to open stream", which probably is because of the resource drain.

As I couldn't reproduce this, I'll close this for now. Feel free to reopen or file a new one if you find other issues.

Thanks! Knack