microsoft / microsoft/winget-cli

exit error code when winget gets unloaded

Open
#3,486 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief description of your issue

winget upgrade --all works as expected yet after the process winget throws
NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335188.

this also happens with other commands such as winget --help, -so not related to a specific command-, rather when winget gets unloaded
edit: it will happen after upgrade when the error has happened once. for fresh call it won't happen

Steps to reproduce

run Microsoft Terminal, PowerShell 7.4.0-preview.4
winget upgrade --all

Expected behavior

image

no error code after upgrade process has finished

Actual behavior

image

Environment
Windows: Windows.Desktop v10.0.22631.2115
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.21.1573.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
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

Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung              https://aka.ms/winget-privacy
Lizenzvereinbarung                https://aka.ms/winget-license
Hinweise von Drittanbietern       https://aka.ms/winget-3rdPartyNotice
Startseite                        https://aka.ms/winget
Windows Store-Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administratoreinstellung                  Status
-----------------------------------------------------
LocalManifestFiles                        Deaktiviert
BypassCertificatePinningForMicrosoftStore Deaktiviert
InstallerHashOverride                     Deaktiviert
LocalArchiveMalwareScanOverride           Deaktiviert

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

Start by reproducing the behavior in Microsoft Terminal with PowerShell 7.4.0-preview.4 using winget upgrade --all, then compare subsequent winget --help and other command exit codes. Trace the winget process-unload and exit-code handling to determine why the non-zero code appears after the first failure; done means these commands finish without the reported NativeCommandExitException.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.