The remote server returned an error: NotFound

3518
12
02-19-2012 11:16 PM
Esriguy
New Contributor III
In my sliver light application, I making call to custom Geo processing service to perform some heavy weight operations at server side.
This service call always returns an error "The remote server returned an error: NotFound." 

Below is pseudo code, Application always goes to "saveLine_Failed"

            Geoprocessor saveLineShotInfo = new Geoprocessor(url);
            saveLine.ExecuteCompleted += new EventHandler<GPExecuteCompleteEventArgs>(saveLine_ExecuteCompleted);
            saveLine.Failed += new EventHandler<TaskFailedEventArgs>(saveLine_Failed);
            saveLineShotInfo.ExecuteAsync(gparameters);

Error:

System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)}

I debugged using Fiddler and copied the response below.  Fiddler displays 500 error code.

I have increased "executionTimeout" in httpRuntime element in my web.config to 3600 seconds and also increased Geo processing service maximum time out parameter as well. But nothing works out. I could not find exact root cause for this issue.

Please help me on this immediately.



'---- Fiddler Output-------
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.]

-------------------------
Fiddler additional information

Request Header : POST /ArcGIS/rest/services/CustomTools/GPServer/SaveLineTool/Execute HTTP/1.1
Time taken : 125 seconds
----------------------------------------------

SESSION STATE: Done.
Request Entity Size: 8084 bytes.
Response Entity Size: 2548 bytes.

== FLAGS ==================
BitFlags: [ServerPipeReused] 0x10
X-CLIENTPORT: 22714
X-RESPONSEBODYTRANSFERLENGTH: 2548
X-EGRESSPORT: 22688
X-HOSTIP: 137.144.106.66
X-PROCESSINFO: iexplore:11020
X-CLIENTIP: 127.0.0.1
X-SERVERSOCKET: REUSE ServerPipe#84

== TIMING INFO ============
ClientConnected: 03:06:39.994
ClientBeginRequest: 03:06:39.994
ClientDoneRequest: 03:06:39.994
Determine Gateway: 0ms
DNS Lookup:   0ms
TCP/IP Connect: 0ms
HTTPS Handshake: 0ms
ServerConnected: 03:00:52.574
FiddlerBeginRequest: 03:06:39.994
ServerGotRequest: 03:06:39.994
ServerBeginResponse: 03:08:43.486
ServerDoneResponse: 03:08:43.486
ClientBeginResponse: 03:08:43.486
ClientDoneResponse: 03:08:43.486

Overall Elapsed: 00:02:03.4920195

The response was buffered before delivery to the client.

== WININET CACHE INFO ============
This URL is not present in the WinINET cache.

* Note: Data above shows WinINET's current cache state, not the state at the time of the request.
* Note: Data above shows WinINET's Medium Integrity (non-Protected Mode) cache
0 Kudos
12 Replies
LakshmananVenkatesan1
New Contributor
I have almost identified the probable root cause for the issue. One of input parameter is GPFeatureRecordSetLayer where featureset contains a single polygon. In my test case, the polygon has 13 rings. [12 exlcusions] . Outer ring has nearly 83 vertices and exclusions has rougly 10 vertices each.

So nearly 160 vertices sent as input. This is causing the issue. When I try with smaller polygon it works fine.

Do you want to simplify the  input polygon?
Do we have any limitation on sliverlight for polygon. Because input will be internally JSOn to GP tool hence the problem.
Any inputs on this?

Note: I am using sliverlight 2.1 version.

What GP tool goes to failed event?. What is the reason for showing 500 error/timed out. These are really weired. I am using ArcGIS 10 on server side tool.

Any more pointers are helpful?
0 Kudos
JMcNeil
Occasional Contributor III
Have you tried to bump up the time out parameters in Manager for your GP Service?  Go in the service (in manager) under the pooling tab bump up the Timeouts
The maximum time a client can use a service:  seconds
The maximum time a client will wait to get a service:  seconds
The maximum time an idle instance can be kept running:  seconds

Maybe even increase the Maximum Number of Records Returned by Server: (under parameters) then try again and see if that helps.

Jay
0 Kudos
Esriguy
New Contributor III
Jay,

Thanks for your inputs. Yes,  I have increased all time out parameters. This custom GP Tool will do some heavy weight spatial operations at server and returns the success/failed message. As said, input polygon is very complex one having 12 exclusion polygons with 160 vertices. It looks like input geometry is an issue.
When I pass simple geometry tool works fine. Now, my question are..

a) why does the GP tool goes to failed event when input is incorrect/not appropriate
b) Why it showing "The remote server returned an error: NotFound." exception
c) Why there is no proper error message provided by GP tool
d) Do we have any specific events to validate the input Geometry at client side?
e) Note: I am using ESRI SL 2.1. Does latest version of API has new methods on this?. I am yet to check the API library.

Error message displayed really provides no information for me as a developer.

Please help on this. This is bit urgent for me.
0 Kudos
Esriguy
New Contributor III
repost... please help on this
0 Kudos
JenniferNery
Esri Regular Contributor
Try to use Fiddler with your application and see what web request it's making. See if that URL can be visited from your web browser. Also check the web response if there's any useful error message.
0 Kudos
Esriguy
New Contributor III
Jennifer,

Thanks. I have done all these steps, still could not find the exact reason. I could able to access the URL from browser. Fiddler response is remote server returned an error.

My question :

a) Why Geoprocessor call goes to failed event?.
b) In what are all the scenarios where GP tool will return remote server returned an error?

As I said, when I send simple polygon as input, tool works fine. Do we have any limitation with polygon rings in sliverlight 2.1

Complete web response from fiddler is copied in first reply.
0 Kudos
Esriguy
New Contributor III
Repost and brought forward
0 Kudos
JenniferNery
Esri Regular Contributor
Check to see if the web request was a POST or a GET. I believe we had a fix some time after 2.1. Can you see if you can repro with 2.4?

To answer your questions:

a. Failed event is raised when web request failed.
b. "Server: NotFound" is usually thrown when the URL is wrong or method is incorrect. To know if this is an API bug, copy the URL from Fiddler and see if you can make the request from web browser.
0 Kudos
Esriguy
New Contributor III
Thank you Jennifer.

We are facing this issue for quite  while, since this is a production issue our customers are really frustrated.  Just to re-iterate you, this POST request.

1) URL is available and correct and able to browse /execute from the web browser with out any issues. So this is not an API bug.
2) When I pass the simple polygon it works fine without issues, so I suspect sliverlight 2.1 throws an error because of sending complex polygon to GP tool hence it displays this error.

Jennifer, all I can request you in can you post defect /incident id for this issue specifically?. So that I can pass to my customer and start upgrading to 2.4.

This is very urgent for me. Please do needful.
0 Kudos