Posts Tagged ‘Remote Server returned an error’

The remote server returned an error: NotFound

November 9, 2012

Hello All,

I have been facing one of the error in our sliverlight application (using ESRI 2.4 API) which calls our  custom geoprocessing (using ArcGIS 10 SP4) tasks to execute huge huge process which last for more than 10 min (avg), but before that client gets timed out. This is very much annoying and lot of users complained about this. In Fiddler we are getting timeout exception in stack trace.

Server Error in ‘/ArcGIS/rest’ Application.

Request timed out.  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Request timed out.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Request timed out.]

After going through all ESRI/Microsoft forums. I have increased a) Increased executiontime out value in web.config  b) Increased GP Tool client timeout values , but nothing worked and application fails with same mesage.  The REST tool is working fine when this executed from browser and URL is available and correct. This is an POST request FYI.

We have trying a lot on this but did not get any clue. After lot of research, we have checked restlog.txt (under C:\inetpub\wwwroot\ArcGIS\rest) folder and found below log message

Log Entry : 11/8/2012 6:06:40 AM
ERROR:Thread was being aborted. ::    at ESRI.ArcGIS.REST.GPServer.SubmitGPTaskJsonFormatter.Init()
at ESRI.ArcGIS.REST.RequestHandler.ProcessRequest()
at ESRI.ArcGIS.REST.RestHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)

so we narrowed down that this request sent to server was aborted after some time because of some reasons. We have checked all time out property in IIS/ASP.NET but could not succeed. This becomes complex now. This entire effort consumed lot of effort because custom tool will run for 30 min and then it will fail, so we need lot of time to change one  parameter and test from the client application.  We kept on trying on this.

The process got terminated so that it couldn’t do logging in ArcGIS Server level so that exception didn’t happen inside of the service call handling. This means that the query handling thread got terminated from ASP.NET / IIS level. We have got some clue from ESRI Forum as well.

We have added <httpRuntime executionTimeout=”7200″/> in Web.config file under C:\inetpub\wwwroot\ArcGIS\rest folder and our issues are resolved. This value extended the execution time out and process ran smoothly and client application displayed the results as well.

Finally we learnt from this link  “Since ASP.NET timeout is internally implemented so that the check fires in every 15 seconds. When using the default value, the ASP.NET aborts the query thread in 110 – 125 seconds

Thanks to ESRI Forum and Antti Kajanus . Issue has been resolved successfully.

I believe ESRI will provide detailed stack trace on their REST API calls, I assume this was in their list.

Finally – Wish you a All very Happy Diwali!!!!

Please write your feedback/comments/suggestions to my email

Thank you