getReportJob - Failed to load response into DOM

799 views
Skip to first unread message

jbickum

unread,
Feb 12, 2014, 1:42:13 PM2/12/14
to google-doubleclick...@googlegroups.com
Hi Team,

Seeing random issues lately loading responses into DOM and HTTP fetch errors.  This example occurred in the last hour within a minute of the process beginning.  The process executing the report fetch has built-in sleeps to wait out potentially large reports.  In this instance our process ran long enough to check the job status once, slept 30 seconds, and returned these errors after checking the job status a second time.

Any insights greatly appreciated - thanks!
 Jason

SOAP Log XML:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Content-Encoding: gzip
Date: Wed, 12 Feb 2014 18:00:17 GMT
Expires: Wed, 12 Feb 2014 18:00:17 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 276
Server: GSE
Alternate-Protocol: 443:quic

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <ResponseHeader xmlns="https://www.google.com/apis/ads/publisher/v201306">
      <requestId>0c130b90c74c76d2964daee73f8eb829</requestId>
      <responseTime>163</responseTime>
    </ResponseHeader>
  </soap:Header>
  <soap:Body>
    <getReportJobResponse xmlns="https://www.google.com/apis/ads/publisher/v201306">
      <rval>
        <id>1641516949</id>
        <reportJobStatus>IN_PROGRESS</reportJobStatus>
      </rval>
    </getReportJobResponse>
  </soap:Body>
</soap:Envelope>


Output:

Notice:  Failed to load response into DOM: DOMDocument::loadXML() [[1]domdocument.loadxml]: Empty string supplied as input in /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 250

Notice:  Failed to load response into DOM: DOMDocument::loadXML() [[2]domdocument.loadxml]: Empty string supplied as input in /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 360

Notice:  Failed to load response into DOM: DOMDocument::loadXML() [[3]domdocument.loadxml]: Empty string supplied as input in /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 378

Fatal error:  Uncaught SoapFault exception: [HTTP] Error Fetching http body, No Content-Length, connection closed or chunked data in /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:196
Stack trace:
#0 /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(196): SoapClient->__doRequest('<?xml version="...', 'https://www.goo...', '', 1)
#1 [internal function]: AdsSoapClient->__doRequest('<?xml version="...', 'https://www.goo...', '', 1, 0)
#2 /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(218): SoapClient->__soapCall('getReportJob', Array, NULL, Array, Array)
#3 /v201306/src/Google/Api/Ads/Dfp/v201306/ReportService.php(2689): AdsSoapClient->__soapCall('getReportJob', Array)
#4 /mtc_v2/master_import_from_report.php(338): ReportService->getReportJob('1641516949')
#5 {main}
  thrown in /v201306/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 196


Vincent Tsao (DFP API Team)

unread,
Feb 13, 2014, 2:17:21 PM2/13/14
to google-doubleclick...@googlegroups.com
Hello:

That report seems to have completed correctly according to our logs. Can you send me the PHP code you're writing that is running and polling for the status of this report and I'll take a look?

Also, have you been able to reproduce it since then? Or is it still occurring randomly?

Thanks,
Vincent Tsao, DFP API Team

Andre de Souza

unread,
Feb 14, 2014, 9:55:33 AM2/14/14
to google-doubleclick...@googlegroups.com
I am getting the same error, for the same API version v201306. This same call occurs in a batch process for a number of line-items, I noticed that the failures seem random -in other words line-items same line-items are not consistently failing, different ones fail each day.

Vincent Tsao (DFP API Team)

unread,
Feb 14, 2014, 1:15:07 PM2/14/14
to google-doubleclick...@googlegroups.com
Can one of you send me the PHP code you're using to run the report and I'll see if I can reproduce it on my side?

Thanks,
Vincent Tsao, DFP API Team


Andre de Souza

unread,
Feb 18, 2014, 3:05:16 PM2/18/14
to google-doubleclick...@googlegroups.com
Hi Vincent,

    The typical code pattern where this occurs if the following;

CODE
$lineitemService = $this->dfp->GetService('LineItemService', $this->version);
$lineitem = $lineitemService->getLineItem($lineitem_id);

LOG
2014-02-16 03:02:56 AM [DEBUG] [ip: cron, file: controllers/cronjob.php, line: 691] Error Fetching http body, No Content-Length, connection closed or chunked data
#0 /usr/local/shiny/sa/models/dfp_api_php_2.17.1/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(194): SoapClient->__doRequest('<?xml version="...', 'https://www.goo...', '', 1)
#1 [internal function]: AdsSoapClient->__doRequest('<?xml version="...', 'https://www.goo...', '', 1, 0)
#2 /usr/local/shiny/sa/models/dfp_api_php_2.17.1/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(216): SoapClient->__soapCall('getLineItem', Array, NULL, Array, Array)
#3 /usr/local/shiny/sa/models/dfp_api_php_2.17.1/src/Google/Api/Ads/Dfp/v201306/LineItemService.php(9158): AdsSoapClient->__soapCall('getLineItem', Array)
#4 /usr/local/shiny/sa/models/googledfp.php(1143): LineItemService->getLineItem('156852129')
#5 /usr/local/shiny/sa/controllers/cronjob.php(691): googledfp->get_campaign_stats(Array, '187028049', '156852129', true)


    This happens in more than one location where I am using the lineitemService. I do know that the lineitem id's exist. Typically it will fail and if you try a few minutes later it will work.

    Let me know if you need more info.

Thanks,
Andre

Vincent Tsao (DFP API Team)

unread,
Feb 20, 2014, 7:39:04 AM2/20/14
to google-doubleclick...@googlegroups.com
Hi Andre:

(1) Can you send me the SOAP logs for this as well?
(2) What is your network code?

Thanks,
Vincent Tsao, DFP API Team

Roy Pereira

unread,
Mar 19, 2014, 2:17:45 PM3/19/14
to google-doubleclick...@googlegroups.com
Vincent, for the last two days, we are getting periodically this connection error once again.  This happens on all DFP calls, not just getReportJob.

It is like the DFP server for v201311 is overloaded and closing the connection.

Vincent Tsao (DFP API Team)

unread,
Mar 20, 2014, 4:00:05 PM3/20/14
to google-doubleclick...@googlegroups.com
This was solved outside the forum, but for posterity:

if you're seeing the error:
"Error Fetching http body, No Content-Length, connection closed or chunked data"

It is an HTTP 1.1 issue with some versions of PHP not properly decoding chunked data (even some versions of PHP 5.3.x will still see this error, the documentation on PHP's official site is wrong). You have two options in this case:
(1) Update your version of PHP to 5.4.x or later.
(2) Force the client library to use HTTP 1.0 by doing the following:
In the file Google/Api/Ads/Common/Lib/SoapClientFactory.php,
right before line 147 where the line says "$options['stream_context'] = stream_context_create($contextOptions);"

add the following line of code:
$contextOptions['http']['protocol_version'] = 1.0;

I will see if there is any check I can do in the client library to prevent this issue.

Thanks,
Vincent Tsao, DFP API Team

Mainostoimisto Leimahdus

unread,
Mar 21, 2014, 7:50:14 AM3/21/14
to google-doubleclick...@googlegroups.com
The second solution removed my problem. This was very weird because we haven't changes anything in a month or so.

Anyhow, thanks a million times! 

minube

unread,
Mar 21, 2014, 8:46:53 AM3/21/14
to google-doubleclick...@googlegroups.com
We had the same problem today, the $contextOptions['http']['protocol_version'] = 1.0; solution solved the problem, but as happened to Mainostoimisto Leimahdus no software updates were made in our servers, so it must be a problem in the API side.

Thanks

Ops at The Media Trust

unread,
Mar 21, 2014, 10:06:43 AM3/21/14
to google-doubleclick...@googlegroups.com
Unfortunately the second solution did not resolve the issue for me.  We also have not made any changes for some time.  Looking at our logs we first encountered the issue between 11:45pm and midnight Eastern time.  All API transactions since that time have failed. This is a major show-stopper - anything that can be done from the API side to resolve this would be greatly appreciated.

Thanks


--
You received this message because you are subscribed to the Google Groups "Google's DoubleClick for Publishers API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-p...@googlegroups.com.
To post to this group, send email to google-doubleclick...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-doubleclick-for-publishers-api.
For more options, visit https://groups.google.com/d/optout.

Angelo Cavallini

unread,
Mar 21, 2014, 10:10:03 AM3/21/14
to google-doubleclick...@googlegroups.com
Hi everyone,
we experienced the same problem today and we were able to fix it by editing the code as indicated.

It must definitely be a problem in the APIs

Thanks
Angelo

Mat Sumpter

unread,
Mar 21, 2014, 11:13:08 AM3/21/14
to google-doubleclick...@googlegroups.com
We are in the same boat and our API scripts are failing with the same errors. I attempted to apply the HTTP/1.0 fix and it made no difference.

Vincent Tsao (DFP API Team)

unread,
Mar 21, 2014, 11:18:57 AM3/21/14
to google-doubleclick...@googlegroups.com

Bappa Sk

unread,
Oct 1, 2016, 1:55:23 AM10/1/16
to Google's DoubleClick for Publishers API Forum
Hi Vincent, 

I am getting the same error, for the same API version v201603:
Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 257

 Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 354

Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 372

 Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 257

 Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 354

 Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty string supplied as input in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 372


Fatal error: Uncaught SoapFault exception: [HTTP] Unsupported Media Type in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php:184 Stack trace: #0 C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php(184): SoapClient->__doRequest('<?xml version="...', 'https://adwords...', '', 1) #1 C:\wamp\www\googleads\google-api\src\Google\Api\Ads\AdWords\Lib\AdWordsSoapClient.php(72): AdsSoapClient->__doRequest('<?xml version="...', 'https://adwords...', '', 1) #2 [internal function]: AdWordsSoapClient->__doRequest('<?xml version="...', 'https://adwords...', '', 1, 0) #3 C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php(222): SoapClient->__soapCall('get', Array, NULL, Array, Array) #4 C:\wamp\www\googleads\google-api\src\Google\Api\Ads\AdWords\Lib\AdWordsSoapClient.php(86): AdsSoapClient->__soapCall('get', Array) #5 C:\wamp\www\googleads\google-api\src\Google\Api\Ads\AdWords\v201603\ManagedCustomerService.php(4485): AdWordsSoapClient->__soapCall(' in C:\wamp\www\googleads\google-api\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 184 


In the file Google/Api/Ads/Common/Lib/SoapClientFactory.php,
right before line 147
 add the following line of code:
$contextOptions['http']['protocol_version'] = 1.0;

Now code is
 // SSL settings.
    if (defined('SSL_VERIFY_PEER') && SSL_VERIFY_PEER != '') {
 $contextOptions['http']['protocol_version'] = 1.0;
      $contextOptions['ssl']['verify_peer'] = SSL_VERIFY_PEER;
    }
my php version-php5.4.3 

But i am still getting same error.How can I resolve this issue? Please help me.

Thanks,

Vincent Tsao (DFP API Team)

unread,
Oct 3, 2016, 10:48:18 AM10/3/16
to Google's DoubleClick for Publishers API Forum
Hello:

In the future please start a new thread, as this thread is 2 years old, and may not be the same issue.

Also, since you're using AdWords, can you please post this to the AW API forums:

Thanks,
Vincent Tsao, DFP API Team
Reply all
Reply to author
Forward
0 new messages