"Object reference not set to an instance of an object" on production server, but works in Localhost

828 views
Skip to first unread message

Stephane

unread,
Dec 31, 2013, 2:56:06 PM12/31/13
to adwor...@googlegroups.com
Hi,

We ran into a weird problem. We use the report definition service to update some reports. While it's working pretty well when we use localhost, it stopped working on our production servers few days ago.

The error is:

"Object reference not set to an instance of an object."

"stackTrace": "   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.GetClientReportInternal(String downloadUrl, String postBody, Boolean returnMoneyInMicros)

We use C# and the latest v201309.

How can it work in localhost, but not in our production servers? 

We refreshed our production files many times, restarted the web server and so on with no luck. We think the problem is elsewhere. 

Any idea?

Thanks,

Stéphane

Anash P. Oommen (AdWords API Team)

unread,
Dec 31, 2013, 3:39:26 PM12/31/13
to adwor...@googlegroups.com
Hi Stephane,

The only reason I could think of is a NullReferenceException on this line: https://github.com/googleads/googleads-adwords-dotnet-lib/blob/master/src/AdWords/Util/Reports/ReportUtilities.cs#L285. But that happens only if the Http connection failed without any response from the server. Could you try setting up Fiddler as explained on https://github.com/googleads/googleads-adwords-dotnet-lib/wiki/How-to-capture-SOAP-messages and see what response you are getting back from the API server?

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Stephane

unread,
Jan 1, 2014, 9:17:05 AM1/1/14
to adwor...@googlegroups.com
Hi Anash,

Thanks for the reply. Fiddler works great in localhost, but I'm not sure I can't get it to work on the remote server. Adwords API is working great on localhost, but not on our production server.

I just enabled the logging on the server and here's something I get often:

System.Net Information: 0 : [5188] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 4abfa00:6bbf2d8, targetName = adwords.google.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Verbose: 0 : [2792] WebRequest::Create(https://adwords.google.com/api/adwords/reportdownload/v201309)
System.Net Verbose: 0 : [5456] 00000350 : 65 73 73 69 6F 6E 73 2B-78 6D 6C 6E 73 25 33 64 : essions+xmlns%3d
System.Net Verbose: 0 : [1940] 00000050 : 6B 1A 95 9E 7E D9 92 7C-20 58 02 C3 30 8A F2 3A : k...~..| X..0..:
System.Net Information: 0 : [5188] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=59, returned code=OK).
System.Net Error: 0 : [4064] Can't retrieve proxy settings for Uri 'https://adwords.google.com/api/adwords/reportdownload/v201309'. Error code: 10013.

Attached is the full log.

Any idea?

Thanks for your help.

Stéphane
System.Net.trace.log

Stephane

unread,
Jan 1, 2014, 9:57:37 AM1/1/14
to adwor...@googlegroups.com
By the way, we are hosted on Microsoft Azure.

Thanks,

Stéphane

Stephane

unread,
Jan 1, 2014, 11:22:40 AM1/1/14
to adwor...@googlegroups.com
After some other tests, I keep getting this error:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. 

It works with Google Analytics API though.

Stéphane
Reply all
Reply to author
Forward
0 new messages