microsoft / microsoft/winget-cli

PortableUninstall uninstaller failed: 2316632067

Open
#4,542 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Uninstall Issue-Bug Portable
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

I PR-ed Azure CLI ZIP: https://github.com/microsoft/winget-pkgs/pull/156657

Doing so I tested the manifest locally:

# Try validating
winget validate --manifest "<path_to_directory_with_yaml_files>"

# [admin] Enable required settings
winget settings --enable LocalArchiveMalwareScanOverride
winget settings --enable LocalManifestFiles

# Try installing
winget install --manifest "<path_to_directory_with_yaml_files>" --installer-type portable

# [admin] Disable settings that was enabled
winget settings --disable LocalArchiveMalwareScanOverride
winget settings --disable LocalManifestFiles

After I got it working I sent the PR. Then I wanted to uninstall this package. I first tried:

C:\Users\olavb>winget list --id Microsoft.AzureCLI
Name                Id                 Version Source
------------------------------------------------------
Microsoft Azure CLI Microsoft.AzureCLI 2.61.0  winget

C:\Users\olavb>winget uninstall --id Microsoft.AzureCLI
No installed package found matching input criteria.

C:\Users\olavb>

It can list the package, but not uninstall it. I then tried using --manifest switch with winget uninstall.

C:\Users\olavb>winget uninstall --manifest "C:\Users\olavb\OneDrive\IT\Code\PowerShell\CLI\Winget\Winget manifests WIP\Azure CLI v2.61.0"
Found Microsoft Azure CLI [Microsoft.AzureCLI]
Starting package uninstall...
An unexpected error occurred while executing the command:
remove_all: unknown error: "C:\Users\olavb\AppData\Local\Microsoft\WinGet\Packages\Microsoft.AzureCLI__DefaultSource\Lib"
Uninstall failed with exit code: 0x8a150003 : Executing command failed

C:\Users\olavb>

Here are the last things that happened in the logs from winget uninstall --manifest "C:\Users\olavb\OneDrive\IT\Code\PowerShell\CLI\Winget\Winget manifests WIP\Azure CLI v2.61.0" --verbose --logs (full log was too much for a GitHub comment, and did not provide any useful info anyways as far as I could see):

2024-06-05 21:38:46.734 [CLI ] Found one app. App id: Microsoft.AzureCLI App name: Microsoft Azure CLI
2024-06-05 21:38:46.736 [REPO] Opening database for ReadWrite at 'C:\Users\olavb\AppData\Local\Microsoft\WinGet\Packages\Microsoft.AzureCLI__DefaultSource\microsoft.azurecli__defaultsource.db'
2024-06-05 21:38:46.736 [REPO] Opened Portable Index with version [1.0], last write [2024-06-05 21:38:13.000]
2024-06-05 21:38:46.982 [REPO] Opening database for ReadWrite at 'C:\Users\olavb\AppData\Local\Microsoft\WinGet\Packages\Microsoft.AzureCLI__DefaultSource\microsoft.azurecli__defaultsource.db'
2024-06-05 21:38:46.982 [REPO] Opened Portable Index with version [1.0], last write [2024-06-05 21:38:13.000]
2024-06-05 21:38:46.982 [CLI ] Removing directory at C:\Users\olavb\AppData\Local\Microsoft\WinGet\Packages\Microsoft.AzureCLI__DefaultSource\Lib
2024-06-05 21:38:46.985 [CLI ] Caught std::exception: remove_all: unknown error: "C:\Users\olavb\AppData\Local\Microsoft\WinGet\Packages\Microsoft.AzureCLI__DefaultSource\Lib"
2024-06-05 21:38:46.986 [CLI ] PortableUninstall uninstaller failed: 2316632067
2024-06-05 21:38:46.987 [CLI ] Terminating context: 0x8a150057 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\UninstallFlow.cpp:16a
Steps to reproduce

See above. Manifest available in PR https://github.com/microsoft/winget-pkgs/pull/156657.

Expected behavior

If Winget can add it, it should be able to remove it.

Actual behavior

Winget could add it, but not remove it.

Environment
C:\Users\olavb>winget --info
Windows Package Manager v1.7.11261
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.3593
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.11261.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Enabled

C:\Users\olavb>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the manifest from PR #156657 and the documented winget commands, then inspect the portable uninstall path indicated by the log, including UninstallFlow.cpp. Use the verbose log to trace why removing the Lib directory fails. Done means the package installed from the manifest can be found and uninstalled successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.