Re: DeadlineExceed Error due to Authorization issue

2022-06-14 Thread Vijay Kumar
Thanks for the support.

Side note: This is a known bug in the ruby client library, posting the 
issue link here for the public 
reference: https://github.com/googleads/google-ads-ruby/issues/246 which is 
happening due to an the underlying issue in the google-auth 
lib https://github.com/googleapis/google-auth-library-ruby/issues/366.

On Tuesday, June 14, 2022 at 6:37:31 PM UTC+5:30 adsapi wrote:

> Hi Vijay,
>
> This issue seems to be specific to the Ruby client library. As our team 
> provides general Ads API support, I would recommend reaching out to the Ruby 
> client library owners 
> . 
>
> Regards,
>
> [image: Google Logo] 
> Matt 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2bvrfZ: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/01fb2c37-342d-4ca4-8de1-cbbfcbc4f4ean%40googlegroups.com.


Re: DeadlineExceed Error due to Authorization issue

2022-06-14 Thread 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
Hi Vijay,

This issue seems to be specific to the Ruby client library. As our team 
provides general Ads API support, I would recommend reaching out to the Ruby 
client library owners.

Regards,

Matt
Google Ads API Team
ref:_00D1U1174p._5004Q2bvrfZ: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/BOM8D0RDGXS100zmgWsPz8SeaAgIqijGM3cA%40sfdc.net.


Re: DeadlineExceed Error due to Authorization issue

2022-06-14 Thread Vijay Kumar
Hi Darwin,

Thanks for your response. We already know that the account has an 
authorization issue, and needs to be reauthorized - that's not the problem. 
The problem is the behavior of the ruby client lib. The client library is 
infinitely retrying until the deadline exceeds in case of 'invalid_grant'. 
Theoretically 'invalid_grant' is not even a retriable error.

Regards,
Vijay Kumar

On Tuesday, June 14, 2022 at 1:07:53 PM UTC+5:30 adsapi wrote:

> Hi Vijay,
>  
>
> Thanks for your response. I am Darwin also, a member of the Google Ads API 
> team and let me provide support to your concern.
>  
>
> An *invalid_grant* 
> 
>  error 
> usually indicates an issue with your refresh token. That said, I would 
> recommend that you regenerate the said refresh token. Since you are using 
> RUBY, you can refer to this guide 
> 
>  on 
> how to set up your authentication credentials.
>
>
> Let me know how this goes, and should the issue persist, you may enable 
> logging by referring to this RUBY guide 
> ,
>  
> and provide to our team the complete request 
> 
>  and response 
> 
>  logs, 
> with the request-id 
> 
> .
>  
>
> You may then send the requested information via the *Reply privately to 
> author* option. If this option is not available, you may send the details 
> directly to our googleadsa...@google.com  alias 
> instead.
>
>
> Regards,
> [image: Google Logo] 
> Darwin 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2bvrfZ: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/3989b27f-7fe2-4d12-8bcf-aae846effa78n%40googlegroups.com.


Re: DeadlineExceed Error due to Authorization issue

2022-06-13 Thread Vijay Kumar
Can you explain why the Ruby client library is retrying in case of an
invalid grant error? That's the problem. That leads to exceeding the
deadline limit. Rather, the client library should raise the
AuthorizationError.

On Tue, 14 Jun, 2022, 01:12 Google Ads API Forum Advisor,
 wrote:

> Hi Vijay,
>
> Thanks for reaching out. I see that you are also getting an invalid_grant
> error. Are you following the instructions given here
> 
> ?
>
> Can you please try regenerating your OAuth credentials and refresh token
> to see if this resolves the issue?
>
> Thanks,
>
> [image: Google Logo]
> Matt
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q2bvrfZ: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/CADF3_qNHYsWDw7qTCZv1NvvWCrpcn7wmA98_ZVJLUke%3DEQL-oA%40mail.gmail.com.


RE: DeadlineExceed Error due to Authorization issue

2022-06-13 Thread 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
Hi Vijay,

Thanks for reaching out. I see that you are also getting an invalid_grant 
error. Are you following the instructions given here?

Can you please try regenerating your OAuth credentials and refresh token to see 
if this resolves the issue?

Thanks,

Matt
Google Ads API Team
ref:_00D1U1174p._5004Q2bvrfZ: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/LeBli0RDFLEV00JwbkdhfjTY2C9CZP-NsjYw%40sfdc.net.


DeadlineExceed Error due to Authorization issue

2022-06-13 Thread Vijay Kumar
Hi,

We are observing the GRPC::DeadlineExceeded error while querying the google 
ads API via the ruby client. 

- Full error log:
```
W, [2022-06-13T15:38:53.292380 #1568]  WARN -- : CID: 9928077892, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v9.services.GoogleAdsService/Search, IsFault: yes, 
Request ID: 
I, [2022-06-13T15:38:53.292674 #1568]  INFO -- : Outgoing request: Headers: 
{"developer-token":"REDACTED","login-customer-id":"3661020287","x-goog-api-client":"gl-ruby/2.7.5
 
gccl/15.0.0 gax/0.6.0 gapic/15.0.0 
grpc/1.42.0","x-goog-request-params":"customer_id=9928077892"} Payload: 
{"customerId":"9928077892","query":"SELECT metrics.cost_micros FROM 
campaign WHERE segments.date BETWEEN '2022-06-01' AND '2022-06-13' AND 
metrics.impressions > 0"}
I, [2022-06-13T15:38:53.292834 #1568]  INFO -- : Incoming response 
(errors): 
  GRPC::Unavailable(14:Getting metadata from plugin failed with error: 
#. 
debug_error_string:{"created":"@1655134733.291585418","description":"Getting 
metadata from plugin failed with error: #","file":"src/core/lib/security/credentials/plugin/plugin_credentials.cc","file_line":91,"grpc_status":14}):
 

  called from: 
/home/deploy/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.3.2/lib/active_support/logger_thread_safe_level.rb:53:in
 
`add'
W, [2022-06-13T15:38:58.328831 #1568]  WARN -- : CID: 9928077892, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v9.services.GoogleAdsService/Search, IsFault: yes, 
Request ID: 
I, [2022-06-13T15:38:58.329032 #1568]  INFO -- : Outgoing request: Headers: 
{"developer-token":"REDACTED","login-customer-id":"3661020287","x-goog-api-client":"gl-ruby/2.7.5
 
gccl/15.0.0 gax/0.6.0 gapic/15.0.0 
grpc/1.42.0","x-goog-request-params":"customer_id=9928077892"} Payload: 
{"customerId":"9928077892","query":"SELECT metrics.cost_micros FROM 
campaign WHERE segments.date BETWEEN '2022-06-01' AND '2022-06-13' AND 
metrics.impressions > 0"}
I, [2022-06-13T15:38:58.329134 #1568]  INFO -- : Incoming response 
(errors): 
  GRPC::Unavailable(14:Getting metadata from plugin failed with error: 
#. 
debug_error_string:{"created":"@1655134738.328316778","description":"Getting 
metadata from plugin failed with error: #","file":"src/core/lib/security/credentials/plugin/plugin_credentials.cc","file_line":91,"grpc_status":14}):
 

  called from: 
/home/deploy/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.3.2/lib/active_support/logger_thread_safe_level.rb:53:in
 
`add'
W, [2022-06-13T15:39:04.836459 #1568]  WARN -- : CID: 9928077892, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v9.services.GoogleAdsService/Search, IsFault: yes, 
Request ID: 
I, [2022-06-13T15:39:04.836762 #1568]  INFO -- : Outgoing request: Headers: 
{"developer-token":"REDACTED","login-customer-id":"3661020287","x-goog-api-client":"gl-ruby/2.7.5
 
gccl/15.0.0 gax/0.6.0 gapic/15.0.0 
grpc/1.42.0","x-goog-request-params":"customer_id=9928077892"} Payload: 
{"customerId":"9928077892","query":"SELECT metrics.cost_micros FROM 
campaign WHERE segments.date BETWEEN '2022-06-01' AND '2022-06-13' AND 
metrics.impressions > 0"}
I, [2022-06-13T15:39:04.836906 #1568]  INFO -- : Incoming response 
(errors): 
  GRPC::DeadlineExceeded(4:Deadline Exceeded. 
debug_error_string:{"created":"@1655134744.835871906","description":"Deadline 
Exceeded","file":"src/core/ext/filters/deadline/deadline_filter.cc","file_line":81,"grpc_status":4}):
 

  called from: 
/home/deploy/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.3.2/lib/active_support/logger_thread_safe_level.rb:53:in
 
`add'
Traceback (most recent call last):
/home/deploy/.rvm/gems/ruby-2.7.5/gems/grpc-1.42.0-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:29:in
 
`check_status': 4:Deadline Exceeded. 
debug_error_string:{"created":"@1655134744.835871906","description":"Deadline 
Exceeded","file":"src/core/ext/filters/deadline/deadline_filter.cc","file_line":81,"grpc_status":4}
 
(GRPC::DeadlineExceeded)
```

- Configuration
```
STREAM_TIMEOUT_SECONDS = 10
@client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
config.refresh_token = refresh_token
config.client_id = ADWORDS_CONFIG['CLIENT_ID']
config.client_secret = ADWORDS_CONFIG['CLIENT_SECRET']
config.developer_token = ADWORDS_CONFIG['DEVELOPER_TOKEN']
config.logger = Rails.logger
config.login_customer_id = login_customer_id
end

@google_ads_service = @client.service.google_ads
@google_ads_service.configure do |config|
config.rpcs.search.timeout =
config.rpcs.search_stream.timeout =
STREAM_TIMEOUT_SECONDS
end
```

It seems, the client lib internally handles the OAuth token 
update: 
https://developers.google.com/google-ads/api/docs/first-call/refresh-token?authuser=4,
 
which fails, and results in Signet::AuthorizationError. This somehow gets 
wrapped in a GRPC::Unavailable error. And, in case of a GRPC::Unavailable 
error the client lib keeps on retrying until the deadline 
exceeds: 
https://github.com/googleapis/gapic-generator-ruby/blob/69