Tag: msd

ArcGIS Server 10.4.1 Sql Server SDE 10.2.2 Feature class Data source Mismatching Issue and a Temporary Solution

We encountered this issue late last year but didn’t pay too much attention to it until it happened again today.

The Backstory

We were working on a new map service on ArcGIS Server 10.4.1. After the service was successfully published, we found that the field settings on one of the layers didn’t match the relevant settings in the mxd. The layer in the mxd file had 25 fields but the relevant service layer only had 3 fields, and the total number of the records were different.

Many efforts were made to fix the issue. We tried overwriting the Map service, recreating the Map Service, etc. None of them were able to fix the issue.

What We had Found

We took the time to inspect every single file in the MapServer folder in arcgisinput folder. It didn’t take long before we found the anomaly. It was in the msd file. To inspect the content in a msd file, simply extract the msd to a folder (I used 7-Zip). There are just a bunch of xml files in the folder.

image

In our Sql Server SDE, we use different schemas, but occasionally we have same name feature class stored in different schema. In this particular case, COUNCILASSETS.Bridges is the feature class we want to use. However, we also have ADAC.Bridges in the same database. During the publishing process, for some reason ArcGIS Server 10.4.1 used ADAC.Bridges instead of COUNCILASSETS.Bridges as data source for the layer in the ‘bridges.xml’ shown in above image. My understanding is ArcGIS Server 10.4.1 searches the feature class by name ‘Bridges’ and uses the first result in the result list.

A Temporary Solution

When the issue is known, a solution is clear. I call it temporary because it is clearly a BUG on ArcGIS Server 10.4.1.

Fortunately, as until ArcGIS 10.5 arcpy.mapping .ConvertToMSD function is still available. Run the python function to export a msd file and replace the one that ArcGIS Server 10.4.1 is created. Remember to stop the service before deleting and replacing the original msd file.

A little More

So far we found that the output msd file is fine when using ArcGIS Desktop 10.4.1.

Also found that ArcGIS Server 10.5 has the same issue.

Esri has confirmed it is a bug affecting both 10.4.1 and 10.5 ArcGIS Server.
”BUG-000099007 : When packaging a service definition, ArcGIS 10.4.1 Desktop mixes up feature classes with the same name from two different schema”