Problems with ReportUtilities.DownloadClientReport with .NET 14.5.0 client library

242 views
Skip to first unread message

Alexander Nitschke

unread,
Jul 4, 2012, 8:26:05 AM7/4/12
to adwor...@googlegroups.com
I have a few problems since upgrading to the .NET 14.5.0 library (newest version as of now):

ReportUtilities.DownloadClientReport doesn't work when used with v201109_1 ReportDefinition. It gives the following error:
Report contents are invalid. - !!!2|||-1|||cvc-complex-type.2.4.a: Invalid content was found starting with element 'selector'. One of '{"https://adwords.google.com/api/adwords/cm/v201109":id, "https://adwords.google.com/api/adwords/cm/v201109":selector}' is expected.???

Ok, so I use the old v201109 ReportDefinition which works... actually, only so far. The DownloadClientReport just hangs itself randomly in roughly 1 out of 200 reports, no rhyme or reason to these reports. This is happening without an exception, the code execution just hangs there and never finishes (several hours at least, probably "never" is correct).

This is very annoying since I have to stop the background process, reset a date in our database and start it again, so that report downloading can continue - and this is supposed to happen at 4:00 in the night, so that the previous day data is up and running for our clients as soon as possible. Not to mention that downloading and working with the report data (there is a lot to be done with our bid automatization algorithms) slows down our server, so it usually happens from 4 a.m. to 6 a.m. But since we have more than 200 clients there is hardly a day since the upgrade when I have to stop the process and start it again, and the first hours of the day are running on a slower server.

If DownloadClientReport would throw an exception at least, or allow for a time limit, I could work out a workaround. But it doesn't, and the Try ... Catch routine also doesn't allow for a time limit.

Could you please look into this issue, and correct it soon? Also, any tips for a workaround are very helpful, especially since I'm scheduled for a two week vacation next Monday, and already see myself dealing every morining with this issue.

Eric Bloomfield

unread,
Jul 9, 2012, 10:59:11 AM7/9/12
to adwor...@googlegroups.com
Same here,  If I run several reports in a row after the 5th or 6th I get a timeout and then need to restart the service, just started with the latest versions 14.5

Bejan @ MarketFlare

unread,
Jul 20, 2012, 1:30:18 PM7/20/12
to adwor...@googlegroups.com
We ran into the same issue after moving to the .NET 14.6 library.

To fix this we had to edit source and recompile the Google.AdWords.dll. Line 45 in ReportUtilities.cs (Util\Reports) was updated:

from -

    private const string DEFAULT_REPORT_VERSION = "v201109";

to -

    private const string DEFAULT_REPORT_VERSION = "v201206"; //or to whichever version you are using... looks like v201109_1 in your case

Now we no longer receive the "invalid content" error.

As for the other issue of code execution hanging we did not experience this enough to see a pattern or problem. For this type of issue maybe RX "ToObservable" could help if DownloadClientReport is run as a Task:

Add RX (System.Reactive.dll) and ExtensionMethod:

        public static Task TimeoutAfter(this Task task, int millisecondsTimeout) {
            return task.ToObservable().Timeout(TimeSpan.FromMilliseconds(millisecondsTimeout)).ToTask();
        }

I learned about this from here (credit to the first comment there) - http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx

Alexander Nitschke

unread,
Jul 23, 2012, 12:49:06 PM7/23/12
to adwor...@googlegroups.com
Hello Bejan,

I implemented your suggestion (DEFAULT_REPORT_VERSION = "v201206") now as we migrate to v201206 anyway, and it worked just fine. Thanks for that!

However, the hangup in the DownloadClientReport is still there, and by now it seems to me more like once every fifty downloads. In other words, it is really intolerable by now and I have to resort to these (I feel rather dirty) tactics of creating and, if necessary, killing tasks and dead files. I wonder why the usually helpful Mr.Oommen is quiet here?

Maybe it has to do with some unusual circumstance for us, but I don't feel the report is anything special. It's just a rather plain AD_PERFORMANCE_REPORT with the raw data (Fields {"Date", "CampaignId", "AdGroupId", "KeywordId", "Id", "Impressions", "Clicks", "Cost", "AveragePosition", "Conversions", "TotalConvValue"}, usually from the day before, sometimes several days...

Alexander

Kevin Winter

unread,
Jul 24, 2012, 10:00:03 AM7/24/12
to adwor...@googlegroups.com
Hi Alexander, Eric,
  Eric, thanks for filing an issue on the issue tracker.  Anash should followup and resolve this issue there.  If anyone else has any extra debugging information they feel is relevant, feel free to add a comment on the issue.

- Kevin Winter
AdWords API Team

Alexander Nitschke

unread,
Jul 26, 2012, 6:00:43 AM7/26/12
to adwor...@googlegroups.com
To anyone who has this (serious) problem: Anash posted an update of the API in the issue tracker for issue 87 which works.
Reply all
Reply to author
Forward
0 new messages