Ads API occasional errors without error message

428 views
Skip to first unread message

Willy Bahuaud

unread,
Apr 12, 2023, 4:59:35 AM4/12/23
to Google Ads API and AdWords API Forum
Hello,

I am struggling with an API response that I do not understand. Most of the time, my requests go through, but occasionally, my requests to the Google ADS API are blocked with just a Status code 14 and a 403 forbidden code. The reasons for the blockage are never indicated, so I don't see what I can fix.

I recently migrated to v13, and I had never had this issue with v10 before. The blockage can last for about twenty minutes, or a few hours, and then everything returns to normal.

How can I obtain information about the reason for the 403 forbidden error? (I am using the API via gRPC and https://github.com/googleads/google-ads-php).

Thank you very much for your help.

And here are some examples of error messages received:

[2023-04-12T07:06:49.808262+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas", CustomerId: 5918386111, RequestId: "", IsFault: 1, FaultMessage: "None"  
[2023-04-12T07:06:49.808346+00:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.4.25 gccl\/18.0.0 gapic\/18.0.0 gax\/1.12.1 grpc\/1.46.0RC2 rest\/1.12.1",
    "x-goog-request-params": "customer_id=5918386111",
    "developer-token": "REDACTED"
}
Request:
{"customerId":"5918386111","language":"languageConstants/1002","geoTargetConstants":["geoTargetConstants/2250"],"keywordPlanNetwork":"GOOGLE_SEARCH","keywordSeed":{"keywords":["massage 3D"]}}

Response
-------
Headers: []

Fault
-------
Status code: 14
Details: 403:Forbidden
Failure: {}  
[2023-04-12T07:06:49.914217+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas", CustomerId: 5918386111, RequestId: "", IsFault: 1, FaultMessage: "None"  
[2023-04-12T07:06:49.914302+00:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.4.25 gccl\/18.0.0 gapic\/18.0.0 gax\/1.12.1 grpc\/1.46.0RC2 rest\/1.12.1",
    "x-goog-request-params": "customer_id=5918386111",
    "developer-token": "REDACTED"
}
Request:
{"customerId":"5918386111","language":"languageConstants/1002","geoTargetConstants":["geoTargetConstants/2250"],"keywordPlanNetwork":"GOOGLE_SEARCH","keywordSeed":{"keywords":["massage 3D"]}}

Response
-------
Headers: []

Fault
-------
Status code: 14
Details: 403:Forbidden
Failure: {}  

Google Ads API Forum Advisor

unread,
Apr 12, 2023, 10:53:57 AM4/12/23
to w.ba...@gmail.com, adwor...@googlegroups.com
Hi Willy,

Thank you for raising this to us.

Since you mentioned that the behavior occurs occasionally, could you confirm/provide the following?
  • Percentage occurrences of the said error response
  • Is the error reliably reproducible?
    • If so, Provide the complete API request and response logs with request-id and login-customer-id that are generated on your end
    • If not, could you confirm if submitting the same request goes through after some time? (for example, pausing at least 5 to 10 seconds before submitting the same request again)
Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kUYpR:ref

Willy Bahuaud

unread,
Apr 13, 2023, 5:34:17 AM4/13/23
to Google Ads API and AdWords API Forum

Thank you for your feedback. This error is very common but not consistently reproducible. For example, this morning it worked between 10:55 and 11:10
When the error occurs, I don't get a requestID because the gRPC log indicates "Status code: 14 Details: failed to connect to all addresses". The customer Id is 5918386111.

Here is the complete request as declared in PHP (using the PHP library):

<?php
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\Lib\V13\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Util\V13\ResourceNames;
use Google\Ads\GoogleAds\V13\Enums\KeywordPlanNetworkEnum\KeywordPlanNetwork;
use Google\Ads\GoogleAds\V13\Services\KeywordSeed;

$customerId = '5918386111';
$oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();

$keyword = 'avion';
$keywordPlanIdeaServiceClient = $googleAdsClient->getKeywordPlanIdeaServiceClient();
$locationIds = [ 2250 ]; // France
$geoTargetConstants =  array_map(function ($locationId) {
return ResourceNames::forGeoTargetConstant($locationId);
}, $locationIds);
$requestOptionalArgs = [];
$requestOptionalArgs['keywordSeed'] = new KeywordSeed(['keywords' => [$keywords]]);
$response = $keywordPlanIdeaServiceClient->generateKeywordIdeas(
[
'language'           => ResourceNames::forLanguageConstant( 1002 ), // French
'customerId'         => $customerId,
'geoTargetConstants' => $geoTargetConstants,
'keywordPlanNetwork' => KeywordPlanNetwork::GOOGLE_SEARCH,
'keywordSeed'        => new KeywordSeed(['keywords' => [$keyword]]),
'retrySettings'      => [
'retriesEnabled' => false,
]
]
);



And here is an excerpt from the gRPC error log:

[2023-04-13T09:06:24.671191+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas", CustomerId: 5918386111, RequestId: "", IsFault: 1, FaultMessage: "None"  
[2023-04-13T09:06:24.671326+00:00] google-ads.NOTICE: Request

-------
Method Name: /google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.4.25 gccl\/18.0.0 gapic\/18.0.0 gax\/1.12.1 grpc\/1.46.0RC2 rest\/1.12.1",
    "x-goog-request-params": "customer_id=5918386111",
    "developer-token": "REDACTED"
}
Request:
{"customerId":"5918386111","language":"languageConstants/1002","geoTargetConstants":["geoTargetConstants/2250"],"keywordPlanNetwork":"GOOGLE_SEARCH","keywordSeed":{"keywords":["avion"]}}


Response
-------
Headers: []

Fault
-------
Status code: 14
Details: 403:Forbidden
Failure: {}  


And if I try the same request again twenty minutes later, it may or may not succeed. What could explain why gRPC is occasionally unable to contact the API server?

Google Ads API Forum Advisor

unread,
Apr 13, 2023, 3:58:32 PM4/13/23
to w.ba...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

Are you able to provide us the complete API logs (request and response with request-id) as we have mentioned previously? You may check on these respective links on what these logs look like. This is so we can check better and investigate further on the issue you encountered. For the PHP client library, logging can be enabled by following the PHP Logging guide.

You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Reference links included in this email:

Willy Bahuaud

unread,
Apr 17, 2023, 5:14:54 AM4/17/23
to Google Ads API and AdWords API Forum
Thank you for your feedback!
In the previous message, it was indeed a complete log, including the request, but unfortunately, there was neither a response nor a request ID because the request seems to be directly rejected by the API (hence the gRPC error code 14 and the 403 Forbidden error, I suppose). I followed the PHP Logging guide properly, and I don't have any more details in the log file, which I am still attaching (where you will see that the request goes through sometimes, but not always). Do you also want the complete gRPC log (which is very detailed)?
file.log

Google Ads API Forum Advisor

unread,
Apr 17, 2023, 10:42:19 AM4/17/23
to w.ba...@gmail.com, adwor...@googlegroups.com

Hello Willy,

Thank you for getting back to us.

The 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason. And since the issue is not reproducible on our end, and that you are utilizing the php client library, we would highly recommend reaching out to the client library owner through this link (https://github.com/googleads/google-ads-php/issues) as they can provide more input on why you are encountering the said error.

If the above does not suffice to resolve your issue, kindly provide the mentioned complete gRPC log, and we will raise it to the rest of our team for further investigation.

Regards,

Jefferson Cechinel

unread,
Jun 14, 2023, 4:33:34 PM6/14/23
to Google Ads API and AdWords API Forum
Any solution for this issue? I'm having the exact same issue.

Google Ads API Forum Advisor

unread,
Jun 19, 2023, 1:21:34 PM6/19/23
to jeff...@febacapital.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out.

Regarding this error, it appears that you are also encountering the same issue. Please note that the 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason. Having said that, as previously suggested by our team, I highly recommend reaching out to the PHP client library owner through this link (https://github.com/googleads/google-ads-php/issues) as they can provide more inputs/insights on why you are encountering the said error.
 
This message is in relation to case "ref:_00D1U1174p._5004Q2kUYpR:ref"

Thanks,

 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages