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