winget-cli: Can't upgrade or install packages
Since #2666 was closed, and anyone still encountering trouble was asked to create a new issue, I’ll reference https://github.com/microsoft/winget-cli/issues/2666#issuecomment-1311145570 here.
The winget settings
file is empty:
{
"$schema": "https://aka.ms/winget-settings.schema.json",
// For documentation on these settings, see: https://aka.ms/winget-settings
// "source": {
// "autoUpdateIntervalInMinutes": 5
// },
}
DO may have policies affecting the behavior of WinGet. If you run
winget --info
any policies will be displayed associated with WinGet (App Installer).
Would they just be output into console if such policies exist? I don’t see anything out of the ordinary:
> winget --info
Windows Package Manager (Preview) v1.4.2161-preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19044.2130
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.2161.0
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
winget source update --verbose-logs
winget upgrade --all --verbose-logs
winget upgrade --verbose-logs
_Originally posted by @github-account1111 in https://github.com/microsoft/winget-cli/issues/2666#issuecomment-1311145570_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 44 (16 by maintainers)
winget
updated without issue for me as of an hour or two ago! thanks a bunch to everyone involved in getting that sorted out~I believe we have finally resolved our CDN related issue. Try downloading and installing the latest source.msix. If it was in fact the CDN issue, your system wasn’t getting the latest version of the cache and ended up getting stale and staying out of date. Also check the TTL in settings. If it’s not specified, the default timeout is 5 minutes. If it’s set to “0” then it would never update.
Greetings everyone, it looks like the CDN issue has returned, everything worked fine yesterday, now I am seeing the dreaded
Failed in attempting to update the source: winget
error again, didn’t make any changes to networking or WinGet itself.Just tried
winget upgrade --all
works for me now0-bytes package problem still frequently present in Italy and Nederland (vpn).
I ran
winget source update
multiple times, tried to update winget, tried to update the package manager, nothing worked.Then, randomly it finally worked.
CDN (
cdn.winget.microsoft.com
) points tosni1gl.wpc.nucdn.net
with ip152.199.21.175
.Log:
I run a simple powershell script to fetch the filesize:
1..20 | % { curl -L -I https://cdn.winget.microsoft.com/cache/source.msix 2>&1 | findstr /i length }
and this is the result:Hi, we are still experiencing the issue (in US Midwest) with the 0-byte error. The CDN is connecting to sni1gl.wpc.nucdn.net [152.195.19.97].
@denelon: Thank you for clarifying the URL. The file downloads with a filesize of 0KB
and cannot be parsed by the app installer:

Wow I guess it was a CDN issue after all. Did a
source reset
followed by asource update
, and now all the updates have finally shown up and gone through after all these months.Amazing. I think it’s safe to close this then?
winget source update
working. 0 byte file problem no longer present.Thanks
That’s what I did in https://github.com/microsoft/winget-cli/issues/2696#issuecomment-1316170051 upon your request.
Thanks for reporting this. We’re still working with the CDN provider to see what else can be done to resolve this issue. We’ve now resorted to purging the cache after each publish run.
This problem is related to the CDN issue. We’ve made several changes in the configuration to avoid this from happening. We’re looking into this. I’ve seen some users have modified their hosts file to temporarily point to another endpoint that is working correctly. I don’t know the list of IP addresses as they are managed by the CDN. With a valid URL it’s possible to download and manually install the source.msix file to get a valid copy of the cache. What I can’t guarantee is that when the TTL expires (default 5 minutes) it won’t repro.
We’re going to purge again to see if that will clear the endpoints with the zero-byte file.