browsers (but not CURL) suddenly unable to make HTTP requests on VM

2024-09-20 12:38:20 浏览数 (1)

Win32/.NET applications and browsers (but not CURL) suddenly unable to make HTTP requests on VM

突然浏览器不能上网,powershell的invoke-webrequest (alias:curl)也不行,但是CURL(curl.exe)可以访问

打开eventvwr分析,发现事件ID:7024 很多,信息:

WinHTTP Web Proxy Auto-Discovery Service 服务由于下列服务特定错误而终止:

无法创建终结点映射表数据库项。

根据问题现象搜到2个帖子很贴合,解决方案就是禁用这2个服务:

WinHttpAutoProxySvc (WinHTTP Web Proxy Auto-Discovery Service)

iphlpsvc (IP Helper)

https://serverfault.com/questions/1030775/win32-net-applications-and-browsers-but-not-curl-suddenly-unable-to-make-http/1059777

I had the same problem. I had disabled the services "WinHttpAutoProxySvc" and "iphlpsvc" in the instances that I had the problem . The service "iphlpsvc" depends on "WinHttpAutoProxySvc" and provides connectivity IPv6 over IPv4 (6to4). I haven't detected any problem with this action since last month and up to now.

https://docs.microsoft.com/en-us/answers/questions/378104/winhttp-web-proxy-auto-discovery-service-winhttpau.html

For information, we don't know exactly what is the problem, but we fix it by disabling 2 services:

- WebHttpAutoProxySvc

- Ip Helper service

Those services are not usefull for us.

这个问题,跟微软进行了交流,是微软的一个bug,微软怀疑winhttp起不来是由于winhttp出现了数百次甚至更多的重启,导致rpc endpoint到了limit value。

server2016及其之前的版本解决不了(不打算解决,因为操作系统主流生命周期决定的,2016的2022.01.11已截止),

server2022在着手开发补丁,微软补丁发布之前的规避方案有3种

第1种就是前面那种,能解决问题,但不太建议。

第2种就是使用1703及其更高版本的系统(在公有云的话,就是选用2019、2022镜像,2022目前是白名单控制,可跟客服申请)并且增加内存到至少4G或者设置服务为own模式,微软帖子有解释原理,大致意思就是部分系统服务在内存3.5G以上会自动own模式,内存低于3.5G会默认share模式,我专门写了一篇文档解析了下微软这篇文档。

如何设置服务为own模式?

手动从服务列表停止WinHttpAutoProxySvc 服务

执行命令设置own模式并开启服务

sc.exe config WinHttpAutoProxySvc type= own

sc.exe start WinHttpAutoProxySvc

如何设置服务为share模式?

手动从服务列表停止WinHttpAutoProxySvc 服务

执行命令设置share模式并开启服务

sc.exe config WinHttpAutoProxySvc type= share

sc.exe start WinHttpAutoProxySvc

0 人点赞