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

winget source update is not available

Open lvzhenbo opened this issue 3 years ago • 15 comments

Brief description of your issue

When I run this command, the terminal is stuck at the following screen image It only shows the path where I am and the process cannot be ended log

2022-01-27 03:02:11.971 [CORE] WinGet, version [1.2.3411-preview], activity [{BE59B699-D786-4CB8-9F77-6E011F6EF80F}]
2022-01-27 03:02:11.972 [CORE] OS: Windows.Desktop v10.0.19044.1503
2022-01-27 03:02:11.972 [CORE] Command line Args: "C:\Users\29422\AppData\Local\Microsoft\WindowsApps\winget.exe" source update
2022-01-27 03:02:11.972 [CORE] Package: Microsoft.DesktopAppInstaller v1.17.3411.0
2022-01-27 03:02:11.972 [CORE] IsCOMCall:0; Caller: winget-cli
2022-01-27 03:02:11.990 [CLI ] WinGet invoked with arguments: 'source' 'update'
2022-01-27 03:02:11.990 [CLI ] Found subcommand: source
2022-01-27 03:02:11.990 [CLI ] Found subcommand: update
2022-01-27 03:02:11.990 [CLI ] Leaf command to execute: root:source:update
2022-01-27 03:02:11.990 [CLI ] Executing command: update
2022-01-27 03:02:11.993 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2022-01-27 03:02:12.013 [REPO] Named source requested, found: msstore
2022-01-27 03:02:12.014 [REPO] Named source to be updated, found: msstore
2022-01-27 03:02:12.126 [REPO] Named source requested, found: winget
2022-01-27 03:02:12.129 [REPO] Named source to be updated, found: winget

Steps to reproduce

1.run windows terminal 2.Input winget source update 3.press enter

Expected behavior

command will run normally and end

Actual behavior

It gets stuck and shows strange things

Environment

Windows Package Manager (Preview) v1.2.3411-preview
Windows: Windows.Desktop v10.0.19044.1503
程序包: Microsoft.DesktopAppInstaller v1.17.3411.0

lvzhenbo avatar Jan 26 '22 19:01 lvzhenbo

Can you try to run winget source reset --force as an administrator and see if that clears it up?

If not, can you run winget source update --verbose-logs and post that output?

jedieaston avatar Jan 26 '22 20:01 jedieaston

Yes,winget source reset --force command works correctly image

lvzhenbo avatar Jan 26 '22 20:01 lvzhenbo

Do your sources update correctly after running that command?

jedieaston avatar Jan 26 '22 20:01 jedieaston

No, still not working

lvzhenbo avatar Jan 26 '22 20:01 lvzhenbo

I have exactly the same issue like you, and actually EVERY winget command would get stuck.

This solution works for me. Change the dns server to 4.2.2.2 and 4.2.2.1 and retry. (or some other dns servers I guess)

Reason for this: I ran

winget source update --versboe-logs

after runing the command

winget source reset --force

Then I checked the logs and found things below:

2022-03-04 17:42:14.923 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2022-03-04 17:42:14.923 [CORE] Downloading to path: C:\Users\D~1\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
2022-03-04 17:42:14.923 [CORE] Started applying motw to C:\Users\D~1\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix with zone: 3
2022-03-04 17:42:14.926 [CORE] Finished applying motw
2022-03-04 17:42:14.926 [CORE] WinINet downloading from url: https://winget.azureedge.net/cache/source.msix
2022-03-04 17:42:19.624 [CORE] Download request status success.
2022-03-04 17:42:19.624 [CORE] Download size: 3350977
2022-03-04 17:42:59.804 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(94)\AppInstallerCLI.exe!00007FF629C06A56: (caller: 00007FF629C07422) Exception(1) tid(9a4) 80072F78     Msg:[InternetReadFile() failed.] 

2022-03-04 17:42:59.820 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\RepositorySource.cpp(681)\AppInstallerCLI.exe!00007FF629D57CA1: (caller: 00007FF629C5F58C) LogHr(1) tid(9a4) 80072F78     Msg:[D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(94)\AppInstallerCLI.exe!00007FF629C06A56: (caller: 00007FF629C07422) Exception(1) tid(9a4) 80072F78     Msg:[InternetReadFile() failed.] 
] 

2022-03-04 17:42:59.820 [REPO] Source add/update failed, waiting a bit and retrying: winget
2022-03-04 17:43:21.466 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2022-03-04 17:43:21.466 [CORE] Downloading to path: C:\Users\D~1\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
2022-03-04 17:43:21.466 [CORE] Started applying motw to C:\Users\D~1\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix with zone: 3
2022-03-04 17:43:21.469 [CORE] Finished applying motw
2022-03-04 17:43:21.470 [CORE] WinINet downloading from url: https://winget.azureedge.net/cache/source.msix
2022-03-04 17:43:25.436 [CORE] Download request status success.
2022-03-04 17:43:25.436 [CORE] Download size: 3350977

It said it lacked some extension and kept retrying to download it. The [FAIL] says InternetReadFile() fails. I copied the url https://winget.azureedge.net/cache/source.msix and tried to download it manually but it failed. I'd tried to use some proxy and didn't work. Well, it reminds me of an annoying problem of Chinese Internet so I tried to specify the dns server and it worked. Rerunning winget commands again with --verbose-logs now gives the following log

2022-03-04 17:58:30.839 [REPO] Adding to aggregated source: winget
2022-03-04 17:58:30.867 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2022-03-04 17:58:30.867 [CORE] Found matching extension.

which says the winget has found the matching extension. I've tried to install, update source, upgrade with DHCP set and they are still fine.

Conclusion Internet issue.

Anikund avatar Mar 04 '22 10:03 Anikund

@lvzhenbo does this kind of workaround fix the issue you're encountering?

denelon avatar Mar 10 '22 17:03 denelon

@lvzhenbo does this kind of workaround fix the issue you're encountering?

I tried, but it didn't solve the problem

lvzhenbo avatar Mar 11 '22 01:03 lvzhenbo

OK, I'll keep the bug open.

Would you mind running the same commands as Anikund and share the logs?

denelon avatar Mar 11 '22 15:03 denelon

Well, I updated the system today, and the problem was solved, I think it may be a problem with the system components

lvzhenbo avatar Mar 14 '22 02:03 lvzhenbo

me,too

environment:

windows11 22h2 winget --version : v1.4.2161-preview

winget source list

msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0 winget https://cdn.winget.microsoft.com/cache

how to download Microsoft.Winget.Source_8wekyb3d8bbwe.msix perfect?

radiorz avatar Oct 10 '22 02:10 radiorz

I have the same problem - what is going on?

JuryA avatar Feb 03 '23 14:02 JuryA

I have the same problem - what is going on?

I do not know, I updated the system on it, you can try reinstalling winget and update the system

lvzhenbo avatar Feb 10 '23 09:02 lvzhenbo

https://cdn.winget.microsoft.com/cache/source.msix is the URL to the PreIndexed package that contains the local copy of the database for the community repository.

The client is attempting to download and install that package every five minutes as a default behavior.

As a workaround you may be able to download and "double click" the package to install the source for winget.

Note there is a 1.5 preview available in the releases here at GitHub.

denelon avatar Feb 10 '23 17:02 denelon

https://cdn.winget.microsoft.com/cache/source.msix is the URL to the PreIndexed package that contains the local copy of the database for the community repository.

As a workaround you may be able to download and "double click" the package to install the source for winget.

This worked for me, running 1.5.1. My situation is a little unique in that the system I'm running it on, I don't have admin rights with the account I'm logged in as. However, I do have an account I can open a powershell window with admin rights. Additionally, the MS Store has been removed. In the elevated prompt, running as a different, it was unable to get the winget source (but was able to pull the msstore source). The regular account was able to get pull the winget source. Downloading the source.msix and installing it in the elevated prompt using Add-AppxPackage -Path source.msix seemed to resolve the issue.

Atamido avatar Jul 19 '23 17:07 Atamido

Update_PS_winget.zip

Created a PowerShell script that will update PowerShell and Winget to the latest on systems with this issue.

GuruVoodoo avatar Jan 23 '24 19:01 GuruVoodoo

This issue was filed against an earlier version of WinGet. I'm going to go ahead and close this issue as it's more often a transient issue related to the CDN rather than the client. We've added additional resilience to the client to handle situations when the index isn't able to be downloaded or updated.

denelon avatar Mar 27 '24 18:03 denelon