<?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 Zip archive with PowerShell &amp;quot;Error: The zip file may not be valid or may be an unsupported version.&amp;quot; in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/121346#M46427</link>
    <description>&lt;P class=""&gt;Zip archive "Error: The zip file may not be valid or may be an unsupported version."&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;We are trying to upload a ZIP archive to a Databricks workspace for faster and atomic uploads of artifacts. The expected behaviour is that we can run the following command to upload a zip file that is automatically unpacked into a Workspace directory. `databricks workspace import /Workspace/Shared/development/dbt/data_platform.zip --file C:\Users\...\data_platform\transformations\data_platform.zip --profile development --format AUTO` However, we get the error message "Error: The zip file may not be valid or may be an unsupported version." when compressing the archive via PowerShell. We have tried the `Compress-Archive` cmdlet and `[System.IO.Compression.ZipFile]::CreateFromDirectory()`. This error does not occur when we use Windows UI (right-click compress) or 7Zip.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I have reviewed documentation and blog posts but can't find any useful information. I've also raised a support ticket with Databricks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please share if you have insights, a fix or workaround for this! Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jun 2025 14:51:38 GMT</pubDate>
    <dc:creator>LeoGriffM</dc:creator>
    <dc:date>2025-06-10T14:51:38Z</dc:date>
    <item>
      <title>Zip archive with PowerShell "Error: The zip file may not be valid or may be an unsupported version."</title>
      <link>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/121346#M46427</link>
      <description>&lt;P class=""&gt;Zip archive "Error: The zip file may not be valid or may be an unsupported version."&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;We are trying to upload a ZIP archive to a Databricks workspace for faster and atomic uploads of artifacts. The expected behaviour is that we can run the following command to upload a zip file that is automatically unpacked into a Workspace directory. `databricks workspace import /Workspace/Shared/development/dbt/data_platform.zip --file C:\Users\...\data_platform\transformations\data_platform.zip --profile development --format AUTO` However, we get the error message "Error: The zip file may not be valid or may be an unsupported version." when compressing the archive via PowerShell. We have tried the `Compress-Archive` cmdlet and `[System.IO.Compression.ZipFile]::CreateFromDirectory()`. This error does not occur when we use Windows UI (right-click compress) or 7Zip.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I have reviewed documentation and blog posts but can't find any useful information. I've also raised a support ticket with Databricks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please share if you have insights, a fix or workaround for this! Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 14:51:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/121346#M46427</guid>
      <dc:creator>LeoGriffM</dc:creator>
      <dc:date>2025-06-10T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Zip archive with PowerShell "Error: The zip file may not be valid or may be an unsupported</title>
      <link>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/121348#M46429</link>
      <description>&lt;P&gt;May relate to feature request&amp;nbsp;&lt;A href="https://github.com/databricks/cli/issues/1221" target="_blank"&gt;https://github.com/databricks/cli/issues/1221&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 14:54:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/121348#M46429</guid>
      <dc:creator>LeoGriffM</dc:creator>
      <dc:date>2025-06-10T14:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Zip archive with PowerShell "Error: The zip file may not be valid or may be an unsupported</title>
      <link>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/136627#M50612</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;The error message "Error: The zip file may not be valid or may be an unsupported version" when importing a zip archive via the Databricks CLI is a known issue, especially with zip files created using PowerShell's&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Compress-Archive&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;[System.IO.Compression.ZipFile]::CreateFromDirectory()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;methods. This problem does not occur when using third-party tools like 7-Zip or the native Windows file explorer right-click compress feature.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Why PowerShell Zips Fail&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;PowerShell's zip implementation often produces archives with metadata or file structure nuances that are technically valid but can be incompatible with some applications, including Databricks CLI's import 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;Databricks CLI appears to have stricter requirements about the zip file format (particularly central directory structure and possibly compression methods), which PowerShell's tools might not meet.​&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;There is ongoing discussion and feature requests about supporting zips from PowerShell, but as of the latest updates, these issues persist.​&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 &amp;amp; Recommendations&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;Use the Windows File Explorer (“Send to &amp;gt; Compressed (zipped) folder”) or 7-Zip to create zip files for Databricks workspace imports.​&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;Avoid PowerShell and .NET zip creation utilities for these uploads, as their outputs may trigger compatibility errors.&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 you require automation in your workflow, consider scripting with third-party CLI tools like 7-Zip via command line (&lt;CODE&gt;7z a myzip.zip .&lt;/CODE&gt;) for zip creation.&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;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;Databricks workspace import via CLI currently does not support all zip archive formats. Only zips with certain directory structures and compression methods may be accepted.​&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;You might also want to look for updates to the Databricks CLI or open feature requests on the official GitHub page as work is underway to improve compatibility.​&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;Summary 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;Zip Tool&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Compatible with Databricks Import&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Notes&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;PowerShell&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;Causes “unsupported version” error​&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;[System.IO.Compression]&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;Same as above​&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;Windows Explorer&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Yes&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;“Send to &amp;gt; Compressed (zipped) folder”&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;7-Zip&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Yes&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;CLI or GUI&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;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To resolve your issue, always use Windows Explorer or 7-Zip for creating zip archives destined for Databricks workspace imports.​&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 20:14:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/zip-archive-with-powershell-quot-error-the-zip-file-may-not-be/m-p/136627#M50612</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-10-29T20:14:59Z</dc:date>
    </item>
  </channel>
</rss>

