<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171743#M13210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Mehdi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to follow up with some findings. I was playing around with your suggestion, and it partially works by removing some stagnant locks. However, I do not believe it can solve all of my issues at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error.....&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;RuntimeError: Unable to disconnect: The connection ID provided is for the current administrator connection.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...which led me down a rabbit hole:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This error is occurring when I attempt to iterate each user and remove select ones matching "DBO" (which is what the script currently utilizes). Since the script itself is executing the function, it doesn't appear that I am able to disconnect the script while it's still connected.&lt;BR /&gt;&lt;BR /&gt;And since the script isn't properly disconnecting itself after running certain tools, I guess that puts me in a Catch-22 situation. Ha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Esri documentation:&lt;BR /&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/disconnectuser.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/disconnectuser.htm"&gt;DisconnectUser—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/507015_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, Esri Support let me know today that the locking issue can be replicated on the Esri side and is suspected to be a defect specific to Pro 2.6.x. I should be hearing more from Esri Support this week concerning this issue, so I'll follow up with more once I hear back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2020 23:05:40 GMT</pubDate>
    <dc:creator>David_Lindsey</dc:creator>
    <dc:date>2020-09-15T23:05:40Z</dc:date>
    <item>
      <title>ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171738#M13205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel like I've been plagued with unusual Python 3.x (arcpy) issues ever since I upgraded to 2.6.x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The latest issues I'm facing include stale SDE connections and state locks not properly releasing upon completion when I am disabling/enabling Editor Tracking (arcpy.EnableEditorTracking_management and arcpy.DisableEditorTracking_management).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workflow includes disabling editor tracking, calculating some values with an update cursor, then re-enabling editor tracking on an SDE database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After discovering some locking issues not going away, I've isolated the issue specifically to the enabling/disabling of editor tracking. I've created a testing environment (and script) for studying these tools specifically which will be provided below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually, arcpy.ClearWorkspaceCache_management does the trick and cleans up the script's locks, but that isn't working with the above tools for whatever reason in Pro 2.6 update of Python. To provide more clarity, I run many workflow tools in sequence so my goal is to clean up all locks affiliated with each tool before beginning the next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have confirmed that the state locks are properly releasing in the Python 2.7 flavor of arcpy, and I never had issues with Pro 2.2-2.5 with these issues either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my script that I've been testing with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; Static_Values &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; Class_Static_Values &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; stat_val
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; time

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sdeConnection_RegionalGIS_DefaultVersion

fc_list &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fc_list&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"EMS"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fc&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;#arcpy.DisableEditorTracking_management(fc,&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#                                       "DISABLE_CREATOR",&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#                                       "DISABLE_CREATION_DATE",&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#                                       "DISABLE_LAST_EDITOR",&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#                                       "DISABLE_LAST_EDIT_DATE")&lt;/SPAN&gt;

        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;EnableEditorTracking_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"CreateID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"DateCreate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"UpdateID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"DateUpdate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"NO_ADD_FIELDS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                              &lt;SPAN class="string token"&gt;"UTC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetMessages&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"attempting to remove locks..."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ClearWorkspaceCache_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"attempt complete..."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# The following loop allows me to review/refresh the Geodatabase Administration window for 10 seconds to verify if any locks still exist from the above line of code.&lt;/SPAN&gt;

counter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; counter &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sleep&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    counter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; counter &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else encountered this, or can you think of other options to try in order to clean up the locks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the above, isolated script gets to Line 33, two stale SDE connections and two persistent state locks remain and do not go away until the script completes its full execution after Line 41.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two stale connections are highlighted here (ignore the grayed out one, as that is my current view within Catalog for studying purposes):&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/506849_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two persistent state locks are highlighted here (ignore the grayed out one, as that is my current view within Catalog for studying purposes):&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506815_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly enough, I can get one of these state locks to disappear if I include the line &lt;STRONG&gt;arcpy.env.workspace = None&lt;/STRONG&gt; just before the arcpy.ClearWorkspaceCache_management() line, but I don't recall ever needing to do that. I also can't figure out what else is leaving the other state lock. I've tried resetting the environment, clearing the cache, garbage collection, as well as deleting the fc_list variable with no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or insight would be most appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171738#M13205</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2021-12-11T08:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171739#M13206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the type of issue... with a workaround ... that should be reported to Tech Support to have a case opened.&lt;/P&gt;&lt;P&gt;You have identified that it worked in previous issues.&lt;/P&gt;&lt;P&gt;You have provided a workaround.&lt;/P&gt;&lt;P&gt;Tech support would be the ones that can associate it with other issues that are seemingly unrelated.&lt;/P&gt;&lt;P&gt;Tech support can also test on a larger number of test cases to confirm whether it is data source and or type specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, contact Tech Support and reference this thread, in case others weigh in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2020 01:46:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171739#M13206</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-14T01:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171740#M13207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ‌&lt;A href="https://community.esri.com/migrated-users/421094" target="_blank"&gt;David Lindsey&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can right-click the available connections and select Disconnect to disconnect users from the geodatabase and run the script again. If it still has the locking issue, I recommend including the following script in your script:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'Database Connections\XXX.sde'&lt;/SPAN&gt;    
users &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListUsers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;    
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; user &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; users&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;        
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DisconnectUser&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; ‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This releases the locks created by&amp;nbsp;users.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:53:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171740#M13207</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-12-11T08:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171741#M13208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mehdi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate the feedback. I am aware that this could help remove locks, but I am hesitant to incorporate it into our scripts. We use database replication and provide various web services that act as users connected to our SDEs. The user name information that Esri tracks within the user list is not granular enough for me to determine which "DBO" user lock is directly tied to the script itself, unless I add more fancy coding to keep track of lock times perhaps (no thanks!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An idea we may consider is creating a script-specific username with DBO privileges so that I can more easily identify any locks created by the script itself. Even this seems like a band-aid fix though. I'll reach out to Esri Support today and report back any new findings. Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2020 13:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171741#M13208</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2020-09-14T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171742#M13209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Dan. Issue now logged with Esri Support. I'll report back with any new findings!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2020 14:05:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171742#M13209</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2020-09-14T14:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.6.x Issues with ArcPy: Needing help with stale connections and state locks on SDE connections</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171743#M13210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Mehdi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to follow up with some findings. I was playing around with your suggestion, and it partially works by removing some stagnant locks. However, I do not believe it can solve all of my issues at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error.....&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;RuntimeError: Unable to disconnect: The connection ID provided is for the current administrator connection.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...which led me down a rabbit hole:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This error is occurring when I attempt to iterate each user and remove select ones matching "DBO" (which is what the script currently utilizes). Since the script itself is executing the function, it doesn't appear that I am able to disconnect the script while it's still connected.&lt;BR /&gt;&lt;BR /&gt;And since the script isn't properly disconnecting itself after running certain tools, I guess that puts me in a Catch-22 situation. Ha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Esri documentation:&lt;BR /&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/disconnectuser.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/disconnectuser.htm"&gt;DisconnectUser—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/507015_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, Esri Support let me know today that the locking issue can be replicated on the Esri side and is suspected to be a defect specific to Pro 2.6.x. I should be hearing more from Esri Support this week concerning this issue, so I'll follow up with more once I hear back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 23:05:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-6-x-issues-with-arcpy-needing-help/m-p/171743#M13210</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2020-09-15T23:05:40Z</dc:date>
    </item>
  </channel>
</rss>

