Reporting Crash with v201802

58 views
Skip to first unread message

P Anand

unread,
Mar 12, 2018, 4:56:37 PM3/12/18
to AdWords API Forum
Hello,

I am currently on v201705 version for Adwords API. I am using the Report Download with AWQL method to download the reports. This is currently working fine since a long time . However, when i use the library v201802 the code just crashes with no information. Below is a snippet in PHP

echo "A"; 

$session = (new AdWordsSessionBuilder())
            ->withOAuth2Credential($this->client)
            ->withClientCustomerId($client_id)
            ->withDeveloperToken($this->developer_token)
            ->build();

echo "B";

 try {
        $reportDownloader = new ReportDownloader($session);

echo "C";

 $reportDownloadResult = $reportDownloader->downloadReportWithAwql($report_query, DownloadFormat::CSV);
        } catch (Exception $e) {
            echo json_encode($e);
            log('error', __FUNCTION__ . ', Exception Error ' . json_encode($e));
        }




The outpiut is AB and never reaches C. This means the line
 $reportDownloader = new ReportDownloader($session);


is crashing. 

Can anyone help on this matter. 

Thanks 

Pete

Vincent Racaza (AdWords API Team)

unread,
Mar 12, 2018, 11:39:31 PM3/12/18
to AdWords API Forum
Hi Pete,

Your issue seems to be unusual as based on your code snippet, it is supposed to execute the line before 'echo "C"'. Since you said that this line is crashing on your end, do you have any error logs or any valuable information that we can further check? Is the crashing issue on the report downloading only? Were you able to test other services (e.g. CampaignService) if their responses are okay?

Also, when you installed the new version of PHP client library, could you confirm if you have installed it using Composer as you can see on this guide (this is to make sure that all dependencies are downloaded)?

Thanks,
Vincent
AdWords API Team
Message has been deleted

P Anand

unread,
Mar 15, 2018, 6:50:39 AM3/15/18
to AdWords API Forum
Hi Vincent,

Thanks for the reply.

To answer your questions

1) Logs : I have checked the apache logs and get nothing in them. When i run this script in the browser, i get 200 response, with nor errors at all.
2) Other Services. I have tested getting a client List which is successful. Example given below
3) I have installed the library bu using

composer upgrade





 However, I created a new project with just googleads/googleads-php-lib using composer. composer.json is as follows

"require": {
       
"php": ">=5.5.9",
       
"google/auth": "^1.0.0",
       
"googleads/googleads-php-lib": "^33.1.0"
   
}



I am running a test report with the same code as previously posted and now I am getting the following error:



A PHP Error was encountered



Severity: Parsing Error


Message:  syntax error, unexpected ':', expecting ';' or '{'


Filename: Normalizer/GetSetMethodNormalizer.php


Line Number: 59


Backtrace:


My PHP Version is as follows

PHP 5.6.34-1+ubuntu14.04.1+deb.sury.org+1 (cli)

I have also tried the same code on a different machine with PHP v 7.2.3 on Ubuntu 16.04 , but no success on that either.

I have tried using getting a client list using


 $adWordsServices
= new AdWordsServices();


            $session
= (new AdWordsSessionBuilder())
               
->withOAuth2Credential($this->client)

               
->withClientCustomerId($clientId)

               
->withDeveloperToken($this->developer_token)
               
->build();

which is successfully working without any errors. To my surprise, everything was working fine till i upgraded to v201802. I tested on v201710 and everything works, without upgrading any PHP version.



I appreciate you help. I look forward for your reply.

Thanks and Regards

Pete

Vincent Racaza (AdWords API Team)

unread,
Mar 15, 2018, 10:37:10 PM3/15/18
to AdWords API Forum
Hi Pete,

This seems to be an issue on your set-up with the PHP client library for v201802 and not AdWords API specific, since you said that v201710 is working and only the v201802 has this error. I suggest to post this concern here as the library owners can provide better assistance on PHP client library specific issues/concerns.

P Anand

unread,
Mar 16, 2018, 7:23:27 AM3/16/18
to AdWords API Forum

Hi Vincent,

Thanks for all the help and support.

Regards

Pete
Reply all
Reply to author
Forward
0 new messages