<?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: arcpro 2.6 arcpy fgdb lock files not clearing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675513#M52280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cooper - do you know if there is a way to circumvent this problem?&amp;nbsp; I have a number of critical scripts that are broken due this bug.&amp;nbsp; I'm willing to go in and add some code if necessary.&amp;nbsp; It looks to me like the only way to get rid of that lock file is to end the python script's process, but to do that in the middle of the script is really not feasible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Oct 2020 18:44:28 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2020-10-03T18:44:28Z</dc:date>
    <item>
      <title>arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675510#M52277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently upgraded to Arcpro 2.6 and am having issues with an ArcPy script that exported data to a file geodatabase and then zipped that fgdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;res=arcpy.FeatureClassToFeatureClass_conversion(in_features=inFeature, out_path=I10_fgdb, out_name=FC)&lt;BR /&gt; del res&lt;/P&gt;&lt;P&gt;&amp;nbsp;shutil.make_archive(fgdbPath, 'zip', ZipPath,fgdb)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked just fine in 2.5.X, however, after the upgrade, the lock file in the FGDB directory is not going away and that causes the zip to fail. How can I get ArcPy to clear the lockfile in a FGDB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2020 19:53:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675510#M52277</guid>
      <dc:creator>KennethSmith1</dc:creator>
      <dc:date>2020-08-03T19:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675511#M52278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this worked in 2.5, I would report to Technical Support.&lt;/P&gt;&lt;P&gt;Arcpy can't clear locks... it is well requested item&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2020 20:10:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675511#M52278</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-08-03T20:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675512#M52279</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/402411"&gt;Kenneth Smith&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like this issue has been reported as a bug with 2.6:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;[ BUG-000133976:&amp;nbsp;Unexpected behavior creating file geodatabases at 2.6 ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Cooper&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2020 00:13:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675512#M52279</guid>
      <dc:creator>CooperLogan</dc:creator>
      <dc:date>2020-09-19T00:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675513#M52280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cooper - do you know if there is a way to circumvent this problem?&amp;nbsp; I have a number of critical scripts that are broken due this bug.&amp;nbsp; I'm willing to go in and add some code if necessary.&amp;nbsp; It looks to me like the only way to get rid of that lock file is to end the python script's process, but to do that in the middle of the script is really not feasible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Oct 2020 18:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675513#M52280</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-10-03T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675514#M52281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzMzk3Ng==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzMzk3Ng=="&gt;BUG-000133976: Unexpected behavior occurs when creating file geodat..&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no alternate solution provided&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Oct 2020 19:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675514#M52281</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-10-03T19:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675515#M52282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My major issue was I was trying to zip the fgdb and it was causing it to break when using the shutil.make_archive. I coded around it in the following way by avoiding the lock files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# shutil.make_archive(fgdbPath, 'zip', ZipPath,fgdb)&amp;nbsp; -- this breaks with this bug&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zf = zipfile.ZipFile(FGDBArchive, "w")&lt;BR /&gt; for dirname, subdirs, files in os.walk(fgdbPath):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for filename in files:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zfilename, zfileext = os.path.splitext(filename)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (zfileext != ".lock"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zf.write(os.path.join(fgdbPath, filename), os.path.join(fgdb, filename), zipfile.ZIP_DEFLATED)&lt;BR /&gt; zf.close()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 14:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675515#M52282</guid>
      <dc:creator>KennethSmith1</dc:creator>
      <dc:date>2020-10-05T14:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675516#M52283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Don,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One workaround that allowed some users to circumvent the problem is to add the following line right before the script errors out:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;arcpy.ClearWorkspaceCache_management()&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cooper&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/359537"&gt;Don Morrison&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 15:41:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675516#M52283</guid>
      <dc:creator>CooperLogan</dc:creator>
      <dc:date>2020-10-05T15:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675517#M52284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/349957"&gt;Cooper Logan&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;I am confused. This issue is about File Geodatabases being kept locked. The workaround you suggested shouldn't work according to &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/clear-workspace-cache.htm"&gt;this Help page&lt;/A&gt;, as &lt;STRONG&gt;arcpy.ClearWorkspaceCache_management()&lt;/STRONG&gt; is only supposed to do anything for Enterprise Geodatabases, not File Geodatabases. The Help is quite adamant on that aspect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"This tool only works with enterprise geodatabase workspaces."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 20:37:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675517#M52284</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2020-10-05T20:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675518#M52285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also wonder if this issue is actually being worked on? This is a quite hideous issue, causing significant problems for arcpy / Python development. I have reported a similar issue to the Dutch branch of ESRI based on a custom arcpy Python geoprocessing tool of mine that suddenly started failing going from Pro 2.4.3 to Pro 2.5, and the issue was also caused by left over *.lock files in a File Geodatabase folder, that weren't being cleaned up in Pro 2.5, while not an issue and being cleared properly in Pro 2.4.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is registered as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: #1f497d;"&gt;BUG-000131154 Fgdb locking behavior is different in ArcGIS Pro 2.5 to ArcGIS Pro 2.4.3 for copying styles&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 20:44:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675518#M52285</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2020-10-05T20:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675519#M52286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent idea. I was already using similar code to zip the file so it was an easy modification to filter out the .lock files.&amp;nbsp; I was expecting have have problems deleting the file geodatabase after the zip but that seems to work OK even with the .lock file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 21:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/675519#M52286</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-10-05T21:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/1095068#M62237</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15724"&gt;@MarcoBoeringa&lt;/a&gt;, I saw your reply, but decided to give it a try anyway, and found it worked! Mine is a file geodatabase. Just thought I should share&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 19:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/1095068#M62237</guid>
      <dc:creator>JustinKraemer</dc:creator>
      <dc:date>2021-09-02T19:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpro 2.6 arcpy fgdb lock files not clearing</title>
      <link>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/1473200#M70594</link>
      <description>&lt;P&gt;I would add that I also used this solution to resolve a lock on an FGDB prior to trying to zip it with py.shutil and it resolved my issue as well even through it's an FGDB!&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 20:43:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpro-2-6-arcpy-fgdb-lock-files-not-clearing/m-p/1473200#M70594</guid>
      <dc:creator>GavinMcGhie</dc:creator>
      <dc:date>2024-05-15T20:43:13Z</dc:date>
    </item>
  </channel>
</rss>

