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
23.29k stars 1.45k forks source link

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

Open khewweifeng opened 1 year ago

khewweifeng commented 1 year ago

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 commented 1 year ago

winget source list Administrator_ Windows PowerShell 3_6_2023 6_37_01 AM

khewweifeng commented 1 year ago

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

khewweifeng commented 1 year ago

winget update Administrator_ Windows PowerShell 3_6_2023 6_35_01 AM

khewweifeng commented 1 year ago

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

oxpayken commented 1 year ago

Encountering same issue.

denelon commented 1 year ago

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

khewweifeng commented 1 year ago

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 commented 1 year ago

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

denelon commented 1 year ago

@JohnMcPMS what else do you suggest here?

JohnMcPMS commented 1 year ago

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 .

khewweifeng commented 1 year ago

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 commented 1 year ago

Older logs WinGetCOM-2023-06-05-06-02-29.150.log WinGetCOM-2023-06-05-06-06-16.523.log WinGetCOM-2023-06-06-18-00-49.400.log WinGetCOM-2023-06-03-06-20-43.524.log

khewweifeng commented 1 year ago

Run powershell with non-admin can get results and update

Screenshot (2)

denelon commented 1 year ago

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

JohnMcPMS commented 1 year ago

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.

Shadowphoenix commented 1 year ago

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.

khewweifeng commented 1 year ago

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

denelon commented 1 year ago

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.

Shadowphoenix commented 1 year ago

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.

khewweifeng commented 1 year ago

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

Shadowphoenix commented 1 year ago

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.

rrous commented 1 year ago

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.

lambda commented 1 year ago

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
M4mu5qu3 commented 1 year ago

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.

computerquip-work commented 1 year ago

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.

KuntaKinke commented 1 year ago

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.

octaviordz commented 11 months ago

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.

MickCh commented 9 months ago

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

jakemarston commented 9 months ago

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.

ogzilcho commented 5 months ago

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.

SixOThree commented 5 months ago

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

Yup. Brand new PC just today and winget is broken out of the box.

christianbueno1 commented 5 months ago

In a fresh windows 11, was receiving this errors from winget.

The winget version was

Was trying with some commands in the PowerShell, commands like these. winget --info winget -v winget source list winget source update winget upgrade. In the next day after an Windows-Update (system) suddenly one alert told me about App-Installer App update. After restart the Terminal App, winget was updated to

And the errors were fixed. Hope this information helps you.

A screen recorded of where you can find de "App Installer" App.

https://github.com/microsoft/winget-cli/assets/10623247/3c31caaf-3203-41f3-973f-1192bdb89b52

mahvili commented 3 months ago

solved my issue: https://learn.microsoft.com/en-us/answers/questions/1688882/how-do-we-fix-0x8a15000f-data-required-by-the-sour

Spongman commented 2 months ago

I have the same issue.

image

the version of winget shipping in win11 is unable to upgrade itself.

@ALERTua: what's confusing about this?

annx0816 commented 2 months ago

I have the same issue.

  • Brand new install of Windows 11 Home.
  • Windows Updates are up-to-date.

image

the version of winget shipping in win11 is unable to upgrade itself.

@ALERTua: what's confusing about this?

try Restart the Delivery Optimization service:

Open Run (Windows + R), type services.msc, and press Enter. Find the Delivery Optimization service, right-click on it, and select Restart.

and next: Reset and re-add the winget source:

Open PowerShell with administrative privileges (Admin). Run the following commands to remove and re-add the winget source:

winget source remove winget
winget source add -n winget https://winget.azureedge.net/cache
winget source update
ALERTua commented 2 months ago

I have the same issue.

  • Brand new install of Windows 11 Home.
  • Windows Updates are up-to-date.

image the version of winget shipping in win11 is unable to upgrade itself. @ALERTua: what's confusing about this?

try Restart the Delivery Optimization service:

Open Run (Windows + R), type services.msc, and press Enter. Find the Delivery Optimization service, right-click on it, and select Restart.

and next: Reset and re-add the winget source:

Open PowerShell with administrative privileges (Admin). Run the following commands to remove and re-add the winget source:

winget source remove winget
winget source add -n winget https://winget.azureedge.net/cache
winget source update

The result is the same: image

anarquiles commented 2 months ago

hi there i have the same issue in W11 updated to last , but find this video on youtube: and reinstall appx manager and edit the path on Enviroment variables and it works again. https://www.youtube.com/watch?v=ES4LfzbSxMA

thx1200 commented 1 month ago

Man Winget is so fragile. I get this seemingly randomly when I elevate to an admin account and it reappears after some time (not sure how long). I used to always just reinstall winget in the admin session and that would fix it. But computerquip-work's solution is much faster. Still, I have to reapply the fix randomly from time to time. I don't understand why winget is so fragile! Does MS seriously not have a single tester who isn't running their main PC as an admin at all times?? Having a separate admin account has been best practice for ages.

beeradmoore commented 4 weeks ago

Reinstalling AppInstaller fixed this for me, via.

I ran this in a powershell window as admin

Get-AppxPackage appInstaller | Reset-AppxPackage

Stephenzero commented 3 weeks ago

I have the same question too Image

khewweifeng commented 2 weeks ago

I have the same question too Image

https://github.com/microsoft/winget-cli/issues/4785