I'm using the 10.2.6 runtime for .NET, and due to a bug in the API, I had to use the REST API to add features to a layer (this bug causing custom M values to throw an exception, see here).
The code to access this functionality via the REST API was working great right up until a few weeks ago when we added a rather large polyline to the layer. When this line was added I get an exception from the local server. Viewing the logs from the server I see this:
2016-03-15 11:30:19,867 ERROR rid=24 'worker-1976' Core - GraphicFeatureServer.HandleREST_AddFeaturesOperation (code=17000): Database error: The spatial index grid size is invalid. [CustomLineLayer01]. The spatial index grid size is invalid.
Now here's the weird thing. If I add this feature via a REST call individually from a list of lines, it fails. But, if I add it as part of a group of features in the same REST call, it works just fine (all other lines are very small in comparison to this one).
Furthermore, if I just add this long line by itself, it works fine, but, if I add the smaller lines prior to this, it fails with that exception.
The only help I've seen online is about setting the "LoadOnly" property to true on the table. However, this is no good to me as that advice was for ArcObjects.
So my question is this: Can I disable the spatial index grid via REST prior to adding lines? Or is there another, easier way to get around this problem?
It is very difficult to duplicate this problem with a sample, but if required, I'll do what I can to make one.
I've gone ahead and created a sample to illustrate the error. It is attached to this comment.
To replicate the error:
An error message about Error code 500 addFeature failing should appear. If it does not, try zooming out further.
Hi Mike,
Do you have access to an ArcGIS Server instance?
Cheers
Mike
No, I'm afraid I don't. Also, our customers are not guaranteed to have access to one either.
We are having the same issue.