Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several feature classes and a lot of services. When I try to make my feature class versioned I get the message that the feature class is locked which is obvious. But it's not telling me by which service it's locked.

Is there a possibility to work through all feature classes with ARCPY and find out in which service it's referenced?

Thnxs for all answers!

share|improve this question

ArcGIS Server 10.1+:

You can do this, however there is no out-of-the-box functionality for this. The information about what feature classes are used (and from what database files they are coming) is not exposed via ArcGIS Server Manager / Services Directory / REST Admin.

However, this information is stored as service metadata within C:\arcgisserver\directories\arcgissystem\arcgisinput\ServicePaths.MapServer\extracted folder in manifest.xml file (there are both .json and .xml). .Xml file contains more detailed information, I recommend parsing this file (but you could start with .json first to get the idea).

Two tags you should look at in .xml file are <Name>ServicePaths</Name> - service name and multiple <OnPremisePath>C:\GIS\Temp\test.gdb\StopsSandiego</OnPremisePath> tags which will contain feature classes names and their catalog/geodatabase path.

Code wise, you could use Python to parse this .xml file, get a dictionary with this structure:

{str:(tuple)} #data type

{servicename:(featureclasspath)} #pseudocode
{servicename:(fc1,fc2,fc3); servicename1:(fc1,fc2); servicename2:(fc5);...} #pseudocode

When you are done with that, you can write a function that will return the key of the dictionary (servicename) based on the value (feature class path name you supply). This will let you know what services you should stop to release the lock to the feature class.

UPDATE April 2016: you can do this with the REST API service manifest for the service, added in ArcGIS Server 10.1 SP1:


where %format% is either json or xml

A post with full answer is here: Python script to print the feature classes which are referencing AGS map services

ArcGIS Server 10.0:

Go to C:\Program Files (x86)\ArcGIS\Server10.0\server\user\cfg and open the .cfg file associated with your service. Look for the <FilePath> tag. Now you can iterate through all .cfg files in this folder with Python and get information on what .mxd files are used and since you have access to the .mxd you can get each layer data source path and thus feature class names.



share|improve this answer
Alex, thanxs for the answer. I understand it but it looks to me that you're answer is related to version 10.1. I'm working with 10.0 (;-() and can't find that directory structure exactly and the xml file. Any hints? Thnxs!! – user32324 Jun 13 '14 at 7:46
Ah I see. I've modified my answer to meet your needs. – Alex Tereshenkov Jun 13 '14 at 16:12
Alex, thanxs again for your answer. It's clear to my now and can advance with my "search". – user32324 Jun 17 '14 at 9:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.