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.08k stars 1.44k forks source link

Failed to open the predefined source/Failed when searching source: msstore #3259

Open johnnyde94 opened 1 year ago

johnnyde94 commented 1 year ago

Hello I am currently getting the error: "Failed to open the predefined source; please report to winget maintainers. An unexpected error occurred while executing the command: 0x800700b7 : Cannot create a file when that file already exists."

When trying to use winget. I have tried to install the latest dev build but that has not solved the issue. I tried a few different steps found in other posts such as updating sources but no go. This error is on my work computer running normal build of win 11.

Oddly I'm also having issues with winget on my home PC with win 11 beta ring but that error says the following: "Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a150044 : The rest source endpoint is not found."

I can make two separate posts if that is better.

denelon commented 1 year ago

@johnnyde94 would you mind running winget source reset --force --verbose-logs --open-logs in administrator mode and sharing the logs?

johnnyde94 commented 1 year ago

Sure thing this is from the computer with the first issue.

WinGetPC1-2023-05-12-14-52-13.785.log

That last line is really odd as I do not have a D drive installed at the moment and windows was never on the D drive anyway.

Output from the second PC is below.... odd it didn't even want to run

C:\Windows\System32>winget source reset --force --verbose-logs --open-logs Windows Package Manager v1.4.11071 Copyright (c) Microsoft Corporation. All rights reserved.

This feature is a work in progress, and may be changed dramatically or removed altogether in the future. To enable it, edit your settings ('winget settings') to include the experimental feature: 'openLogsArgument'

This command drops existing sources, potentially leaving any local data behind. Without any argument, it will drop all sources and add the defaults. If a named source is provided, only that source will be dropped.

usage: winget source reset [[-n] ] []

The following arguments are available: -n,--name Name of the source

The following options are available: --force Forces the reset of the sources -?,--help Shows help about the selected command --wait Prompts the user to press any key before exiting --verbose,--verbose-logs Enables verbose logging for WinGet --disable-interactivity Disable interactive prompts

More help can be found at: https://aka.ms/winget-command-source

That lead me down a rabbit hole so I edited my json to include that experimental feature but it still will not make a log output. I check the folder location nothing of use there.

denelon commented 1 year ago

Possibly related to:

johnnyde94 commented 1 year ago

On computer 1 we got a bit further using the info from that article but sill no go. That D drive error is gone. Failed to open the predefined source; please report to winget maintainers. An unexpected error occurred while executing the command: 0x800700b7 : Cannot create a file when that file already exists. WinGet-2023-05-18-12-42-37.810.log

Second PC I have a feeling I need to reinstall winget. Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a150044 : The rest source endpoint is not found.

denelon commented 1 year ago

You can use: https://aka.ms/getwinget - Latest stable version at GitHub https://aka.ms/getwingetpreview - Latest preview version at GitHub

johnnyde94 commented 1 year ago

installed dev preview no luck on pc 2 but I do get logs now. 2023-05-18 12:49:39.375 [CORE] WinGet, version [1.5.1081-preview], activity [{3B4CE009-927F-47A9-9582-C2F34B63304D}] 2023-05-18 12:49:39.375 [CORE] OS: Windows.Desktop v10.0.22624.1616 2023-05-18 12:49:39.375 [CORE] Command line Args: winget source reset --force --verbose-logs --open-logs 2023-05-18 12:49:39.376 [CORE] Package: Microsoft.DesktopAppInstaller v1.20.1081.0 2023-05-18 12:49:39.376 [CORE] IsCOMCall:0; Caller: winget-cli 2023-05-18 12:49:39.380 [CLI ] WinGet invoked with arguments: 'source' 'reset' '--force' '--verbose-logs' '--open-logs' 2023-05-18 12:49:39.380 [CLI ] Found subcommand: source 2023-05-18 12:49:39.380 [CLI ] Found subcommand: reset 2023-05-18 12:49:39.380 [CLI ] Leaf command to execute: root:source:reset 2023-05-18 12:49:39.380 [CLI ] Executing command: reset 2023-05-18 12:49:39.394 [CORE] Setting action: Remove, Type: Secure, Name: user_sources 2023-05-18 12:49:39.394 [CORE] Setting action: Remove, Type: Standard, Name: sources_metadata 2023-05-18 12:49:39.442 [CLI ] Leaf command succeeded: root:source:reset

johnnyde94 commented 1 year ago

can i remove winget from add and remove apps safely?

johnnyde94 commented 1 year ago

I tired the repair and reset from their no luck

denelon commented 1 year ago

It's the App Installer. I don't believe it will let you remove it via Windows Apps & Features. I was going to suggest repair or reset, but you already did that.

What do you get from winget --info?

johnnyde94 commented 1 year ago

It was able to let me uninstall it from there, but i still have winget

johnnyde94 commented 1 year ago

Odd the store is still saying the app installer is installed too but its no longer in installed apps

johnnyde94 commented 1 year ago

pc 1

Windows: Windows.Desktop v10.0.22621.1702 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.20.1081.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

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 Disabled LocalArchiveMalwareScanOverride Disabled

johnnyde94 commented 1 year ago

pc 2

Windows: Windows.Desktop v10.0.22624.1616 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.20.1081.0

Winget Directories

Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json 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

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 Disabled LocalArchiveMalwareScanOverride Disabled

johnnyde94 commented 1 year ago

winget also does nothing on pc 2 if i use powershell oddly like its looking for the app to open

denelon commented 1 year ago

Do you have the App Execution Alias enabled on both machines?

johnnyde94 commented 1 year ago

No clue lol

denelon commented 1 year ago

You can search for it in "settings"

AEA1 AEA2
JohnMcPMS commented 1 year ago

On the first machine, I think that somehow we are seeing the same MSIX package on the system twice, with the same version. We can mitigate it in the code, but it would be interesting to see what the root cause is (and it would probably fix you now).

This in PowerShell should hopefully show the culprit (a duplicate value). If you paste the output here I will find the dupe if you don't want to:

Get-AppxPackage -PackageTypeFilter Main | %{ $_.PackageFamilyName }
johnnyde94 commented 1 year ago

yep I do if I turn it off it can't find winget

johnnyde94 commented 1 year ago

Microsoft.YourPhone_8wekyb3d8bbwe Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe Microsoft.ZuneVideo_8wekyb3d8bbwe Microsoft.WindowsStore_8wekyb3d8bbwe Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe Microsoft.GetHelp_8wekyb3d8bbwe DropboxInc.Dropbox_wkt425jdc3sga Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe Microsoft.WindowsNotepad_8wekyb3d8bbwe Microsoft.ScreenSketch_8wekyb3d8bbwe AD2F1837.HPDesktopSupportUtilities_v10z8vjag6ke6 Microsoft.HEIFImageExtension_8wekyb3d8bbwe Microsoft.HEVCVideoExtension_8wekyb3d8bbwe Microsoft.Paint_8wekyb3d8bbwe Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe Microsoft.WindowsCamera_8wekyb3d8bbwe MicrosoftWindows.Client.CBS_cw5n1h2txyewy MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy AD2F1837.HPPrinterControl_v10z8vjag6ke6 Clipchamp.Clipchamp_yxz26nhyzhsrt Microsoft.WindowsMaps_8wekyb3d8bbwe Microsoft.SecHealthUI_8wekyb3d8bbwe AdvancedMicroDevicesInc-RSXCM_fhmx3h6dzfmvj Microsoft.MicrosoftEdge_8wekyb3d8bbwe Microsoft.WindowsAlarms_8wekyb3d8bbwe microsoft.windowscommunicationsapps_8wekyb3d8bbwe NotepadPlusPlus_7njy0v32s6xk6 Microsoft.DesktopAppInstaller_8wekyb3d8bbwe Microsoft.Winget.Source_8wekyb3d8bbwe

JohnMcPMS commented 1 year ago

For the other PC, you can try just going to this link: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information

From the error, that should give the failing PC a 404. If it isn't, then I'm not sure what is failing. You can get around the experimental feature issue by just removing --open-logs and instead getting the log location from winget --info. The log file should give a better indication of exactly what is getting a 404.

johnnyde94 commented 1 year ago

nope works fine

e "Microsoft.Marketplace.Storefront.StoreEdgeFD.BusinessLogic.Response.PackageMetadata.PackageMetadataResponse, StoreEdgeFD" Data
$type "Microsoft.Marketplace.Storefront.StoreEdgeFD.BusinessLogic.Response.PackageMetadata.PackageMetadataData, StoreEdgeFD" SourceIdentifier "StoreEdgeFD" SourceAgreements
$type "Microsoft.Marketplace.Storefront.StoreEdgeFD.BusinessLogic.Response.PackageMetadata.SourceAgreements, StoreEdgeFD" AgreementsIdentifier "StoreEdgeFD" Agreements
0
$type "Microsoft.Marketplace.Storefront.StoreEdgeFD.BusinessLogic.Response.PackageManifest.AgreementDetail, StoreEdgeFD" AgreementLabel "Terms of Transaction" AgreementUrl "https://aka.ms/microsoft-store-terms-of-transaction" ServerSupportedVersions 0 "1.0.0" 1 "1.1.0" RequiredQueryParameters 0 "market" RequiredPackageMatchFields
0 "market"

JohnMcPMS commented 1 year ago

So Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe is probably the problem (although I apparently have 45 of those on my machine, but no version conflicts...).

Get-AppxPackage Microsoft.MicrosoftEdge.Stable

Should hopefully give us more information about the two.

johnnyde94 commented 1 year ago

kk

johnnyde94 commented 1 year ago

anything to try?

johnnyde94 commented 1 year ago

I looked on computer two to where the winget symlink is and winget.exe is not there. I tried installing the latest preview build but it's still not showing up.

johnnyde94 commented 1 year ago

It keeps looking for the D (drive lol) on both PC have no clue wtf is going on.

PC1: WinGet-2023-05-24-16-04-34.135.log

PC2: WinGet-2023-05-24-16-03-37.424.log

johnnyde94 commented 1 year ago

PC1: 2023-05-24 16:04:35.141 [CLI ] Caught wil::ResultException: D:\a_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\Schema\1_0\Interface_1_0.cpp(190)\WindowsPackageManager.dll!00007FFF95BAAA7D: (caller: 00007FFF95BB0BE9) Exception(1) tid(9898) 800700B7 Cannot create a file when that file already exists.

PC 2: 2023-05-24 16:03:41.378 [CLI ] Caught wil::ResultException: D:\a_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Rest\Schema\HttpClientHelper.cpp(137)\WindowsPackageManager.dll!00007FF811DCBBF3: (caller: 00007FF811DCB558) Exception(1) tid(56d8) 8A150044

denelon commented 1 year ago

@JohnMcPMS I think you said this might be an artifact from something else. Could you elaborate a bit?

johnnyde94 commented 1 year ago

Any help on this its annoying widget is not working on two of my devices lol

denelon commented 1 year ago

@johnnyde94 if you run winget uninstall Microsoft.Winget.Source_8wekyb3d8bbwe then winget source reset --force as an administrator

Does this resolve the issue?

johnnyde94 commented 1 year ago

On My main pc(2) no luck on PC 1 it DID fix the issue.

johnnyde94 commented 1 year ago

Failed when searching source: msstore An unexpected error occurred while executing the command: 0x8a150044 : The rest source endpoint is not found.

johnnyde94 commented 1 year ago

If i try to run winget on cmd it "runs" on powershell it doesn't recognise winget

johnnyde94 commented 1 year ago

it says to select an app to open "winget" so I'm assuming the computer is confused as to how it's installed. I tried to reinstall with the latest beta but no luck

denelon commented 1 year ago

What do you get for (run in PowerShell): get-appxpackage *vclibs* | select PackageFamilyName,Version,Architecture get-appxpackage *xaml* | select PackageFamilyName,Version,Architecture get-appxpackage *appinstaller* | select PackageFamilyName,Version,Architecture

denelon commented 1 year ago

You can also try:

Reset-AppxPackage -Package Microsoft.DesktopAppInstaller_1.20.1511.0_x64__8wekyb3d8bbwe

johnnyde94 commented 1 year ago

PS C:\Users\johnn> get-appxpackage vclibs | select PackageFamilyName,Version,Architecture

PackageFamilyName Version Architecture


Microsoft.VCLibs.140.00_8wekyb3d8bbwe 14.0.30704.0 X64 Microsoft.VCLibs.120.00.UWPDesktop_8wekyb3d8bbwe 12.0.40653.0 X64 Microsoft.VCLibs.120.00.UWPDesktop_8wekyb3d8bbwe 12.0.40653.0 X86 Microsoft.VCLibs.110.00.UWPDesktop_8wekyb3d8bbwe 11.0.61135.0 X86 Microsoft.VCLibs.110.00.UWPDesktop_8wekyb3d8bbwe 11.0.61135.0 X64 Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe 14.0.32530.0 X64 Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe 14.0.32530.0 X86 Microsoft.VCLibs.140.00_8wekyb3d8bbwe 14.0.32530.0 X64 Microsoft.VCLibs.140.00_8wekyb3d8bbwe 14.0.32530.0 X86 PS C:\Users\johnn> get-appxpackage xaml | select PackageFamilyName,Version,Architecture PackageFamilyName Version Architecture ----------------- ------- ------------ Microsoft.UI.Xaml.2.7_8wekyb3d8bbwe 7.2208.15002.0 X86 Microsoft.UI.Xaml.2.7_8wekyb3d8bbwe 7.2208.15002.0 X64 Microsoft.UI.Xaml.CBS_8wekyb3d8bbwe 8.2207.29001.0 X64 Microsoft.UI.Xaml.2.8_8wekyb3d8bbwe 8.2305.5001.0 X64 Microsoft.UI.Xaml.2.8_8wekyb3d8bbwe 8.2305.5001.0 X86

PS C:\Users\johnn> get-appxpackage appinstaller | select PackageFamilyName,Version,Architecture

PackageFamilyName Version Architecture


Microsoft.DesktopAppInstaller_8wekyb3d8bbwe 1.19.11071.0 X64

PS C:\Users\johnn> Reset-AppxPackage -Package Microsoft.DesktopAppInstaller_1.20.1511.0_x648wekyb3d8bbwe Reset-AppxPackage : Package was not found. Windows cannot remove Microsoft.DesktopAppInstaller_1.20.1511.0_x648wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed. At line:1 char:1

johnnyde94 commented 1 year ago

This didn't fix it i hope it would Add-AppxPackage https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

denelon commented 1 year ago

Did you try the troubleshooting steps?

johnnyde94 commented 1 year ago

still no luck, when i try to manualy point to winget.exe on powershell i get the error winget.ext the file cannot be accessed by the sytem Screenshot 2023-06-02 175814

denelon commented 1 year ago

Does the same thing happen on PowerShell 7?

denelon commented 1 year ago

I put the wrong version in the reset package command.

This should pipe the right version.

Get-AppxPackage *appInstaller* | Reset-AppxPackage

johnnyde94 commented 1 year ago

wtf works fine in powershell 7, what would cause that?

denelon commented 1 year ago

Honestly, I don't know. We'd need additional logs to troubleshoot what's happening.

Nishith-Savla commented 1 year ago

Resetting the Package works for me. Thanks @denelon!

GizmoTheGreen commented 9 months ago

I put the wrong version in the reset package command.

This should pipe the right version.

Get-AppxPackage *appInstaller* | Reset-AppxPackage

just had this issue on two computers and this solved it for me on both. thanks.! (simply resetting source --force did not help.)

Fedthans1 commented 5 months ago

@johnnyde94 would you mind running winget source reset --force --verbose-logs --open-logs in administrator mode and sharing the logs?

Why can i not run that commando in admin mode get this error C:\Windows\System32>winget 'winget' is not recognized as an internal or external command, operable program or batch file.