i am using php-webdriver to connect to ChromeDriver 2.23.409687
but when i run my script i get this error on terminal
DevTools HTTP Request failed. DevTools HTTP Request: http://localhost:9992/json/version
my PHP code :
use Facebook\WebDriver;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\Chrome\ChromeOptions;
require_once "autoload.php";
$serverUrl = 'http://localhost:9515';
$options = new ChromeOptions();
$options->setBinary("/usr/bin/chromedriver");
$options->addArguments([
"--no-sandbox",
"--headless",
"--remote-debugging-port=9992",
"--disable-gpu",
"--window-size=1920,1080",
"--disable-dev-shm-usage"
]);
$caps = DesiredCapabilities::chrome();
$caps->setCapability(ChromeOptions::CAPABILITY, $options);
$caps->setPlatform("Linux");
// Chrome
$driver = RemoteWebDriver::create($serverUrl, $caps);
// Go to URL
$driver->get('https://www.tgju.org/gold-global');
$driver->quit();
Terminal output
Starting ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) on port 9515
Only local connections are allowed.
[0.001][SEVERE]: bind() returned an error, errno=98: Address already in use
[0.001][INFO]: listen on IPv4 failed, trying IPv6
[0.001][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address
[0.002][DEBUG]: listen on both IPv4 and IPv6 failed, giving up
Port not available. Exiting...
[1617752424.113][INFO]: [8ea89cde5398c4a6f1d33394fac04b75] COMMAND InitSession {
"capabilities": {
"firstMatch": [ {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ "--no-sandbox", "--headless", "--disable-gpu", "--window-size=1920,1080", "--disable-dev-shm-usage" ],
"binary": "/usr/bin/chromedriver"
},
"platformName": "linux"
} ]
},
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--no-sandbox", "--headless", "--disable-gpu", "--window-size=1920,1080", "--disable-dev-shm-usage" ],
"binary": "/usr/bin/chromedriver"
},
"platform": "Linux"
}
}
[1617752424.117][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_setting_values": {
"geolocation": 1
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[1617752424.118][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": false
}
}
}
[1617752424.118][INFO]: Launching chrome: /usr/bin/chromedriver --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-gpu --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.3ATjCn --window-size=1920,1080 data:,
Starting ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) on port 9515
Only local connections are allowed.
[0.001][SEVERE]: bind() returned an error, errno=98: Address already in use
[0.001][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address
Port not available. Exiting...
[1617752424.174][INFO]: [8ea89cde5398c4a6f1d33394fac04b75] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
[1617752424.175][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1617752424.175][DEBUG]: Log type 'browser' lost 0 entries on destruction
[1617752444.917][INFO]: [8bf237b817320ebfbac5874625ec70e8] COMMAND InitSession {
"capabilities": {
"firstMatch": [ {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ "--no-sandbox", "--headless", "--remote-debugging-port=9992", "--disable-gpu", "--window-size=1920,1080", "--disable-dev-shm-usage" ],
"binary": "/usr/bin/chromedriver"
},
"platformName": "linux"
} ]
},
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--no-sandbox", "--headless", "--remote-debugging-port=9992", "--disable-gpu", "--window-size=1920,1080", "--disable-dev-shm-usage" ],
"binary": "/usr/bin/chromedriver"
},
"platform": "Linux"
}
}
[1617752444.918][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_setting_values": {
"geolocation": 1
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[1617752444.918][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": false
}
}
}
[1617752444.918][INFO]: Launching chrome: /usr/bin/chromedriver --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-gpu --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=9992 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.DKOjZJ --window-size=1920,1080 data:,
[1617752444.919][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
Starting ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) on port 9515
Only local connections are allowed.
[1617752444.931][DEBUG]: DevTools HTTP Request failed
[0.002][SEVERE]: bind() returned an error, errno=98: Address already in use
[0.002][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address
Port not available. Exiting...
[1617752444.981][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752444.982][DEBUG]: DevTools HTTP Request failed
[1617752445.033][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.034][DEBUG]: DevTools HTTP Request failed
[1617752445.084][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.085][DEBUG]: DevTools HTTP Request failed
[1617752445.135][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.137][DEBUG]: DevTools HTTP Request failed
[1617752445.187][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.189][DEBUG]: DevTools HTTP Request failed
[1617752445.239][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.240][DEBUG]: DevTools HTTP Request failed
[1617752445.290][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.291][DEBUG]: DevTools HTTP Request failed
[1617752445.341][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.343][DEBUG]: DevTools HTTP Request failed
[1617752445.393][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.395][DEBUG]: DevTools HTTP Request failed
[1617752445.445][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.446][DEBUG]: DevTools HTTP Request failed
[1617752445.496][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.498][DEBUG]: DevTools HTTP Request failed
[1617752445.548][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.550][DEBUG]: DevTools HTTP Request failed
[1617752445.600][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.601][DEBUG]: DevTools HTTP Request failed
[1617752445.651][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.653][DEBUG]: DevTools HTTP Request failed
[1617752445.703][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.704][DEBUG]: DevTools HTTP Request failed
[1617752445.754][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.755][DEBUG]: DevTools HTTP Request failed
[1617752445.806][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.807][DEBUG]: DevTools HTTP Request failed
[1617752445.857][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.858][DEBUG]: DevTools HTTP Request failed
[1617752445.909][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.910][DEBUG]: DevTools HTTP Request failed
[1617752445.960][DEBUG]: DevTools HTTP Request: http://localhost:9992/json/version
[1617752445.961][DEBUG]: DevTools HTTP Request failed
[1617752445.962][INFO]: [8bf237b817320ebfbac5874625ec70e8] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited abnormally.
(chrome not reachable)
(The process started from chrome location /usr/bin/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
[1617752445.962][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1617752445.962][DEBUG]: Log type 'browser' lost 0 entries on destruction
i spent 1 week to solve this issue but i can't solve it after lots of googling