<?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: Upgraded to ArcGIS Pro 2.6: arcpy.CreateFileGDB_management() now leaving an sr.lock in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189916#M14571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just upgraded to 2.6 and my applications are broken for the same reason.&amp;nbsp; I really need a fix or a circumvention immediately - please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2020 19:30:57 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2020-09-25T19:30:57Z</dc:date>
    <item>
      <title>Upgraded to ArcGIS Pro 2.6: arcpy.CreateFileGDB_management() now leaving an sr.lock</title>
      <link>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189914#M14569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To summarize my current workflow, I use tkinter in Python 3.x (Esri's release that accompanies each Pro update) to execute some Esri geoprocessing functions for exporting SDE data (Create local File GDB, export feature classes from the SDE into the File GDB, run some field calculations, zip up the File GDB, etc.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This workflow has been working just fine for me these past few minor releases of Pro. However, with the recent upgrade to Pro 2.6, I'm running into errors related to arcpy's&lt;STRONG&gt; CreateFileGDB_management()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create a file geodatabase through arcpy, it's leaving a "_gdb" sr.lock in place even after the file geodatabase has been created.&amp;nbsp; All other functions that occur after this step (export feature classes, field calculations, etc.) properly release their locks upon completion. However, this one lock gets stuck for some reason during the File GDB creation step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502582" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/502582_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This has caused some of my applications to have problems with regard to zipping and migrating data due to the lock persisting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some experimentation, I can get the sr.lock to release by executing the &lt;STRONG&gt;arcpy.ClearWorkspaceCache_management()&lt;/STRONG&gt; option. However, I've never needed to use this previously when creating local File GDBs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this sr.lock working as intended, or could there have been a bug introduced in Pro 2.6? Again, this has not been an issue for my tools in Pro 2.x prior to 2.6, so I'm curious if anyone is encountering this issue now as well. Thanks for your assistance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code for this particular function, and this is where I've isolated the sr.lock hanging:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;func_Create_GDB&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;# This function creates an empty File GDB that will be used to house the exported Regional SDE feature classes.&lt;/SPAN&gt;


        &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# This string creates a naming convention for the new QC Prepped GDB.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gdb_name_prepped &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gdb_name_prepped &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;input_zip_file_name_date_only

            &lt;SPAN class="comment token"&gt;# Display message within scrolled text box.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_Scroll_SetOutputText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Creating File GDB:\n"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;
                                           self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gdb_name_prepped &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;string_gdb &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\n"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;
                                           &lt;SPAN class="string token"&gt;"Saving to:\n"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;
                                           self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;output_folder &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;input_zip_file_name_date_only&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Creates the File GDB with the new GDB naming convention.&lt;/SPAN&gt;
            arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateFileGDB_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;output_folder &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;input_zip_file_name_date_only&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                           self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gdb_name_prepped&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Display all geoprocessing messages within scrolled text box with blue text.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_Scroll_SetOutputText&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; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;color_Blue&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Increment progress bar by 2 percent.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;percent_value &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;percent_value &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_ProgressBar_SetProgress&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;percent_value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Once task has completed, display message within scrolled text box.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_Scroll_SetOutputText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Output GDB created!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Change function check message from Failure to Success.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;check_func_Create_GDB &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;message_Success

        &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Display message within scrolled text box.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_Scroll_SetOutputText&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="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; stat_val&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;color_Red&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Set progress bar to 100 percent.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;func_ProgressBar_SetProgress&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;# Set completion boolean to False if failure occurs.&lt;/SPAN&gt;
            self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;check_complete &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189914#M14569</guid>
      <dc:creator>DavidLindsey2</dc:creator>
      <dc:date>2021-12-11T09:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded to ArcGIS Pro 2.6: arcpy.CreateFileGDB_management() now leaving an sr.lock</title>
      <link>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189915#M14570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/78905"&gt;David Lindsey&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sounds like an issue which has been logged as a defect with Pro 2.6.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ BUG-000133976:&amp;nbsp;Unexpected behavior creating file geodatabases at 2.6 ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions!&lt;/P&gt;&lt;P&gt;Cooper&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2020 00:10:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189915#M14570</guid>
      <dc:creator>CooperLogan</dc:creator>
      <dc:date>2020-09-19T00:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded to ArcGIS Pro 2.6: arcpy.CreateFileGDB_management() now leaving an sr.lock</title>
      <link>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189916#M14571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just upgraded to 2.6 and my applications are broken for the same reason.&amp;nbsp; I really need a fix or a circumvention immediately - please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2020 19:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189916#M14571</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-09-25T19:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded to ArcGIS Pro 2.6: arcpy.CreateFileGDB_management() now leaving an sr.lock</title>
      <link>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189917#M14572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Don,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to follow up on this, which we also discussed in the other thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/257697"&gt;arcpro 2.6 arcpy fgdb lock files not clearing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like &lt;A href="https://community.esri.com/migrated-users/78905"&gt;David Lindsey&lt;/A&gt;‌ mentions here, the&amp;nbsp;arcpy.ClearWorkspaceCache_management() tool clears this issue up in many cases.&amp;nbsp; If that doesn't work, please provide some more info on your exact code or reach out to Esri Tech Support for further troubleshooting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Cooper&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 15:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/upgraded-to-arcgis-pro-2-6-arcpy-createfilegdb/m-p/189917#M14572</guid>
      <dc:creator>CooperLogan</dc:creator>
      <dc:date>2020-10-05T15:49:50Z</dc:date>
    </item>
  </channel>
</rss>

