-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guzzle rewind_body() called with null Argument #246
Comments
I made some more investigations to check where this error comes from: We are downloading lots of KEYWORDS_PERFORMANCE_REPORTs segmented by metrics and device. From the 20 biggest files, only 18 could be downloaded with the new API, while it works well with the old API. A critical size seems to be more than 33MB. |
Hello @Code-Working Thank you for informing this! Could you please share your full report definition or SOAP logs of the reports that have this problem to adwordsapiadvisor@google.com? Cheers, |
Hello guys, @Code-Working do you find a solution ? i just make a "hard" workaround... i am trying to retry download not only on ApiException but also on Throwable. Sometimes it works. (I can reproduce this because my file is really big 113MB (csv.gz). ) I will send debug info from logs for @fiboknacky because my workaround is really not good.
|
Hello All, I've received some more info from @gitazem (thanks for that!), but couldn't reproduce the issue. I'd recommend to consider your query again if it produces too large results. As you may know, the And for:
I'll take a look at this. Cheers, |
Hello Knack, I wrote email again, tried to explain how to reproduce this. And for: Best, |
Hello Gita, Thanks for active communication. For the second issue, it's not so hard to fix but for the first one, it's still tricky. Best, |
Hello, Yes second issue is not hard to fix we will not get fatal errors, but what for it ? You will log error, but we still don't get results. We just ignore real problem. Best, |
Hi Gita, If at least we get error message, we can have more clues of what happened. By the way, for this second issue, could you please gather more information for me (e.g., by var_dump)? Thanks in advance. Cheers, |
Hello Gita, Thanks for more information. Best, |
Hello all, Could you please try setting the timeout options in $requestOptions['stream_context']['http']['timeout'] = "YOUR_TIMEOUT"; I've tested intensively so far, and it seems that when you download large reports, the default timeout in your system might not be enough to ensure complete communication between the servers and your application. The timeout settings of my two computers are quite different. The one that is faced with the issue has the settings as 60 seconds. Another computer has 480 seconds and is not faced with this issue. In the long run, I'd open this option settable via Cheers, |
Hello Knack, Yes, you are right. This helped. I had this in mind, but have not tested yet. Perfect! Now i created workaround while you will implement timeout option :
Thank you ! Best, |
Hello Gita, Thanks for confirming that it works. @Code-Working Could you please try this method and let me know if it works for you? Best, |
Hello, sorry I was on vacation. |
Hello again and sorry for the late response. I've tried out both solutions Both solutions are working and I'm able to download the reports now. In my special case it turned out that even 600 seconds are too short, increasing to 900 seems to be ok for now. I think I will increase it to 3600 seconds in production just to be sure. I also tried setting Best, |
Hi, i have the same problem. My exports are not big (less than 1k). Thanks |
Unfortunately, I don't know that either. As far as I know, PHP and Guzzle seem to behave quite differently between OSes and environments. So, adjusting the configs for each OS is quite necessary, in my opinion. |
I have this problem too and 'default_socket_timeout' solution is not working on my side.
|
Hi @davidcv91 How long did you set as the timeout? Cheers, |
Hi @fiboknacky I've tried both solutions with a timeout of 900, like @Code-Working explained on this comment:
Regards, |
@davidcv91 did you try setting it to 3600 seconds? |
Hi All, We've opened the way for providing custom request options for downloading reports in Cheers, |
From time to time I get the following exception:
Exception: Argument 1 passed to GuzzleHttp\Psr7\rewind_body() must implement interface Psr\Http\Message\MessageInterface, null given, called in /path-to-my-app/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/GuzzleLogMessageHandler.php on line 74 in [/srv/vhosts/com.ppcrocket.dashboard/app_dev/vendor/guzzlehttp/psr7/src/functions.php, line 274]
I can't reproduce why I'm getting this error, but setting
$response = null
in GuzzleLogMessageHandler.php, line 58-62 seems to be not so good idea since the rewind_body() function of Guzzle expects a MessageInterface and not null.Anyway, when I set the log level of all loggers to debug, the log message that comes immediately before the exception is the following:
[2017-02-22 15:06:59] AW_REPORT_DOWNLOADER.WARNING: my.server.com GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1 - [22/Feb/2017:15:06:59 +0000] "POST /api/adwords/reportdownload/v201609 HTTP/1.1" NULL NULL
An "normal" log message would look like this:
[2017-02-22 15:05:32] AW_REPORT_DOWNLOADER.INFO: my.server.com GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1 - [22/Feb/2017:15:05:32 +0000] "POST /api/adwords/reportdownload/v201609 HTTP/1.1" 200 33836193
I'm just guessing that either the AdWords server takes too long to respond or does not respond at all.
Regards
Code-Working
The text was updated successfully, but these errors were encountered: