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?
Le mercredi 12 avril 2023 à 16:53:57 UTC+2, Google Ads API Forum Advisor a 
écrit :

> 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 
>       
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>        and response 
>       
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
>        logs with request-id 
>       
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
>        and login-customer-id 
>       
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure?hl=en#cid>
>  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,
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2kUYpR:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b0c56ca7-12d8-4ea0-98b9-e7f6bd417eafn%40googlegroups.com.
  • Ad... Willy Bahuaud
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Willy Bahuaud
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Willy Bahuaud
            • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
              • ... Jefferson Cechinel

Reply via email to