I have a complex multi-modal network dataset with some scripted evaluators defined for edges and default turns. The route generation and evaluators work perfectly on our development ArcGIS Server 10.3.1. However, when deployed to a hardened production server, the default turn evaluators fail miserably with the following error in the MapServer log:
System.Runtime.InteropServices.COMException (0x80042270): The evaluator failed to return a value. [Attribute: NoBargeToTruck, Default Turns, OID = -1, EID = -1]. Network element evaluator error. [Script Control Error -2147352319].
In the Server/framework/etc/service/logs/service.log, I am seeing this Java stack trace:
:ExecGroup-1488:err:Exception in thread "SOThread" java.lang.RuntimeException: java.lang.NoSuchFieldError: a
:ExecGroup-1488:err: at com.esri.arcgis.discovery.servicelib.impl.SOThread.run(SOThread.java:476)
:ExecGroup-1488:err:Caused by: java.lang.NoSuchFieldError: a
:ExecGroup-1488:err: at com.esri.arcgis.interop.StdObjRef.b(Unknown Source)
:ExecGroup-1488:err: at com.esri.arcgis.interop.Cleaner.releaseAllInCurrentThread(Unknown Source)
:ExecGroup-1488:err: at com.esri.arcgis.discovery.servicelib.impl.SOThread.b(SOThread.java:1178)
:ExecGroup-1488:err: at com.esri.arcgis.discovery.servicelib.impl.SOThread.run(SOThread.java:414)
I've turned off all restrictions except for one and through various trials, I have found that this works:
Body:
Dim prohibit
prohibit = false
Value:
prohibit
But this fails:
Body:
Dim prohibit
prohibit = false
dim test
test = Turn.EID
Value:
prohibit
Accessing ANY of the network elements (Turn, fromEdge, toEdge) fails with the COMException but only for default turns. Scripts on Edges work just fine. The Server is Windows 2008 R2 64-bit. The network dataset is served from a file-geodatabase.
Any thoughts?
I spent a couple of weeks with Esri Technical Support to determine what the problem was.
Short answer:
You MUST install the corresponding ArcGIS Desktop (ArcMap) on the same server, but you don't need to license it. The issue has been resolved in ArcGIS Server/Enterprise 10.5.1.
Long Answer:
We couldn't duplicate it until I created a test VM and ran through many iterations of installing, uninstalling, upgrading, and VM snapshotting. I eventually found that everything works if ArcMap is installed and fails if ArcMap is uninstalled. Apparently the ArcMap installation includes some DLLs and/or registry settings that are needed for some script/custom evaluators that the ArcGIS Server install does not include. I tried doing some filesystem and registry comparisons before and after installs to find the differences and create a small "patch", but that was taking too much time. For now, a full 3GB install of unnecessary 32-bit DLLs and other stuff is still needed. They said they would respond to this thread, but I guess it fell off their radar.
Answer from Esri after I identified the problem (July 20, 2017):