winget-cli: Failed when searching source; results will not be included: winget

Brief description of your issue

Failed when searching source; results will not be included: winget

Steps to reproduce

winget update

Expected behavior

update / install / find apps with winget

Actual behavior

Failed when searching source; results will not be included: winget

Environment

winget --info
Windows Package Manager v1.4.11071
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2846
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.11071.0

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 29 (6 by maintainers)

Most upvoted comments

I ran into this problem when I was in an elevated PowerShell prompt for an admin user who may not have ever logged in directly. This meant that winget wasn’t installed, so following the instructions at https://learn.microsoft.com/en-us/windows/package-manager/winget/ I ran the following to install winget:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

However, that led to the error discussed in this ticket when trying to use winget.

Looking in the logs I got an error about Microsoft.Winget.Source_8wekyb3d8bbwe so I tried installing that as well with Add-AppxPackage and that seemed to work:

PS C:\> Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.Winget.Source_8wekyb3d8bbwe
PS C:\> winget search Microsoft.PowerShell
Name               Id                           Version Source
---------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.3.4.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.4.0.3 winget
PS C:\>

Log snippet of the failure:

2023-06-23 17:00:12.358 [REPO] Adding to aggregated source: winget
2023-06-23 17:00:12.359 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-06-23 17:00:12.359 [REPO] Package not found Microsoft.Winget.Source_8wekyb3d8bbwe
2023-06-23 17:00:12.360 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(205)\WindowsPackageManager.dll!00007FFBE1244D7A: (caller: 00007FFBE123145E) Exception(1) tid(47fc) 8A15000F
2023-06-23 17:00:12.360 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\RepositorySource.cpp(564)\WindowsPackageManager.dll!00007FFBE1367133: (caller: 00007FFBE1128DDD) LogHr(2) tid(47fc) 8A15000F     Msg:[D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(205)\WindowsPackageManager.dll!00007FFBE1244D7A: (caller: 00007FFBE123145E) Exception(1) tid(47fc) 8A15000F ]

2023-06-23 17:00:12.360 [REPO] Failed to open available source: winget

Run powershell with non-admin can get results and update

Screenshot (2)

@khewweifeng thanks so much for testing and helping us to find a solid repro!

Does running winget source reset --force as an administrator resolve this?

I had the same issue and my solution was simply to upgrade “App Installer” in Microsoft Store.

I ran into this problem when I was in an elevated PowerShell prompt for an admin user who may not have ever logged in directly. This meant that winget wasn’t installed, so following the instructions at https://learn.microsoft.com/en-us/windows/package-manager/winget/ I ran the following to install winget:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

However, that led to the error discussed in this ticket when trying to use winget.

Looking in the logs I got an error about Microsoft.Winget.Source_8wekyb3d8bbwe so I tried installing that as well with Add-AppxPackage and that seemed to work:

PS C:\> Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.Winget.Source_8wekyb3d8bbwe
PS C:\> winget search Microsoft.PowerShell
Name               Id                           Version Source
---------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.3.4.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.4.0.3 winget
PS C:\>

Log snippet of the failure:

2023-06-23 17:00:12.358 [REPO] Adding to aggregated source: winget
2023-06-23 17:00:12.359 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-06-23 17:00:12.359 [REPO] Package not found Microsoft.Winget.Source_8wekyb3d8bbwe
2023-06-23 17:00:12.360 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(205)\WindowsPackageManager.dll!00007FFBE1244D7A: (caller: 00007FFBE123145E) Exception(1) tid(47fc) 8A15000F
2023-06-23 17:00:12.360 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\RepositorySource.cpp(564)\WindowsPackageManager.dll!00007FFBE1367133: (caller: 00007FFBE1128DDD) LogHr(2) tid(47fc) 8A15000F     Msg:[D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(205)\WindowsPackageManager.dll!00007FFBE1244D7A: (caller: 00007FFBE123145E) Exception(1) tid(47fc) 8A15000F ]

2023-06-23 17:00:12.360 [REPO] Failed to open available source: winget

It Works absolutely!!! I’ve done this in non admin and admin session too, and it works!

I was in the same situation of @khewweifeng

Many thanks guys.

Run powershell with non-admin can get results and update

Screenshot (2)

I experience the same behaviour. BTW: Our company AD policy forbids MS Store for users PCs. My local admin account is not in AD domain. But chocolatey works fine as admin. In our domain we have a proxy, but I experience the same issues also without proxy on NAT network.

seems something fundamental was broken with that install - now after windows ran a few updates it doesnt even start… guess i will reinstall and see if can reproduce EDIT: Reinstalling the PC fixed it. Could be that Winget-cli and Store broke because both were doing stuff at the same time. -> broken Package-Library or so? Because now i first let Windows Store fully update all the stuff and THEN ran my wingetcommands and it works fine.

@Shadowphoenix May I know how you reinstall? by using pc reset or usb drive method? because mine was reinstalled with pc reset (cloud install) method

i always do it via Iso on USB - i chose completely deleting the old partition and reinstalling into a fresh new partition, because using the Overwrite-Method via Cloud or even from within the USB somehow ALWAYS ends up carrying over the bugs that led me to reinstalling in the first place, when i try that.

Without logs, it is hard to say what is happening. You can attach logs here, (winget --info will show you where they are) or you can submit a feedback item with http://aka.ms/winget-feedback .

Does running winget source reset --force as an administrator resolve this?

Cannot resolve

Here is the screenshot.

Administrator_ Windows PowerShell 6_6_2023 9_03_52 AM