AnsweredAssumed Answered

arcpy.DisconnectUser is throwing this error - RuntimeError: Unable to disconnect: The connection ID provided is for the current administrator connection

Question asked by ben_vk on Dec 12, 2016
Latest reply on Aug 18, 2017 by ben_vk

Hi All, 

 

I have three different levels of database connection in ArcCatalog on my PC which I use to connect to our Enterprise GDB for various reasons.

 

I have my user level connection for data editing.

I have one called GISADMIN which is the Data Owner

And another with is called SDE which is the Geodatabase Admin User.

I have no access to the Database Admin User, this is managed by our in house I.T Dept.

 

I am trying to use the arcpy.DisconnectUser function in a python script, but no matter which of the connections mentioned above I use, I get the following error:

 

>>> arcpy.DisconnectUser(r'Database Connections\SDE@SDE_Spatial@SDE-DB.sde',123494)
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py", line 1086, in DisconnectUser
    return gp.disconnectUser(sde_workspace, users)
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 504, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Unable to disconnect: The connection ID provided is for the current administrator connection
>>>

 

I have confirmed this by trying to use all three connections, also trying to disconnect several different connections from my Enterprise GDB.

 

Something strange is that if I put a completely random session ID in my python snippet, the exact same error is returned....

 

 

 

 

I am perplexed as to why this is happening to me, and I am unable to track down why this seems to have started happening all of a sudden. 

 

Anyone have any troubleshooting ideas for me?  

Nathan Duncan

 

Cheers

-Ben

Outcomes