Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bundled 7zip executables to v23.01 #3285

Closed
5 tasks done
msitt opened this issue Jul 28, 2023 · 3 comments · Fixed by #3287
Closed
5 tasks done

Update bundled 7zip executables to v23.01 #3285

msitt opened this issue Jul 28, 2023 · 3 comments · Fixed by #3287
Assignees
Labels
5 - Released Dependency Change If a dependency or bundled binaries are added, removed or updated.
Milestone

Comments

@msitt
Copy link

msitt commented Jul 28, 2023

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

I am trying to install a package using Install-ChocolateyZipPackage. The source file is a 7z archive created using 7z v23.01.

Choco will attempt to unpack this file using its own built in version of 7z from C:\ProgramData\chocolatey\tools\7z.exe. As of the latest version of choco v2.2.0, this version of 7z is v21.07. This version of 7z is incapable of unpacking this file, which causes the choco install to fail.

What is Expected?

I would like some way to override the 7z binary which is used for this command. I actually have the latest version of 7z installed on this machine via choco install 7zip.install.

A workaround would be the bump the bundled version of 7z to the latest.

How Did You Get This To Happen?

To reproduce, you must create an archive which is incompatible with the bundled version of 7z. In the case of 7z v23 vs v21, 7z has an improved way of compressing ARM libraries. As an example you can find some binaries in the Microsoft.Data.SqlClient.SNI NuGet package. If you compress these files using v23, you will get a 7z file which will fail to install using choco v2.2.0.

System Details

  • Operating System: Windows Server 2019
  • Windows PowerShell version: 5.1.17763.2803
  • Chocolatey CLI Version: 2.2.0

Installed Packages

Chocolatey v2.2.0
7zip 23.1.0
7zip.install 23.1.0
chocolatey 2.2.0
chocolatey-core.extension 1.3.5.1

Output Log

2023-07-27 20:50:41,541 8404 [DEBUG] - Running Install-ChocolateyZipPackage -packageName 'InternalPackage' -url 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' -unzipLocation 'E:\InternalPackage\bin' -specificFolder '' 
2023-07-27 20:50:41,588 8404 [DEBUG] - Running Get-ChocolateyWebFile -checksum '' -checksumType '' -checksum64 '' -checksumType64 '' -options 'System.Collections.Hashtable' -getOriginalFileName 'True' -packageName 'InternalPackage' -fileFullPath 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackageInstall.zip' -url 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' -url64bit '' 
2023-07-27 20:50:41,588 8404 [DEBUG] - Running Get-ProcessorBits -compare '64' 
2023-07-27 20:50:41,603 8404 [DEBUG] - CPU is 64 bit
2023-07-27 20:50:41,619 8404 [DEBUG] - Running Get-WebHeaders -url 'https://XXXXXXXX/InternalPackage.5.0.0.292.7z' -ErrorAction 'Stop' 
2023-07-27 20:50:41,650 8404 [DEBUG] - Setting the UserAgent to 'chocolatey command line'
2023-07-27 20:50:41,650 8404 [DEBUG] - Request Headers:
2023-07-27 20:50:41,666 8404 [DEBUG] -   'Accept':'*/*'
2023-07-27 20:50:41,666 8404 [DEBUG] -   'User-Agent':'chocolatey command line'
2023-07-27 20:50:42,853 8404 [DEBUG] - Url does not have HTTPS available
2023-07-27 20:50:42,869 8404 [DEBUG] - Running Get-WebFileName -url 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' -defaultName 'InternalPackageInstall.zip' 
2023-07-27 20:50:42,932 8404 [DEBUG] - Using response url to determine file name. 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z'
2023-07-27 20:50:42,947 8404 [DEBUG] - File name determined from url is 'InternalPackage.5.0.0.292.7z'
2023-07-27 20:50:42,947 8404 [DEBUG] - Running Get-WebHeaders -url 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' -ErrorAction 'Stop' 
2023-07-27 20:50:42,947 8404 [DEBUG] - Setting the UserAgent to 'chocolatey command line'
2023-07-27 20:50:42,947 8404 [DEBUG] - Request Headers:
2023-07-27 20:50:42,963 8404 [DEBUG] -   'Accept':'*/*'
2023-07-27 20:50:42,963 8404 [DEBUG] -   'User-Agent':'chocolatey command line'
2023-07-27 20:50:43,010 8404 [DEBUG] - Response Headers:
2023-07-27 20:50:43,010 8404 [DEBUG] -   'X-Content-Type-Options':'nosniff'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Content-Security-Policy':'sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'X-XSS-Protection':'1; mode=block'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Content-Disposition':'inline'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Content-Length':'5507418'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Content-Type':'application/x-7z-compressed'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Date':'Fri, 28 Jul 2023 03:50:43 GMT'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Last-Modified':'Mon, 24 Jul 2023 14:06:57 GMT'
2023-07-27 20:50:43,010 8404 [DEBUG] -   'Server':'Nexus/3.27.0-03 (OSS)'
2023-07-27 20:50:43,025 8404 [INFO ] - Downloading InternalPackage 
  from 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z'
2023-07-27 20:50:43,025 8404 [DEBUG] - Running Get-WebFile -url 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' -fileName 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z' -options 'System.Collections.Hashtable' 
2023-07-27 20:50:43,041 8404 [DEBUG] - Setting request timeout to  30000
2023-07-27 20:50:43,041 8404 [DEBUG] - Setting read/write timeout to  2700000
2023-07-27 20:50:43,041 8404 [DEBUG] - Setting the UserAgent to 'chocolatey command line'
2023-07-27 20:50:43,260 8404 [DEBUG] - Downloading http://XXXXXXXX/InternalPackage.5.0.0.292.7z to C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z
2023-07-27 20:50:43,307 8404 [INFO ] - 
2023-07-27 20:50:43,307 8404 [INFO ] - Download of InternalPackage.5.0.0.292.7z (5.25 MB) completed.
2023-07-27 20:50:46,338 8404 [DEBUG] - No runtime virus checking built into FOSS Chocolatey. Check out Pro/Business - https://chocolatey.org/compare
2023-07-27 20:50:46,338 8404 [DEBUG] - Checking that 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z' is the size we expect it to be.
2023-07-27 20:50:46,338 8404 [DEBUG] - Verifying package provided checksum of '' for 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z'.
2023-07-27 20:50:46,354 8404 [DEBUG] - Running Get-ChecksumValid -file 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z' -checksum '' -checksumType '' -originalUrl 'http://XXXXXXXX/InternalPackage.5.0.0.292.7z' 
2023-07-27 20:50:46,354 8404 [DEBUG] - Empty checksums are allowed due to allowEmptyChecksums feature or option.
2023-07-27 20:50:46,354 8404 [DEBUG] - Running Get-ChocolateyUnzip -fileFullPath 'C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z' -destination 'E:\InternalPackage\bin' -specificFolder '' -packageName 'InternalPackage' 
2023-07-27 20:50:46,354 8404 [DEBUG] - Running Get-ProcessorBits -compare '32' 
2023-07-27 20:50:46,369 8404 [INFO ] - Extracting C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z to E:\InternalPackage\bin...
2023-07-27 20:50:46,369 8404 [DEBUG] - 7zip found at 'C:\ProgramData\chocolatey\tools\7z.exe'
2023-07-27 20:50:46,385 8404 [DEBUG] - Executing command ['C:\ProgramData\chocolatey\tools\7z.exe' x -aoa -bd -bb1 -o"E:\InternalPackage\bin" -y "C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z"]
2023-07-27 20:50:46,947 8404 [INFO ] - VERBOSE: Scanning the drive for archives:
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Extracting archive: C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: 1 file, 5507418 bytes (5379 KiB)
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: 7-Zip 18.06 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-12-30
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: --
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Physical Size = 5507418
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Path = C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Headers Size = 2205
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Type = 7z
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Solid = +
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Blocks = 4
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: Method = 0A LZMA2:24 BCJ ARMT
2023-07-27 20:50:46,963 8404 [INFO ] - VERBOSE: - runtimes
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\browser\lib
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\browser\lib\net6.0
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\browser
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\unix\lib
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\unix\lib\netcoreapp3.1
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\unix
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp2.1
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\unix\lib\netcoreapp3.0
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.0
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib\net6.0
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netstandard2.0
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win-arm
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.1
2023-07-27 20:50:46,979 8404 [INFO ] - VERBOSE: - runtimes\win-arm64
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-arm64\native
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-arm\native
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-x64
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-x64\native
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-x86
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: - runtimes\win-x86\native
2023-07-27 20:50:46,994 8404 [INFO ] - VERBOSE: T runtimes\win-arm64\native\Microsoft.Data.SqlClient.SNI.dll
2023-07-27 20:50:47,026 8404 [INFO ] - VERBOSE: - runtimes\browser\lib\net6.0\System.Text.Encodings.Web.dll
2023-07-27 20:50:47,026 8404 [INFO ] - VERBOSE: - runtimes\unix\lib\netcoreapp3.1\Microsoft.Data.SqlClient.dll
2023-07-27 20:50:47,026 8404 [INFO ] - VERBOSE: - runtimes\unix\lib\netcoreapp3.0\System.Drawing.Common.dll
2023-07-27 20:50:47,026 8404 [INFO ] - VERBOSE: - runtimes\win\lib\net6.0\System.Diagnostics.EventLog.Messages.dll
2023-07-27 20:50:47,026 8404 [INFO ] - VERBOSE: - runtimes\win\lib\net6.0\System.ServiceProcess.ServiceController.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\net6.0\System.Diagnostics.EventLog.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp2.1\System.Security.Cryptography.Pkcs.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.0\System.Drawing.Common.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.0\Microsoft.Win32.SystemEvents.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.1\Microsoft.Data.SqlClient.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netstandard2.0\System.Runtime.Caching.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win-x64\native\Microsoft.Data.SqlClient.SNI.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win-x86\native\Microsoft.Data.SqlClient.SNI.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win\lib\netcoreapp3.0\System.Windows.Extensions.dll
2023-07-27 20:50:47,041 8404 [INFO ] - VERBOSE: - runtimes\win-arm\native\Microsoft.Data.SqlClient.SNI.dll
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: Sub items Errors: 1
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: 
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: Sub items Errors: 1
2023-07-27 20:50:47,057 8404 [INFO ] - VERBOSE: Archives with Errors: 1
2023-07-27 20:50:47,057 8404 [ERROR] - ERROR: Unsupported Method : runtimes\win-arm64\native\Microsoft.Data.SqlClient.SNI.dll
2023-07-27 20:50:47,072 8404 [DEBUG] - Command ['C:\ProgramData\chocolatey\tools\7z.exe' x -aoa -bd -bb1 -o"E:\InternalPackage\bin" -y "C:\Users\XX\AppData\Local\Temp\chocolatey\InternalPackage\5.0.0.292\InternalPackage.5.0.0.292.7z"] exited with '2'.
2023-07-27 20:50:47,088 8404 [DEBUG] - 7z exit code: 2
2023-07-27 20:50:47,088 8404 [ERROR] - ERROR: 7-Zip encountered a fatal error while extracting the files. This is most likely an issue with the 'InternalPackage' package and not with Chocolatey itself. Please follow up with the package maintainer(s) directly.

Additional Context

No response

@msitt msitt added the Bug label Jul 28, 2023
@pauby
Copy link
Member

pauby commented Jul 28, 2023

We don't generally update the bundled version of 7Zip unless there is a reason to such as a CVE.

In the case of 7z v23 vs v21, 7z has an improved way of compressing ARM libraries

Does this mean that v21 will still be able to compress ARM libraries and you could use that?

@msitt
Copy link
Author

msitt commented Jul 28, 2023

Yes we have done that so have worked around the issue. Understood on your policy for updating the bundled 7z.
What are your thoughts on adding a optional parameter to this function to accept an overridden 7z path? It looks like one complication is that choco requires 32-bit 7zip but that can be made clear to the user.

AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jul 31, 2023
There are no known CVE's associated with the previous release, however, since
there are improved support for some compression algoritms and without updating
the bundled 7zip version used will cause such archives to not be able to
decompress, it was decided to updated the bundled binaries
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
There are no known CVE's associated with the previous release, however, since
there are improved support for some compression algoritms and without updating
the bundled 7zip version used will cause such archives to not be able to
decompress, it was decided to updated the bundled binaries
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
There are no known CVE's associated with the previous release, however, since
there are improved support for some compression algoritms and without updating
the bundled 7zip version used will cause such archives to not be able to
decompress, it was decided to updated the bundled binaries
@AdmiringWorm AdmiringWorm changed the title choco install fails due to outdated 7z Update bundled 7zip executables to v23.01 Aug 2, 2023
@AdmiringWorm AdmiringWorm added 3 - Review Dependency Change If a dependency or bundled binaries are added, removed or updated. and removed Bug labels Aug 2, 2023
@AdmiringWorm AdmiringWorm added this to the 2.2.1 milestone Aug 2, 2023
@AdmiringWorm AdmiringWorm self-assigned this Aug 2, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
There are no known CVE's associated with the previous release, however, since
there are improved support for some compression algoritms and without updating
the bundled 7zip version used will cause such archives to not be able to
decompress, it was decided to updated the bundled binaries
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
There are no known CVE's associated with the previous release, however, since
there are improved support for some compression algoritms and without updating
the bundled 7zip version used will cause such archives to not be able to
decompress, it was decided to updated the bundled binaries
gep13 added a commit that referenced this issue Aug 2, 2023
@gep13 gep13 closed this as completed Aug 3, 2023
gep13 added a commit that referenced this issue Aug 3, 2023
* hotfix/2.2.1:
  (maint) Update GitReleaseManager configuration
  (#3291) Update Chocolatey.NuGet.Client libraries to 3.4.2
  (#3286) Adjust wording of upgrade failure message
  (#3286) Prevent MSI Upgrades
  (#3286) Do not remove any files on MSI uninstall
  (#3285) Upgrade 7z to 23.01
gep13 added a commit that referenced this issue Aug 3, 2023
* master:
  (maint) Update GitReleaseManager configuration
  (#3291) Update Chocolatey.NuGet.Client libraries to 3.4.2
  (#3286) Adjust wording of upgrade failure message
  (#3286) Prevent MSI Upgrades
  (#3286) Do not remove any files on MSI uninstall
  (#3285) Upgrade 7z to 23.01
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.2.1 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released Dependency Change If a dependency or bundled binaries are added, removed or updated.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants