winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

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

Open khewweifeng opened this issue 2 years ago • 53 comments

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

khewweifeng avatar Jun 03 '23 05:06 khewweifeng

winget source list Administrator_ Windows PowerShell 3_6_2023 6_37_01 AM

khewweifeng avatar Jun 03 '23 05:06 khewweifeng

winget --info Administrator_ Windows PowerShell 3_6_2023 6_35_43 AM

khewweifeng avatar Jun 03 '23 05:06 khewweifeng

winget update Administrator_ Windows PowerShell 3_6_2023 6_35_01 AM

khewweifeng avatar Jun 03 '23 05:06 khewweifeng

Failed when searching source; results will not be included: winget Administrator_ Windows PowerShell 3_6_2023 6_32_50 AM

khewweifeng avatar Jun 03 '23 05:06 khewweifeng

Encountering same issue.

oxpayken avatar Jun 05 '23 06:06 oxpayken

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

denelon avatar Jun 05 '23 21:06 denelon

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

khewweifeng avatar Jun 06 '23 01:06 khewweifeng

before this, the pc already done pc reset with cloud install.

khewweifeng avatar Jun 06 '23 06:06 khewweifeng

@JohnMcPMS what else do you suggest here?

denelon avatar Jun 06 '23 15:06 denelon

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 .

JohnMcPMS avatar Jun 06 '23 17:06 JohnMcPMS

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 .

WinGetCOM-2023-06-07-18-08-42.759.log

@JohnMcPMS Hi, here is the latest log.

khewweifeng avatar Jun 07 '23 10:06 khewweifeng

Run powershell with non-admin can get results and update

Screenshot (2)

khewweifeng avatar Jun 07 '23 14:06 khewweifeng

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

denelon avatar Jun 07 '23 15:06 denelon

The files that start with WinGetCOM- are likely from Microsoft Store and/or the PowerShell module usage. The log files for winget.exe usage start with WinGet-. The best thing to do would be to run your update command and then upload the newest log file.

JohnMcPMS avatar Jun 07 '23 18:06 JohnMcPMS

For me, winget throws the same errors with and without privileges, even after resetting source. Windows-Store-Installations error out as well. It seemingly all broke down with the latest wingetupdate, on my Laptop. Before it was running just fine. Initially, when trying to install Winget on a Fresh install of Windows i made yesterday with a Windowsiso i downloaded a week ago, it threw errors about being unable to source Dependencies and WindowsStore kept crashing on boot. I (seemingly) fixed that by completely reinstalling Windows Store using GetAppx. I can upload all the Logs i have (if you tell me where to find them.).

Afterwards i would probably reinstall this PC using the same iso, to check if that fixes it, provide logs, and if that fails, i can try fetching the iso again and reinstall - that being said i am not sure if these steps are all that helpful.

Surprisingly, i reinstalled my main Desktop-PC on Monday using the same Iso on the same stick and its running fine there, even when i seemingly have the same versions of pretty much everything, even the newest winget update.

EDIT - Clarification: Windows Store initially installed updates to a bunch of other random stuff on my Laptop (3D Viewer and such). Those Updates ran fine, then it started downloading an update for App-Installer. Winget was open in a Powershell and chugging along until then and both winget and store seized function THE SECOND it installed App-Installer Version 1.19.11071.0. All Store-Apps trying to get updates after that just failed to update after their Download completed.

Shadowphoenix avatar Jun 09 '23 14:06 Shadowphoenix

For me, winget throws the same errors with and without privileges, even after resetting source. Windows-Store-Installations error out as well. It seemingly all broke down with the latest wingetupdate, on my Laptop. Before it was running just fine. Initially, when trying to install Winget on a Fresh install of Windows i made yesterday with a Windowsiso i downloaded a week ago, it threw errors about being unable to source Dependencies and WindowsStore kept crashing on boot. I (seemingly) fixed that by completely reinstalling Windows Store using GetAppx. I can upload all the Logs i have (if you tell me where to find them.).

Afterwards i would probably reinstall this PC using the same iso, to check if that fixes it, provide logs, and if that fails, i can try fetching the iso again and reinstall - that being said i am not sure if these steps are all that helpful.

Surprisingly, i reinstalled my main Desktop-PC on Monday using the same Iso on the same stick and its running fine there, even when i seemingly have the same versions of pretty much everything, even the newest winget update.

winget --info will show the logs location

khewweifeng avatar Jun 09 '23 15:06 khewweifeng

You can also append "--verbose-logs --logs" to the end of a command and logging will be "verbose", and the folder with the logs will open after the command completes.

denelon avatar Jun 09 '23 15:06 denelon

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 avatar Jun 09 '23 22:06 Shadowphoenix

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

khewweifeng avatar Jun 11 '23 03:06 khewweifeng

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.

Shadowphoenix avatar Jun 11 '23 15:06 Shadowphoenix

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.

rrous avatar Jun 19 '23 12:06 rrous

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

lambda avatar Jun 23 '23 21:06 lambda

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.

M4mu5qu3 avatar Jun 30 '23 10:06 M4mu5qu3

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.

The mentioned source package doesn't exist.

computerquip-work avatar Aug 10 '23 16:08 computerquip-work

Bases in my experience with this DAILY (I use winget every day), take in consideration 2 things: 1-SysOp update/upgrade in full, some of those missing module is the reason why winget doesn't work (.net? whatever), most of the time I full upgrade windows and fix the issue. Of course don't forget to install latest winget version. 2-Winget still on Frankenstein/beta level, means, no matter what you do, it will still fail and it will act weird. Just now, it gave me the same error, I run it again (I run it always from a .bat) and the problem didn't show up the second time. Go figure.

KuntaKinke avatar Oct 26 '23 12:10 KuntaKinke

I was facing the same error message "Failed when searching source; results will not be included: winget".

Adding my information, in my case I was trying to install git by the command winget install --id Git.Git -e --source winget under a elevated PowerShell terminal, the current/signed-in user being a standard user.

The way it worked for me was signing in as the administrator user.

I mention git because, although this instance is a new installation I do remember that I in another machine I have never been able to upgrade git using 'winget' under the similar circumstance, standard user trying to update 'machine' scope installation hence the issue might be reproducible trying with git installer.

Also I just found out about the scope issues in case that is related.

Best.

octaviordz avatar Nov 29 '23 04:11 octaviordz

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

MickCh avatar Feb 05 '24 16:02 MickCh

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

Confirmed this fixed it for me as well. Coming from a brand new Windows 11 install.

jakemarston avatar Feb 10 '24 22:02 jakemarston

I found this thread while experiencing the same issue. Turns out, if you are logged in as a non-admin and elevate your CLI-of-choice (CMD, Powershell, Terminal, etc.), winget will error as observed by myself and others in this thread. If you run your CLI as a non-admin, winget works as expected. It's strange that this behavior is not already compensated for by Windows, as being logged in as a standard user and elevating privileges only to do the sysadmin tasks required is a standard best practice.

ogzilcho avatar May 20 '24 10:05 ogzilcho