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

InternetOpenUrl() failed. 0x80072efd : unknown error

Open Lexicality opened this issue 3 years ago • 16 comments

Brief description of your issue

This is very similar to #326, however I have TLS 1.2 enabled and I can access the cache fine outside winget.

Steps to reproduce

C:\WINDOWS\system32>winget --version
v0.1.42241 Preview
C:\WINDOWS\system32>winget search github
Failed to open the source; try removing and re-adding it
An unexpected error occurred while executing the command:
InternetOpenUrl() failed.
0x80072efd : unknown error

C:\WINDOWS\system32>winget source list
Name   Argument
-----------------------------------------
winget https://winget.azureedge.net/cache

C:\WINDOWS\system32>winget source reset --force
Resetting all sources...Done

C:\WINDOWS\system32>winget source update
Updating all sources...
Updating source: winget...
An unexpected error occurred while executing the command:
InternetOpenUrl() failed.
0x80072efd : unknown error

C:\WINDOWS\system32>winget source add --name test https://winget.azureedge.net/cache
Adding source:
  test -> https://winget.azureedge.net/cache
An unexpected error occurred while executing the command:
A connection with the server could not be established

C:\WINDOWS\system32>curl https://winget.azureedge.net/cache
´╗┐<?xml version="1.0" encoding="utf-8"?><Error><Code>ResourceNotFound</Code><Message>The specified resource does not exist.
RequestId:a5bc7e36-e01e-009c-76ff-88e0ac000000
Time:2020-09-12T12:24:09.5326840Z</Message></Error>

Expected behavior

winget should function

Actual behavior

winget does not function

Environment

C:\WINDOWS\system32>winget --info
Windows Package Manager v0.1.42241 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.18362.1016
Package: Microsoft.DesktopAppInstaller v1.10.42241.0

Lexicality avatar Sep 12 '20 12:09 Lexicality

I eventually figured out it was being blocked by my firewall under appinstallercli.exe. I expected the winget application to have the word winget in the executable name or installation directory, but neither of them do which is why it took so long for me to find out where it was being blocked.

I would like to suggest renaming the executable to winget-installer-cli.exe or something, and maybe having better error messages for when it's blocked by a firewall?

Lexicality avatar Sep 12 '20 14:09 Lexicality

@Lexicality we don't get an explicit indication that the firewall is blocking the connection. I'm looking at what we can do in the error text, and getting an update at docs.microsoft.com.

denelon avatar Sep 14 '20 17:09 denelon

The error codes of InternetOpenUrl should get mapped to a descriptive string and displayed. E.g. 0x80072efd maps to ERROR_INTERNET_CANNOT_CONNECT. I had a similar error the other day where the TLS certificate of a download was invalid. I found out by looking up the error code. "unknown error" suggests it's a generic error code but it's actually not.

chausner avatar Oct 19 '20 20:10 chausner

I had error 0x80072f7d in winget. Strange fix for this is enabling tls 1.2 in internet explorer settings.

bezuglov3000 avatar May 02 '21 20:05 bezuglov3000

I'm getting this error code when using winget upgrade --all - it get's stuck upgrading OpenVPN Connect, not sure why.

mrashco avatar Oct 25 '21 04:10 mrashco

I had error 0x80072f7d in winget. Strange fix for this is enabling tls 1.2 in internet explorer settings.

this worked for me.

lightnear avatar Oct 29 '21 01:10 lightnear

I have this problem with VPN installed and that means winget is useless if the vpn is activated. Is that so?

dtantono avatar Jun 22 '22 12:06 dtantono

I just got the same issues for seemingly random packages. image

mmuffins avatar Oct 26 '22 19:10 mmuffins

I just got the same issues for seemingly random packages.

I have the same issue, but I think it's because my work laptop is domain joined and using Cisco Umbrella. Many of the URLs used by winget are blocked unless I'm logged into the VPN. Perhaps you have the same? 🤷‍♂️

SuperJC710e avatar Oct 26 '22 19:10 SuperJC710e

I have the same issue, but I think it's because my work laptop is domain joined and using Cisco Umbrella. Many of the URLs used by winget are blocked unless I'm logged into the VPN. Perhaps you have the same? 🤷‍♂️

I ran it from my home computer. No vpns, proxies, or other network components you wouldn't find a regular home network environment. There haven't been any changes to the computer or network (that I know of), and I'm able to directly download the executables: image

mmuffins avatar Oct 26 '22 20:10 mmuffins

You could try switching to the "wininet" downloader rather than "DO" (Delivery Optimization) which is the default.

It's configurable in winget settings.

denelon avatar Oct 26 '22 20:10 denelon

You could try switching to the "wininet" downloader rather than "DO" (Delivery Optimization) which is the default.

It's configurable in winget settings.

Thanks for the suggestion. It doesn't work in my case, but I think it's because the Cisco Umbrella basically does some sort of MITM SSL for sites it's blocking for non-VPN authenticated users. (I can see it if I use the URL with the error in a browser.) It's annoying, and VPN doesn't really help me in my case, I still need to to everything through a Citrix Virtual Desktop anyway, so I mostly don't log it in...

SuperJC710e avatar Oct 26 '22 21:10 SuperJC710e

Same here, I'm afraid. Neither explicitly setting wininet changes anything. But for what it's worth, it seems to be an intermittent problem for me. Both packages I posted yesterday work fine.

mmuffins avatar Oct 27 '22 18:10 mmuffins

It really seems like an intermittent thing, but not the way I would like it to be - downloads seem to work sporadically, but are broken most of the time for me. I wanted to see if I can find out more about it and ran winget install Python.Python.3.10 --verbose-logs option, and saw the following entries at the very bottom of the log file

2022-11-04 13:41:46.546 [REPO] Downloading manifest
2022-11-04 13:41:46.546 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/p/Python/Python/3/10/3.10.8/e5c5-Python.Python.3.10.yaml
2022-11-04 13:41:47.140 [CORE] Download request failed. Returned status: 404
2022-11-04 13:41:47.141 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(64)\WindowsPackageManager.dll!00007FFBE131FFE0: (caller: 00007FFBE137A869) Exception(3) tid(1304) 80190194 Not found (404).

    Msg:[Download request status is not success.] 

winget then retries a couple of times and gives up. If I try to access the url mentioned in the log I'm getting the following

<Error>
<Code>BlobNotFound</Code>
<Message>
The specified blob does not exist. RequestId:ed4070e8-301e-0051-0e4b-f0b792000000 Time:2022-11-04T12:49:41.4264430Z
</Message>
</Error>

mmuffins avatar Nov 04 '22 12:11 mmuffins

My bad, it seems like that problem may not be the exact same as before. The error I'm getting right now is a different one:

Failed in attempting to update the source: winget
An unexpected error occurred while executing the command:
Download request status is not success.
0x80190194 : unknown error

This seems to be a known issue - #2666, #1348 On top of that there is an ongoing discussion about issues trying to reach cdn.winget.microsoft.com which seems to be widespread - #1656

mmuffins avatar Nov 04 '22 12:11 mmuffins

I'm getting this error, here's what's in verbose logs:

2022-11-12 20:56:50.540 [CLI ] Found one app. App id: OBSProject.OBSStudio App name: OBS Studio
2022-11-12 20:56:50.542 [REPO] Downloading manifest
2022-11-12 20:56:50.542 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/o/OBSProject/OBSStudio/28.1.2/e8c5-OBSProject.OBSStudio.yaml
2022-11-12 20:56:50.675 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(49)\WindowsPackageManager.dll!00007FFB2B6DF642: (caller: 00007FFB2B73A869) Exception(2) tid(39c) 80072F7D     Msg:[InternetOpenUrl() failed.] 

2022-11-12 20:56:50.675 [REPO] Downloading manifest failed, waiting a bit and retrying: https://cdn.winget.microsoft.com/cache/manifests/o/OBSProject/OBSStudio/28.1.2/e8c5-OBSProject.OBSStudio.yaml
2022-11-12 20:56:51.186 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/o/OBSProject/OBSStudio/28.1.2/e8c5-OBSProject.OBSStudio.yaml
2022-11-12 20:56:51.300 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(49)\WindowsPackageManager.dll!00007FFB2B6DF642: (caller: 00007FFB2B73A869) Exception(3) tid(39c) 80072F7D     Msg:[InternetOpenUrl() failed.] 

2022-11-12 20:56:51.300 [CLI ] Caught wil::ResultException: D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(49)\WindowsPackageManager.dll!00007FFB2B6DF642: (caller: 00007FFB2B73A869) Exception(3) tid(39c) 80072F7D     Msg:[InternetOpenUrl() failed.] 

If I open the URL in Firefox, it downloads the yaml file and it looks like it has valid contents.

chylex avatar Nov 12 '22 20:11 chylex

Hi, can't recall my last winget use, maybe 2 weeks ago? Now, I get 5 upgrades available. An unexpected error occurred while executing the command: InternetOpenUrl() failed. 0x80072f05 : unknown error

XtremeMaC avatar Feb 12 '23 01:02 XtremeMaC

Hi, can't recall my last winget use, maybe 2 weeks ago? Now, I get 5 upgrades available. An unexpected error occurred while executing the command: InternetOpenUrl() failed. 0x80072f05 : unknown error

Related issues: https://github.com/microsoft/winget-cli/issues/2956

VergeDX avatar Feb 12 '23 05:02 VergeDX

Hi, can't recall my last winget use, maybe 2 weeks ago? Now, I get 5 upgrades available. An unexpected error occurred while executing the command: InternetOpenUrl() failed. 0x80072f05 : unknown error

Related issues: #2956

Try ipconfig /Flushdns that worked for me having tried everything else suspsect.

threader avatar Feb 12 '23 12:02 threader

I have a similar problem. I was able to install wget without a problem, but can't install grep. Winget version v1.6.3482

C:\WINDOWS\system32>winget install -e --id GnuWin32.Grep
Found GnuWin32: Grep [GnuWin32.Grep] Version 2.5.4
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://sourceforge.net/projects/gnuwin32/files/grep/2.5.4/grep-2.5.4-setup.exe/download
An unexpected error occurred while executing the command:
InternetOpenUrl() failed.
0x80072f19 : unknown error

I have added everything possible related to winget manually to the firewall.

rudolphos avatar Jan 09 '24 00:01 rudolphos