winutil icon indicating copy to clipboard operation
winutil copied to clipboard

Winget install always fails (maybe to do with https://winget.azureedge.net/cache?)

Open jslagle opened this issue 3 years ago • 5 comments

Describe the bug Winutil 23.09.23 winget install always fails on Windows 11 22H2 (on a VirtualBox 7.0.10r158379 VM). This might have to do with https://winget.azureedge.net/cache.

To Reproduce Steps to reproduce the behavior:

  1. Download and install https://download.virtualbox.org/virtualbox/7.0.10/VirtualBox-7.0.10-158379-Win.exe
  2. Download ‘Windows 11 (multi-edition ISO for x64 devices)’ from https://www.microsoft.com/software-download/windows11 (when I did this, I got ‘Win11_22H2_English_x64v2.iso’)
  3. Run VirtualBox, create a new VM with 8192 MB Ram, 4 processors, 150 GB Disk non-preallocated.
  4. Attach Win11_22H2_English_x64v2.iso to the VM.
  5. Start VM and follow vanilla Windows 11 install: English (World), Win 11 Pro, Work or School, Domain join instead, no password on local account.
  6. After Windows install is complete, open PowerShell in administrative mode.
  7. Type ‘Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process’ to allow scripts.
  8. Answer ‘y’ when asked if you want to change execution policy.
  9. Type ‘irm christitus.com/win | iex’ to run winutil (the winutil I got was version 23.09.23).
  10. Answer ‘n’ when asked if you want to install Chocolatey.
  11. On winutil Install tab, tick ‘Brave’ then click ‘Install Selection’.
  12. Wait for “Installs are Finished” (‘Done’) dialog box to appear (it takes several seconds).
  13. Observe the absence of Brave.
  14. Try installing any other combinations of packages, as you like (for me, nothing ever installed).

Expected behavior Selecting ‘Brave’ (or anything else) and then clicking ‘Install Selection’ should actually install whatever was selected. Actual behavior: winutil sits a while, then reports that “Installs are Finished”. But nothing seems to have been installed.

Screenshots Particulars of VirtualBox host machine: 01-host-info Particulars of VirtualBox: 02-VirtualBox-info Particulars of guest VM: 03-guest-info Ready to install Brave: 04-install-brave Installs are Finished...but not really: 05-install-failed Is this simply because Microsoft gave me an ISO with newer install files than Chris demonstrated on YouTube? 06-win-build-dates Additional context At the VM's administrative PowerShell command prompt, typing ‘winget -v’ reports v1.2.10691. Typing ‘winget list’ spins for about 20 seconds and reports nothing. Typing ‘winget source list’ reports:

Name    Argument
-----------------------------------------------------
msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
winget  https://winget.azureedge.net/cache

I noticed that browsing the azureedge.net address fails with ERR_CONNECTION_TIMED_OUT. Based on the 'winget source list' I saw on my host machine (which was installed way back on 10/29/2022), I tried the following experiment on the VM:

  1. winget source remove -n winget
  2. winget source add -n winget -a https://cdn.winget.microsoft.com/cache

When I then attempted to install Brave as before, it finally worked. I have no idea whether it is wise or appropriate to run the VM with the reference to cdn.winget.microsoft.com. However, that worked well enough to install Brave. I have not tested more.

jslagle avatar Oct 03 '23 01:10 jslagle

@jslagle Thats not the issue It is with the winget.ps1 file and where it downloads winget from

look at code https://github.com/ChrisTitusTech/winutil/blob/main/winget.ps1 This is whats broken even on main repo https://github.com/asheroto/winget-install

the workaround and tested is just open powershell as admin and just simply run winget install wingetcreate Screenshot 2023-10-03 at 1 58 37 AM Tested and working then Rerun winutil and u should be able to install ur app just fine Screenshot 2023-10-03 at 1 57 42 AM

noxhosting-io avatar Oct 03 '23 07:10 noxhosting-io

@KALIXHOSTING Thanks. I tried it. The workaround did not help in my case. When I run winget install wingetcreate it merely displays a spinner for a while, and then quietly dies. That is the same behavior I observed with winutil.

Looking with Wireshark, I see winget is apparently trying to connect to winget.azureedge.net, but to no avail.

Here is a 30-second screen capture of Winshark vs winget install wingetcreate. https://github.com/ChrisTitusTech/winutil/assets/13228979/b8fa6b2e-74b8-44a6-a3bd-94052a9e2c49

Looking at the following frame from that screen capture, I see timeouts at 143.244.220.150. That is the IP address my DNS reports for https://winget.azureedge.net/, so I still suspect that URL may be part of the problem. 07-wireshark-framegrab

jslagle avatar Oct 03 '23 20:10 jslagle

New Information

I believe the definitive answer is to be found at https://github.com/MicrosoftDocs/windows-dev-docs/issues/4646, where Brandon McMillan says recent Windows 11 22H2 AVD SKU’s use https://winget.azureedge.net/cache but should use https://cdn.winget.microsoft.com/cache.

While the specific 22H2 builds Brandon mentioned might not be in the ISO I downloaded from https://www.microsoft.com/software-download/windows11, a follow-up comment by denelon (Demitrius Nelon, Product Manager for WinGet) does confirm that https://cdn.winget.microsoft.com/cache is the correct URL.

Denelon suggests winget install "App Installer" -s msstore --force as a workaround. I think that is similar in principle to the workaround @KALIXHOSTING proposed, except that denelon uses “-s msstore” and thereby avoids attempting to fetch winget from the deprecated azureedge.net URL.

In my case, winget install "App Installer" -s msstore --force failed, possibly because my region was set to English (World). When I changed the region to English (United States) and downloaded App Installer from the Windows Store, winget went from v1.2.10691 to v1.6.2721, the new cdn.winget.microsoft.com URL magically showed up in winget source list, and winutil installed Brave as expected.

So it seems the azureedge.net URL was in the process of being phased out, and I just happened to get caught in the crossfire.

Resolution

There is no problem with winutil, just a (hopefully fleeting) migration problem with redirecting winget to the new URL. Therefore, I am closing the issue.

jslagle avatar Oct 04 '23 04:10 jslagle

@jslagle this still occurs (Feb 2024). I have a new install of Win11 Pro, v23H2 os build 22631.3155. I did a fresh install using internet sources.

winget shows a v1.2.10691

winget source list shows msstore and that azureedge.net/cache as the sources.

If I try to run winget install "App Installer" -s msstore --force it only finds "LG Monitor App Installer". The one I seem to want has id Microsoft.AppInstaller but is not on msstore so can't install it.

trying to remove the bad source works, but running winget source add -n winget -a https://cdn.winget.microsoft.com/cache fails (no error, just no source added).

EDIT, SOLUTION: I found the proper "App Installer", on msstore (here https://apps.microsoft.com/detail/9NBLGGH4NNS1) . it's a hidden package so you have to have a link to find it. I used the ID of it found in the URL to install it, and now winget works and I can install stuff properly. Here's the command you can use to install it (the solution):

winget install -s msstore --id 9NBLGGH4NNS1

jasonswearingen avatar Feb 21 '24 03:02 jasonswearingen

Image

Both of these solutions work for me. Using the 2nd one in my script since it just installs the latest version of WinGet, but the first one (mentioned above in this github issue) adds the new source

PowerPCFan avatar Apr 13 '25 17:04 PowerPCFan