如何修复"[SEVERE]:bind()失败:无法分配请求的地址(99)"在启动chromedriver时
我在Centos 7平台上下载了最新版本的chromedriver: https ://chromedriver.storage.googleapis.com/index.html?path = 74.0.3729.6/ 我启动chromedriver并收到此错误.
I downloaded the latest version of chromedriver in Centos 7 platform: https://chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/ I start chromedriver and get this error.
错误:
在端口9515上启动ChromeDriver 74.0.3729.6(255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729 @ {#29}) 仅允许本地连接. 请保护ChromeDriver和相关测试框架使用的端口,以防止恶意代码访问. [1556179366.141] [SEVERE]:bind()失败:无法分配请求的地址(99)
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 9515 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. [1556179366.141][SEVERE]: bind() failed: Cannot assign requested address (99)
我该如何解决?
在我的情况下,运行带有--verbose
标志的chromedriver
有助于解决问题:
In my case running chromedriver
with --verbose
flag helped to figure out the issue:
[1564749154.010][SEVERE]: bind() failed: Cannot assign requested address (99)
[1564749154.011][INFO]: listen on IPv6 failed with error ERR_ADDRESS_INVALID
Chrome尝试侦听Docker中未启用的IPv6地址.您可以启用IPv6 支持(仅在Linux主机上有效)或忽略该错误因为chromedriver
进程仍然会监听IPv4.
Chrome attempted to listen on IPv6 address, which was not enabled in Docker. You can either enable IPv6 support (which works only on Linux host) or ignore the error since chromedriver
process will be listening on IPv4 anyway.