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

[Package Issue]: Bitwarden.CLI #171477

Open
2 tasks done
johnburnett opened this issue Sep 3, 2024 · 6 comments
Open
2 tasks done

[Package Issue]: Bitwarden.CLI #171477

johnburnett opened this issue Sep 3, 2024 · 6 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@johnburnett
Copy link
Contributor

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Installation issue.

Brief description of your issue

The Bitwarden CLI installer is causing a "Failed to extract the contents of the archive" error across a wide range of package versions, so I'm not sure if the package hasn't worked for a while, or if winget went off the rails (v1.8.1911), or if there's something wrong with my system. The steps below are using a pinned version of 2024.8.1 just for reproducibility, but it happens on other versions I've checked as well.

Steps to reproduce

$ winget install -q Bitwarden.CLI -v 2024.8.1
Found Bitwarden CLI [Bitwarden.CLI] Version 2024.8.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/bitwarden/clients/releases/download/cli-v2024.8.1/bw-windows-2024.8.1.zip
  ██████████████████████████████  28.3 MB / 28.3 MB
Successfully verified installer hash
Extracting archive...
Failed to extract the contents of the archive

Actual behavior

"Failed to extract the contents of the archive", and the log says:

2024-09-03 12:27:08.250 [CORE] DeliveryOptimization downloading from url: https://github.com/bitwarden/clients/releases/download/cli-v2024.8.1/bw-windows-2024.8.1.zip
2024-09-03 12:27:12.688 [CORE] Download completed.
2024-09-03 12:27:12.902 [CORE] Started applying motw to $user\AppData\Local\Temp\WinGet\Bitwarden.CLI.2024.8.1\7dc84e91255cc0213f41c54a3bf183e67c80417310b59212d86e44d24056e62d with zone: 3
2024-09-03 12:27:12.903 [CORE] Finished applying motw
2024-09-03 12:27:12.904 [CLI ] Installer hash verified
2024-09-03 12:27:12.904 [CORE] Started applying motw to $user\AppData\Local\Temp\WinGet\Bitwarden.CLI.2024.8.1\7dc84e91255cc0213f41c54a3bf183e67c80417310b59212d86e44d24056e62d with zone: 2
2024-09-03 12:27:12.906 [CORE] Finished applying motw
2024-09-03 12:27:12.906 [CLI ] Successfully renamed downloaded installer. Path: $user\AppData\Local\Temp\WinGet\Bitwarden.CLI.2024.8.1\bw-windows-2024.8.1.zip
2024-09-03 12:27:13.021 [CLI ] Extracting archive to: $user\AppData\Local\Temp\WinGet\Bitwarden.CLI.2024.8.1\extracted
2024-09-03 12:27:13.049 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Archive.cpp(30)\WindowsPackageManager.dll!00007FFDE61A4397: (caller: 00007FFDE60FA17C) ReturnHr(1) tid(615c) 80004005 Unspecified error


2024-09-03 12:27:13.049 [CLI ] Failed to extract archive with code -2147467259
2024-09-03 12:27:13.050 [CLI ] Terminating context: 0x8a15005c at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\ArchiveFlow.cpp:4a

I can open the archive bw-windows-2024.8.1.zip in the above temp dir and extract it manually by hand just fine using 7-zip, so I'm not sure what the issue is.

Expected behavior

A successfully installed package

Environment

Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4112
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Screenshots and Logs

No response

@johnburnett johnburnett added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Sep 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage This work item needs to be triaged by a member of the core team. label Sep 3, 2024
@Utesgui
Copy link
Contributor

Utesgui commented Sep 4, 2024

Hi @johnburnett
Works on my machine (which does not have to mean anything)
image
image

Is anybody else facing this issue?

Edit:
double-check on another system with other winget version:
image

@Dragon1573
Copy link
Contributor

Verified in Windows 11 amd64 Sandbox instance.

image

@a-mnich
Copy link
Contributor

a-mnich commented Sep 4, 2024

Successfully verified on a Windows 11 Sandbox Instance:
image

@stephengillie stephengillie added Needs-Author-Feedback This needs a response from the author. and removed Needs-Triage This work item needs to be triaged by a member of the core team. labels Sep 4, 2024
@stephengillie
Copy link
Collaborator

Hi @johnburnett,

Does this happen with other packages? Would it be possible to try uninstalling the package manager and reinstalling - possibly through the MS Store?

@johnburnett
Copy link
Contributor Author

johnburnett commented Sep 4, 2024

I dug into this a bit more this morning, and in the end it's user error, but explaining for search results. In src\AppInstallerCommonCore\Archive.cpp, line 30:

wil::com_ptr<IShellFolder> pArchiveShellFolder;
HRESULT res = SHBindToObject(NULL, pidlFull.get(), NULL, IID_PPV_ARGS(&pArchiveShellFolder));

SHBindToObject was returning E_FAIL. I forget how to dig into COM failures to get more details about the error. However, not being able to create a shell object for a zip archive triggered a memory: I've previously followed the instructions at https://www.sevenforums.com/tutorials/13619-zip-folders-enable-disable-windows-explorer-view.html to disable Explorer's insistence of treating zip files as folders (personal annoyance of mine). The wisdom of following the advice in the link above is certainly debatable. My memory is that the linked .reg files basically do something like:

Remove-Item -Force -Recurse -Path 'Registry::HKEY_CLASSES_ROOT\CompressedFolder\CLSID'
Remove-Item -Force -Recurse -Path 'Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\.zip\CLSID'
Remove-Item -Force -Recurse -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ArchiveFolder'

That all said, I'm willing to bet if I somehow re-registered the above classes, it would fix the issue. I'm not sure how to do that though, and am not super motivated to do so, so I might be out of luck for using winget now. Relying on the shell's archive handler feels a bit wonky (?), but I'm sure there's reasons to do so.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention This work item needs to be reviewed by a member of the core team. and removed Needs-Author-Feedback This needs a response from the author. labels Sep 4, 2024
@stephengillie stephengillie removed the Needs-Attention This work item needs to be reviewed by a member of the core team. label Sep 5, 2024
@demoergo
Copy link

This fixed the issue for me. If it helps anyone here are the .reg files I used for enabling/disabling zip folders.


Disable_ZIP_Compressed_Folders.reg:

Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: http://www.sevenforums.com/tutorials/13619-zip-folders-enable-disable-windows-explorer-view.html
[-HKEY_CLASSES_ROOT\CompressedFolder\CLSID]
[-HKEY_CLASSES_ROOT\SystemFileAssociations.zip\CLSID]


Enable_ZIP_Compressed_Folders.reg:

Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: http://www.sevenforums.com/tutorials/13619-zip-folders-enable-disable-windows-explorer-view.html
[HKEY_CLASSES_ROOT\CompressedFolder\CLSID]
@="{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}"
[HKEY_CLASSES_ROOT\SystemFileAssociations.zip\CLSID]
@="{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

6 participants