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.
Error :
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)
How can I solve this?
In my case, there we 2 docker containers running and the port 4444 used by selenium. Closing one container solved the issue for the other one. The message is still there, but the tests are running. Earlier they were getting stuck.
That error means that the port/address combination is already in use
This either means
To see open ports on a host, use command
netstat -vatn
. This will give quite a lot of output! To check if 9515 is in use, filter the output with grep like thisnetstat -vatn |grep 9515
Probably all you need to do is wait a few minutes for the socket to time out and try again
UPDATE: there is an option in chromedriver that must be set, here is a way of doing this with docker. Note that that the --whitelisted-ips is followed by nothing: it is forced as unset. To make this work you need a copy of the chromedriver zip in the directory the docker command is run from
In my case running
chromedriver
with--verbose
flag helped to figure out the issue: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.