<?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 Bug when re-creating force deleted external location in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/bug-when-re-creating-force-deleted-external-location/m-p/83591#M1608</link>
    <description>&lt;P&gt;When re-creating an external location that was previously force-deleted (because it had a soft-deleted managed table), the newly re-created external location preserves the reference to the soft-deleted managed table from the previous external location, with no possibility of purging. This will happen for all future external locations that are created with the same name and at the same physical location.&lt;/P&gt;&lt;P&gt;Steps to reproduce:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;create external location&lt;/LI&gt;&lt;LI&gt;create schema on external location&lt;/LI&gt;&lt;LI&gt;create table on schema&lt;/LI&gt;&lt;LI&gt;drop table&lt;/LI&gt;&lt;LI&gt;force-delete external location (forcing is necessary because the reference to the soft-deleted table is retained)&lt;/LI&gt;&lt;LI&gt;optional: manually delete content (metadata __unitystorage) of physical external location. Optional because it makes no difference if this is done or not)&lt;/LI&gt;&lt;LI&gt;create new external location with the same name at the same physical location&lt;/LI&gt;&lt;LI&gt;delete the new external location: it will fail due to a reference to the dependent soft deleted table from the previous external location&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I'm aware that the correct way to completely delete a managed table (including references and physical data) is longer (see e.g.&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.databricks.com/en/delta/vacuum.html#purge-metadata-only-deletes-to-force-data-rewrite" target="_blank"&gt;https://docs.databricks.com/en/delta/vacuum.html#purge-metadata-only-deletes-to-force-data-rewrite&lt;/A&gt;) but it's very unintuitive for Unity Catalog to maintain the reference to soft deleted tables past external location deletion hardcoded through external location name + physical location.&lt;/P&gt;&lt;P&gt;Normally (e.g. for Azure resources) soft deleted objects should still be readable so that one can still act on them (e.g. for purging or restoring). How does Databricks handle this? And equally importantly where is the metadata for this association to soft-deleted objects stored?&lt;/P&gt;&lt;P&gt;Does anyone know a workaround, or is that external location name burnt forever?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 11:47:18 GMT</pubDate>
    <dc:creator>camilo_s</dc:creator>
    <dc:date>2024-08-20T11:47:18Z</dc:date>
    <item>
      <title>Bug when re-creating force deleted external location</title>
      <link>https://community.databricks.com/t5/administration-architecture/bug-when-re-creating-force-deleted-external-location/m-p/83591#M1608</link>
      <description>&lt;P&gt;When re-creating an external location that was previously force-deleted (because it had a soft-deleted managed table), the newly re-created external location preserves the reference to the soft-deleted managed table from the previous external location, with no possibility of purging. This will happen for all future external locations that are created with the same name and at the same physical location.&lt;/P&gt;&lt;P&gt;Steps to reproduce:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;create external location&lt;/LI&gt;&lt;LI&gt;create schema on external location&lt;/LI&gt;&lt;LI&gt;create table on schema&lt;/LI&gt;&lt;LI&gt;drop table&lt;/LI&gt;&lt;LI&gt;force-delete external location (forcing is necessary because the reference to the soft-deleted table is retained)&lt;/LI&gt;&lt;LI&gt;optional: manually delete content (metadata __unitystorage) of physical external location. Optional because it makes no difference if this is done or not)&lt;/LI&gt;&lt;LI&gt;create new external location with the same name at the same physical location&lt;/LI&gt;&lt;LI&gt;delete the new external location: it will fail due to a reference to the dependent soft deleted table from the previous external location&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I'm aware that the correct way to completely delete a managed table (including references and physical data) is longer (see e.g.&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.databricks.com/en/delta/vacuum.html#purge-metadata-only-deletes-to-force-data-rewrite" target="_blank"&gt;https://docs.databricks.com/en/delta/vacuum.html#purge-metadata-only-deletes-to-force-data-rewrite&lt;/A&gt;) but it's very unintuitive for Unity Catalog to maintain the reference to soft deleted tables past external location deletion hardcoded through external location name + physical location.&lt;/P&gt;&lt;P&gt;Normally (e.g. for Azure resources) soft deleted objects should still be readable so that one can still act on them (e.g. for purging or restoring). How does Databricks handle this? And equally importantly where is the metadata for this association to soft-deleted objects stored?&lt;/P&gt;&lt;P&gt;Does anyone know a workaround, or is that external location name burnt forever?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 11:47:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/bug-when-re-creating-force-deleted-external-location/m-p/83591#M1608</guid>
      <dc:creator>camilo_s</dc:creator>
      <dc:date>2024-08-20T11:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when re-creating force deleted external location</title>
      <link>https://community.databricks.com/t5/administration-architecture/bug-when-re-creating-force-deleted-external-location/m-p/137563#M4372</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Databricks Unity Catalog currently maintains references to soft-deleted managed tables even after the associated external location is force-deleted and re-created with the same name and physical location, causing persistent deletion failures due to lingering dependencies. This behavior is different from typical cloud resource handling (like Azure), where soft-deleted objects are explicitly recoverable, restorable, or purgable by direct user action.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;How Databricks Handles Soft-Deleted References&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;When you force-delete an external location that has soft-deleted managed tables, Unity Catalog still retains metadata tying the external location name and physical path to those tables.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Re-creating an external location with the same name and path leads Unity Catalog to "reattach" the metadata of previously soft-deleted tables, making it impossible to purge or remove them via normal UI/commands.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Attempting to delete the newly created external location fails, citing dependent soft-deleted tables, even if all physical data and metadata content at the physical location has been manually cleared.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;The association metadata is managed at the Unity Catalog service layer, not in the underlying file store, meaning deleting content at the storage does not affect these references.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Location of Metadata for Soft-Deleted Associations&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;The metadata associating external locations and soft-deleted managed tables is stored internally in Unity Catalog's backend, which uses its own persistent metadata storage beyond the control of standard file system operations or Delta Lake commands.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This metadata is not directly visible or editable to the user and cannot be purged by clearing the physical external location (e.g., deleting the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;__unitystorage&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Only certain Unity Catalog administrative APIs or support tools could theoretically access or clean up these references, but such functionality is not exposed to end users for safety and consistency reasons.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Workarounds and Permanent Consequences&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;There is no documented workaround to purge these lingering soft-deleted references when re-using the same external location name and physical location—making the external location "burnt" for future use unless Databricks enhances this logic.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;The only feasible current solution is to always use a new external location name or a different underlying path when re-creating external locations, thereby avoiding Unity Catalog's residual associations.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Databricks support or engineering can sometimes manually clean up such orphaned metadata, but official channels and change requests are required.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Key Points Table&lt;/H2&gt;
&lt;DIV class="group relative"&gt;
&lt;DIV class="w-full overflow-x-auto md:max-w-[90vw] border-subtlest ring-subtlest divide-subtlest bg-transparent"&gt;
&lt;TABLE class="border-subtler my-[1em] w-full table-auto border-separate border-spacing-0 border-l border-t"&gt;
&lt;THEAD class="bg-subtler"&gt;
&lt;TR&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Action&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Result/Behavior&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Can Be Purged Manually?&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Recommended Action&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Force-delete external location&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Soft-deleted table references persist in Unity Catalog metadata&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;No&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Use a new name/path for new external location&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Manually delete physical content&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;No effect: metadata is stored at Unity Catalog layer&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;No&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Contact Databricks support for metadata cleanup&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Re-use name &amp;amp; path for location&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Triggers reference to lingering soft-deleted objects&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;No&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Avoid reusing name/path; select new ones for future use&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;DIV class="bg-base border-subtler shadow-subtle pointer-coarse:opacity-100 right-xs absolute bottom-0 flex rounded-lg border opacity-0 transition-opacity group-hover:opacity-100 [&amp;amp;&amp;gt;*:not(:first-child)]:border-subtle [&amp;amp;&amp;gt;*:not(:first-child)]:border-l"&gt;
&lt;DIV class="flex"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="flex"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Additional Notes&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Unity Catalog's retention of soft-deleted table references is meant to maintain strict data lineage and recoverability but introduces unintuitive, persistent orphaned metadata in this scenario.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;For true deletion, you must follow full purge steps at the managed table level rather than relying on force-deletion of the external location.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If stuck, reach out to Databricks support for possible manual intervention during migration or cleanup.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;For more details and purge instructions, Databricks publishes specific guidance in their&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="reset interactable cursor-pointer decoration-1 underline-offset-1 text-super hover:underline font-semibold" href="https://docs.databricks.com/en/delta/vacuum.html#purge-metadata-only-deletes-to-force-data-rewrite" target="_blank" rel="nofollow noopener"&gt;&lt;SPAN class="text-box-trim-both"&gt;Delta Lake vacuum and deletion documentation&lt;/SPAN&gt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 12:53:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/bug-when-re-creating-force-deleted-external-location/m-p/137563#M4372</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-04T12:53:04Z</dc:date>
    </item>
  </channel>
</rss>

