我使用以下命令在windows机器上运行一个windows docker容器:
PS C:> & 'C:Program FilesGoogleChromeApplicationchrome.exe' --headless --disable-gpu --remote-debugging-port=9222 --enable-logging --v=1 "localhost:3000"
Chrome进程将启动,然后出现以下日志错误:
PS C:> [0413/103634.151:ERROR:network_change_notifier_win.cc(226)] WSALookupServiceBegin failed with: 0
[0413/103634.167:VERBOSE1:webrtc_internals.cc(117)] Could not get the download directory.
[0413/103634.167:VERBOSE1:media_stream_manager.cc(871)] MSM::InitializeMaybeAsync([this=00005B6400335E00])
[0413/103634.167:VERBOSE1:media_stream_manager.cc(871)] MDM::MediaDevicesManager()
[0413/103634.167:VERBOSE1:media_stream_manager.cc(871)] MSM::MediaStreamManager([this=00005B6400335E00]))
DevTools listening on ws://127.0.0.1:9222/devtools/browser/8fb20519-4faf-412b-ad7c-c848c5d86458
[0413/103634.406:ERROR:network_change_notifier_win.cc(226)] WSALookupServiceBegin failed with: 0
[0413/103634.453:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary:
mf.dll: The specified module could not be found. (0x7E)
[0413/103634.453:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary:
mfplat.dll: The specified module could not be found. (0x7E)
[0413/103634.453:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary:
msmpeg2vdec.dll: The specified module could not be found. (0x7E)
[0413/103634.453:ERROR:dxva_video_decode_accelerator_win.cc(1465)] DXVAVDA fatal error: could not LoadLibrary:
dxva2.dll: The specified module could not be found. (0x7E)
[0413/103634.453:ERROR:dxva_video_decode_accelerator_win.cc(1469)] DXVAVDA fatal error: could not LoadLibrary:
msvproc.dll: The specified module could not be found. (0x7E)
虚拟机信息如下:
OS Name: Microsoft
OS Version: 10.0.17763 N/A Build 17763
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Server
这似乎与这个问题类似,但互联网连接正常,我可以连接到各种域/ips/端口。此外,如果对WSALookupServiceBegin的调用失败,我认为它不应该使浏览器崩溃。我的猜测是,在这个windows服务器实例中有一些图形/媒体库不可用,但我不确定这个错误可能来自什么。有什么想法吗?
不使用标志时的相同结果:PS C:> & 'C:Program FilesGoogleChromeApplicationchrome.exe' --enable-logging --v=1
如果你的基础图像是2019核心或更新版本,这是因为图像中缺少字体。它们在2016年之后被移除。查看此回购如何安装丢失的字体
我以前也遇到过同样的问题。您正在使用windowsservercore基本映像吗?
从我的角度来看,我认为这是因为错过了微软媒体基金会的功能。在更改基本映像mcr.microsoft.com/windows/server:ltsc2022之后,它就可以工作了,因为它启用了该功能。
这里是相关的stackoverflow以获得更多细节,https://github.com/microsoft/Windows-Containers/issues/260.