Re: Failed to refresh access token. { "error" : "invalid_client" } on perfectly good client

2014-07-17 Thread NET_Api_User
+1. We're seeing a huge number of these errors - on about 2% of our calls. 
Retrying seems to help. We moved to the latest .NET release recently. 

On Thursday, July 17, 2014 4:04:29 PM UTC+5:30, Zweitze wrote:
>
> Hi,
>
> This morning a Google.Api.Ads.Common.Lib.AdsOAuthException occurred:
> Failed to refresh access token.
> {
> "error" : "invalid_client"
> }
>
> Unfortunately the .NET library destroyed all extra information, so I don't 
> have response headers, HTTP status code etc.
> Anyway, the error occurred a eight times in total, between 05.25h and 
> 07.41h (CEST), but in that period we also did manage to retrieve access 
> tokens. Before that, or after that, we had no problems.
>
> So, what does the error mean? Obviously it doesn't mean that the supplied 
> clientid and clientsecret do not exist.
> And how does one handle this error? Can one retry the call?
>
> Thanks in advance!
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ReportUtilities.DownloadClientReport throws System.NullReferenceException

2014-07-17 Thread NET_Api_User
We encounter this too. Added retry logic and that seems to have fixed it. 
Its bad though to have to catch a NullRef and retry on that.

On Thursday, July 17, 2014 8:22:00 PM UTC+5:30, Stephen Gilles wrote:
>
> I have the same issue - using v18. I've searched extensively in this 
> group, finding many similar issues, but no specific solution... 
>
> Steve
>
>
> On Monday, June 9, 2014 11:49:58 AM UTC-7, Anash P. Oommen (AdWords API 
> Team) wrote:
>>
>> Hi Peter,
>>
>> I thought I fixed this error. Could you kindly download the source 
>> distribution from 
>> https://github.com/googleads/googleads-adwords-dotnet-lib/releases/tag/v16.6.0
>>  
>> and let me know what line this exception is being thrown?
>>
>> Cheers,
>> Anash P. Oommen,
>> AdWords API Advisor.
>>
>> On Wednesday, June 4, 2014 12:16:04 PM UTC-4, Peter Kingswell wrote:
>>>
>>> Hi,
>>>
>>> we download campaign performance stats on a daily basis and encounter 
>>> this exception fairly regularly.  Is anyone else seeing this? :
>>>
>>> Exception System.NullReferenceException: Object reference not set to an 
>>> instance of an object.
>>> at 
>>> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToStream(String
>>>  
>>> downloadUrl, Boolean returnMoneyInMicros, String postBody, Stream 
>>> outputStream)
>>> at 
>>> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReportInternal(String
>>>  
>>> downloadUrl, String postBody, Boolean returnMoneyInMicros, String path)
>>> at 
>>> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReport[T](T
>>>  
>>> reportDefinition, Boolean returnMoneyInMicros, String path)
>>>
>>> AFAICT the problematic invocations are not significantly different to 
>>> other successful invocations.  It occurs irrespective 
>>> of ReportDefinitionReportType.  Here is how we create the ReportDefinition:
>>>
>>> ReportDefinition definition = new ReportDefinition();
>>> definition.reportName = "blah";
>>> definition.reportType = 
>>> ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT;
>>> definition.downloadFormat = DownloadFormat.CSV;
>>> definition.includeZeroImpressions = true;
>>> definition.dateRangeType = ReportDefinitionDateRangeType.TODAY;
>>> Selector selector = new Selector();
>>> selector.fields = ... dictionary of fields ...;
>>> definition.selector = selector;
>>>
>>> This is with Assembly Google.AdWords.dll, v16.6.0.0.
>>>
>>> Many thanks, Peter
>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Intermittent errors on token refresh

2014-07-17 Thread .NET_Api_User
*Getting: *

7/17/2014 7:02:14 AM | Google.Api.Ads.Common.Lib.AdsOAuthException: Failed 
to refresh access token.
{
  "error" : "invalid_client"
}
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessTokenInOfflineMode()
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessToken()
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderBase.RefreshAccessTokenIfExpiring()
   at Google.Api.Ads.Common.Lib.OAuth2ProviderBase.GetAuthHeader()
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.BuildRequest(String 
downloadUrl, Nullable`1 returnMoneyInMicros, String postBody)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToStream(String
 
downloadUrl, Nullable`1 returnMoneyInMicros, String postBody, Stream 
outputStream)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.GetClientReportInternal(String
 
downloadUrl, String postBody, Nullable`1 returnMoneyInMicros)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.GetClientReport(String 
query, String format, Nullable`1 returnMoneyInMicros)

*Intermittently for a bunch of client accounts. Could it be something we 
are doing wrong? It usually works on retrying.*

*Also saw a few of these:*

Google.Api.Ads.Common.Lib.AdsOAuthException: Failed to refresh access token.
{
  "error" : "internal_failure"
}
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessTokenInOfflineMode()
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessToken()
   at 
Google.Api.Ads.Common.Lib.OAuth2ProviderBase.RefreshAccessTokenIfExpiring()
   at Google.Api.Ads.Common.Lib.OAuth2ProviderBase.GetAuthHeader()
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.BuildRequest(String 
downloadUrl, Nullable`1 returnMoneyInMicros, String postBody)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToStream(String
 
downloadUrl, Nullable`1 returnMoneyInMicros, String postBody, Stream 
outputStream)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.GetClientReportInternal(String
 
downloadUrl, String postBody, Nullable`1 returnMoneyInMicros)
   at 
Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.GetClientReport(String 
query, String format, Nullable`1 returnMoneyInMicros)

*Any help will be appreciated!*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.