microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.54k stars 1.39k forks source link

Interacting at all with the `winget` source hangs #4576

Closed clin1234 closed 3 days ago

clin1234 commented 1 week ago

Brief description of your issue

Attempting to list installed packages updates hangs, or update sources hangs

Steps to reproduce

  1. winget list --verbose or winget update --verbose

Expected behavior

List installed packages or updates.

Actual behavior

The indicator simply swirls around indefinitely.

Log attatched. WinGet-2024-06-21-15-51-26.570.log

Environment

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

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

Winget Directories
---------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.Deskt…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.Deskt…
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                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Enabled
LocalArchiveMalwareScanOverride           Disabled
github-actions[bot] commented 1 week ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mdanish-kh commented 1 week ago

Could you try running winget source reset --force from an administrative terminal and then check again?

[comment]: <[Policy] Issue-Bug>

clin1234 commented 1 week ago

Nope. Running winget update --verbose still hangs. Had to Ctrl-C. Output:

C:\Users\ךינשגכהד>winget update --verbose-logs
Failed in attempting to update the source: winget
Failed when opening source(s); try the 'source reset' command if the problem persists.
An unexpected error occurred while executing the command:
0x8007139f : The group or resource is not in the correct state to perform the requested operation.

Here's the attatched log: WinGet-2024-06-22-15-23-44.971.log

mdanish-kh commented 1 week ago

How about updating the source manually through the command:

Add-AppxPackage -Path "https://cdn.winget.microsoft.com/cache/source.msix"

(If for some reason that command doesn't work, you can download the source package manually from the URL and double-click on the .msix file to run)

clin1234 commented 1 week ago

Did't work. Tried the pwsh command and manual download.

Here are the logs: WinGet-2024-06-23-09-03-08.165.log WinGet-2024-06-23-09-01-17.434.log AppInstaller-2024-06-23-09-00-52.010.log AppInstaller-2024-06-23-09-00-52.882.log AppInstaller-2024-06-23-09-00-45.856.log AppInstaller-2024-06-20-21-30-37.317.log WinGet-2024-06-23-08-50-56.829.log WinGet-2024-06-23-08-49-48.980.log

yao-msft commented 1 week ago

All the above logs end abruptly at

"2024-06-23 08:50:57.381 [REPO] Adding to aggregated source: winget"

One of them having

"2024-06-22 15:26:30.547 [FAIL] C:__w\1\s\external\pkg\src\AppInstallerRepositoryCore\RepositorySource.cpp(520)\WindowsPackageManager.dll!00007FFA71743B79: (caller: 00007FFA7174546A) Exception(1) tid(3d14) 8007139F The group or resource is not in the correct state to perform the requested operation. "

Which indicates the sources are in a bad state.

Could you run "winget source reset --force" again and share the logs? Worst case, we may need to investigate some additional data files at: C:\Users\\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Settings

clin1234 commented 1 week ago

Resetting the source this time allowed listing updates and searching. Here are the logs

WinGet-2024-06-24-07-43-18.540.log WinGet-2024-06-24-07-42-54.702.log WinGet-2024-06-24-07-42-47.744.log

yao-msft commented 6 days ago

Resetting the source this time allowed listing updates and searching. Here are the logs

WinGet-2024-06-24-07-43-18.540.log WinGet-2024-06-24-07-42-54.702.log WinGet-2024-06-24-07-42-47.744.log

Thanks. Glad it's working again. The logs do show reset is successful (user_sources and sources_metadata are removed). I can only guess the previous reset attempt did not complete.