Node on Windows Server: "Process refused to die after 10 seconds, and couldn't taskkill it"

2,347 views
Skip to first unread message

Thorsten

unread,
Jun 28, 2016, 1:13:53 PM6/28/16
to Selenium Users
Hello everyone,

at the moment I am trying to set up a Selenium test environment - but I got stuck setting up the server:

Starting the server (hub and node) works fine, they are on the same host. Running a test also works. But when the test is done and the browser is about to close, the node is not able to really close the browser. The browser window disappears but the browser process itself continues to run. The node then prints a stacktrace saying

java.lang.RuntimeException: Process refused to die after 10 seconds, and couldn't taskkill it: Timeout waiting for process to die
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:142)
at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$2(UnixProcess.java:246)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:246)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.quit(NewProfileExtensionConnection.java:194)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:364)
at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:310)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:529)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103)
at com.sun.proxy.$Proxy1.quit(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.quit(EventFiringWebDriver.java:202)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSession.java:50)
at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSession.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.openqa.selenium.os.ProcessUtils$ProcessStillAliveException: Timeout waiting for process to die
at org.openqa.selenium.os.ProcessUtils.waitForProcessDeath(ProcessUtils.java:67)
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:139)
... 24 more
Caused by: java.lang.InterruptedException
at java.lang.ProcessImpl.waitFor(Unknown Source)
at org.openqa.selenium.os.ProcessUtils$ProcessWaiter.run(ProcessUtils.java:164)
... 1 more

If I try to kill the browser process that was started by the node, I am not able to do so. I just get the message "Access denied" (although I try to kill a process of my own user). After a couple of minutes the browser process finally disappears and the memory is freed.

I tried Windows Server 2008R2 and 2012R2 - the problem occurs on both.
There is no difference between Firefox and Chrome - both will hang in the same way.
Selenium Server is version 2.53.

If I run exactly the same setup on Windows 7 everything works like a charm, no problem at all.

Any idea why this problem happens on Windows Server and how to solve it?

Larisa

unread,
Sep 23, 2016, 6:52:45 AM9/23/16
to Selenium Users
I get the same error, but on my local Window 8 machine. I have latest version of Selenium(2.53) and Firefox (47). Couldn't find a fix yet 

palanisamy Panneerselvam

unread,
Nov 3, 2016, 2:59:55 AM11/3/16
to Selenium Users
WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
java.lang.NullPointerException: Unable to find executable for: taskkill
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:251)
at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:178)
at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:138)
at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$2(UnixProcess.java:246)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:701)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:526)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:134)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at Testing.java.DemoTesting.main(DemoTesting.java:12)

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"2500.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=54.0.2840.87)
  (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.2.9200 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.21 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'USER', ip: '192.168.0.118', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at Testing.java.DemoTesting.main(DemoTesting.java:12)
How to solve the problem tell me any one


Samrendra K

unread,
Dec 18, 2016, 8:02:57 AM12/18/16
to Selenium Users
I GOT THE SOLUTION :

Use driver.close(); //Resolved the issue for me
Dont use driver.quit();//created below problem

Jim Evans

unread,
Dec 18, 2016, 11:28:01 AM12/18/16
to Selenium Users
Please be aware using .close() instead of .quit() may leave processes running, which may consume memory drain other resources on the node.

praveen...@gmail.com

unread,
Jun 11, 2018, 1:24:04 PM6/11/18
to Selenium Users

Use 45 FIREFOX version browser  u gets the answer by the end of u have to use driver.close();

praveen...@gmail.com

unread,
Jun 11, 2018, 1:49:05 PM6/11/18
to Selenium Users
u have to check your environmental path delit previous path & add  jre &  jdk u get the best
Reply all
Reply to author
Forward
0 new messages