Unable to connect to the remote server when submitting a Batch Job

857 views
Skip to first unread message

uvsuperDev

unread,
Apr 6, 2017, 5:15:29 AM4/6/17
to AdWords API Forum
Hi guys!

We get "Unable to connect to the remote server" error when submitting a batch job request.
InnerException: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 172.217.7.240:443 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

It started a day ago. 

Any insights?

Any issues with the remote server?

Vishal Vinayak (Adwords API Team)

unread,
Apr 6, 2017, 11:57:22 AM4/6/17
to AdWords API Forum
Hi,

Are you facing these issues repetitively? Did any change happen recently to your network/proxy configuration? Issues like these are sometimes intermittent and tend to go away after a few retries. If you happen to see this error again, please let me know.

Regards,
Vishal, AdWords API Team

Alperen Belgic

unread,
Sep 13, 2018, 8:20:59 AM9/13/18
to AdWords API and Google Ads API Forum
Hello sirs, 

I am having the same issue. BTW, I received it in the first time I tried. I am using a hosting provider and they require to define a proxy address of theirs in order to make web services out. 

Everything works in my local. 

In hosting environment, the service that I use to get Accounts works as expected.  I use get method of  (ManagedCustomerService)user.GetService(AdWordsService.v201806.ManagedCustomerService)) in .NET. 

Once the code requested the report. it waits for a few minutes then returns below error. I use CRITERIA_PERFORMANCE_REPORT with .net library. 

The shortened version of my code is below:
            ReportDefinition definition = new ReportDefinition()
            {
                reportName = "Last 1 days CRITERIA_PERFORMANCE_REPORT",
                reportType = ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT,
                downloadFormat = DownloadFormat.CSV,
                dateRangeType = ReportDefinitionDateRangeType.YESTERDAY,


                selector = new Selector()
                {
                    fields = new string[]
               {
                        "CampaignId",
                        "ExternalCustomerId",
                        "Cost",
                        "Date"
               },
                }
            };

            ReportUtilities utilities = new ReportUtilities(user, "v201806", definition);

           ReportResponse response = utilities.GetResponse()



Message:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 108.177.15.138:443, StackTrace:   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)\r\n   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) }"


Do you have any suggestion for this? Please let me know if I can provide any more details. 

Thank you very much for your support. 

Alperen

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Sep 13, 2018, 3:37:48 PM9/13/18
to AdWords API and Google Ads API Forum
Hello Alperen,

The issue seems to be specific to your environment setup. I found another thread about the same topic which might be useful for you. If the suggestions on that thread is not helpful for you, could you please open a new issue on the .NET client library? The library owner is better equipped to address this question.

Thanks,
Sreelakshmi, AdWords API Team

Alperen Belgic

unread,
Sep 13, 2018, 5:21:07 PM9/13/18
to AdWords API and Google Ads API Forum
Hi Sreelakshmi,

Thank you for your response. 

After your message, I checked the source code of adwords api.net client and I noticed the below line in BuildRequest method of HttpUtilities class
            request.Proxy = config.Proxy;


This line overrides the configuration which I included in web.config.

I assigned Proxy member of  AdWordsAppConfig object which I pass to the service like below line:
                config.Proxy = new System.Net.WebProxy(new Uri("proxy address here"), false) { UseDefaultCredentials = false, };



And it works now. 

Thank you very much for your support.

Alperen

Reply all
Reply to author
Forward
0 new messages