org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to...
up vote
33
down vote
favorite
I am trying to launch chrome with an URL, the browser launches and it does nothing after that.
I am seeing the below error after 1 minute:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
My configuration:
Chrome : 66
ChromeBrowser : 2.39.56
P.S everything works fine in Firefox
google-chrome selenium selenium-webdriver webdriver selenium-chromedriver
add a comment |
up vote
33
down vote
favorite
I am trying to launch chrome with an URL, the browser launches and it does nothing after that.
I am seeing the below error after 1 minute:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
My configuration:
Chrome : 66
ChromeBrowser : 2.39.56
P.S everything works fine in Firefox
google-chrome selenium selenium-webdriver webdriver selenium-chromedriver
1
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10
add a comment |
up vote
33
down vote
favorite
up vote
33
down vote
favorite
I am trying to launch chrome with an URL, the browser launches and it does nothing after that.
I am seeing the below error after 1 minute:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
My configuration:
Chrome : 66
ChromeBrowser : 2.39.56
P.S everything works fine in Firefox
google-chrome selenium selenium-webdriver webdriver selenium-chromedriver
I am trying to launch chrome with an URL, the browser launches and it does nothing after that.
I am seeing the below error after 1 minute:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
My configuration:
Chrome : 66
ChromeBrowser : 2.39.56
P.S everything works fine in Firefox
google-chrome selenium selenium-webdriver webdriver selenium-chromedriver
google-chrome selenium selenium-webdriver webdriver selenium-chromedriver
edited Jun 1 at 11:53
DebanjanB
37.4k73373
37.4k73373
asked Jun 1 at 11:21
Kumar Sampath
226128
226128
1
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10
add a comment |
1
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10
1
1
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10
add a comment |
12 Answers
12
active
oldest
votes
up vote
19
down vote
This error message...
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your code trials and the versioning information of all the binaries would have given us some hint about what's going wrong.
However as per Add --disable-dev-shm-usage to default launch flags seems adding the argument --disable-dev-shm-usage
will temporary solve the issue.
If you desire to initiate/span a new Chrome Browser session you can use the following solution:
System.setProperty("webdriver.chrome.driver", "C:\path\to\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
disable-dev-shm-usage
As per base_switches.cc disable-dev-shm-usage
seems to be valid only on Linux OS:
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The /dev/shm partition is too small in certain VM environments, causing
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
// work-around this issue (a temporary directory will always be used to create
// anonymous shared memory files).
const char kDisableDevShmUsage = "disable-dev-shm-usage";
#endif
In the discussion Add an option to use /tmp instead of /dev/shm David mentions:
I think it would depend on how are /dev/shm and /tmp mounted.
If they are both mounted as tmpfs I'm assuming there won't be any difference.
if for some reason /tmp is not mapped as tmpfs (and I think is mapped as tmpfs by default by systemd), chrome shared memory management always maps files into memory when creating an anonymous shared files, so even in that case shouldn't be much difference. I guess you could force telemetry tests with the flag enabled and see how it goes.
As for why not use by default, it was a pushed back by the shared memory team, I guess it makes sense it should be useing /dev/shm for shared memory by default.
Ultimately all this should be moving to use memfd_create, but I don't think that's going to happen any time soon, since it will require refactoring Chrome memory management significantly.
But what caused this specific error aboutDevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?
– user9315861
Jun 7 at 9:43
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
|
show 1 more comment
up vote
15
down vote
I started seeing this problem on Monday 2018-06-04. Our tests run each weekday. It appears that the only thing that changed was the google-chrome version (which had been updated to current) JVM and Selenium were recent versions on Linux box ( Java 1.8.0_151, selenium 3.12.0, google-chrome 67.0.3396.62, and xvfb-run).
Specifically adding the arguments "--no-sandbox" and "--disable-dev-shm-usage" stopped the error.
I'll look into these issues to find more info about the effect, and other questions as in what triggered google-chrome to update.
ChromeOptions options = new ChromeOptions();
...
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this
– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
add a comment |
up vote
7
down vote
I had the same problem in python. The above helped. Here is what I used in python -
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',chrome_options=chrome_options)
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
add a comment |
up vote
6
down vote
accepted
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
add a comment |
up vote
6
down vote
We were having the same issues on our jenkins slaves (linux machine) and tried all the options above.
The only thing helped is setting the argument
chrome_options.add_argument('--headless')
But when we investigated further, noticed that XVFB screen doesn't started property and thats causing this error. After we fix XVFB screen, it resolved the issue.
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in--no-sandbox
.
– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
add a comment |
up vote
1
down vote
I had the same issue, but in my case chrome previously was installed in user temp folder, after that was reinstalled to Program files. So any of solution provided here was not help me. But if provide path to chrome.exe all works:
chromeOptions.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
I hope this helps someone =)
add a comment |
up vote
1
down vote
It seems there are many possible causes for this error. In our case, the error happened because we had the following two lines in code:
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
chromeOptions.setBinary(chromeDriverPath);
It's solved by removing the second line.
add a comment |
up vote
0
down vote
No solution worked for my. But here is a workaround:
maxcounter=5
for counter in range(maxcounter):
try:
driver = webdriver.Chrome(chrome_options=options,
service_log_path=logfile,
service_args=["--verbose", "--log-path=%s" % logfile])
break
except WebDriverException as e:
print("RETRYING INITIALIZATION OF WEBDRIVER! Error: %s" % str(e))
time.sleep(10)
if counter==maxcounter-1:
raise WebDriverException("Maximum number of selenium-firefox-webdriver-retries exceeded.")
add a comment |
up vote
0
down vote
In my case it happened when I've tried to use my default user profile:
...
options.addArguments("user-data-dir=D:\MyHomeDirectory\Google\Chrome\User Data");
...
This triggered chrome to reuse processes already running in background, in such a way, that process started by chromedriver.exe was simply ended.
Resolution: kill all chrome.exe processes running in background.
add a comment |
up vote
0
down vote
In my case, I was trying to create a runnable jar on Windows OS with chrome browser and want to run the same on headless mode in unix box with CentOs on it. And I was pointing my binary to a driver that I have downloaded and packaged with my suite. For me, this issue continue to occur irrespective of adding the below:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
options.setBinary("/pointing/downloaded/driver/path/in/automationsuite");
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("window-size=1024,768"); // Bypass OS security model
options.addArguments("--log-level=3"); // set log level
options.addArguments("--silent");//
options.setCapability("chrome.verbose", false); //disable logging
driver = new ChromeDriver(options);
Solution that I've tried and worked for me is, download the chrome and its tools on the host VM/Unix box, install and point the binary to this in the automation suite and bingo! It works :)
Download command:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install command:
sudo yum install -y ./google-chrome-stable_current_*.rpm
Update suite with below binary path of google-chrome:
options.setBinary("/opt/google/chrome/google-chrome");
And.. it works!
add a comment |
up vote
-2
down vote
I solve this problem by installing yum -y install gtk3-devel gtk3-devel-docs
", it works ok
My work env is :
Selenium Version 3.12.0
ChromeDriver Version v2.40
Chrome 68 level
Before:
After:
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
add a comment |
up vote
-2
down vote
Since this is the most active message for this type of error, I wanted to mention my solution (after spending hours to fix this).
On Ubuntu 18.04, using Chrome 70 and Chromedriver 2.44, and Python3 I kept getting the same DevToolsActivePort error, even when I disabled all options listed above. The chromedriver log file as well as ps showed that the chromedriver I set in chrome_options.binary_location was running, but it always gave DevToolsActivePort error. When I removed chrome_options.binary_location='....' and add it to webdriver creation, I get it working fine.
webdriver.Chrome('/path to ... /chromedriver',chrome_options=chrome_options)
Thanks everybody for your comments that make me understand and resolve the issue.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50642308%2forg-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
12 Answers
12
active
oldest
votes
12 Answers
12
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
19
down vote
This error message...
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your code trials and the versioning information of all the binaries would have given us some hint about what's going wrong.
However as per Add --disable-dev-shm-usage to default launch flags seems adding the argument --disable-dev-shm-usage
will temporary solve the issue.
If you desire to initiate/span a new Chrome Browser session you can use the following solution:
System.setProperty("webdriver.chrome.driver", "C:\path\to\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
disable-dev-shm-usage
As per base_switches.cc disable-dev-shm-usage
seems to be valid only on Linux OS:
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The /dev/shm partition is too small in certain VM environments, causing
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
// work-around this issue (a temporary directory will always be used to create
// anonymous shared memory files).
const char kDisableDevShmUsage = "disable-dev-shm-usage";
#endif
In the discussion Add an option to use /tmp instead of /dev/shm David mentions:
I think it would depend on how are /dev/shm and /tmp mounted.
If they are both mounted as tmpfs I'm assuming there won't be any difference.
if for some reason /tmp is not mapped as tmpfs (and I think is mapped as tmpfs by default by systemd), chrome shared memory management always maps files into memory when creating an anonymous shared files, so even in that case shouldn't be much difference. I guess you could force telemetry tests with the flag enabled and see how it goes.
As for why not use by default, it was a pushed back by the shared memory team, I guess it makes sense it should be useing /dev/shm for shared memory by default.
Ultimately all this should be moving to use memfd_create, but I don't think that's going to happen any time soon, since it will require refactoring Chrome memory management significantly.
But what caused this specific error aboutDevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?
– user9315861
Jun 7 at 9:43
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
|
show 1 more comment
up vote
19
down vote
This error message...
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your code trials and the versioning information of all the binaries would have given us some hint about what's going wrong.
However as per Add --disable-dev-shm-usage to default launch flags seems adding the argument --disable-dev-shm-usage
will temporary solve the issue.
If you desire to initiate/span a new Chrome Browser session you can use the following solution:
System.setProperty("webdriver.chrome.driver", "C:\path\to\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
disable-dev-shm-usage
As per base_switches.cc disable-dev-shm-usage
seems to be valid only on Linux OS:
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The /dev/shm partition is too small in certain VM environments, causing
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
// work-around this issue (a temporary directory will always be used to create
// anonymous shared memory files).
const char kDisableDevShmUsage = "disable-dev-shm-usage";
#endif
In the discussion Add an option to use /tmp instead of /dev/shm David mentions:
I think it would depend on how are /dev/shm and /tmp mounted.
If they are both mounted as tmpfs I'm assuming there won't be any difference.
if for some reason /tmp is not mapped as tmpfs (and I think is mapped as tmpfs by default by systemd), chrome shared memory management always maps files into memory when creating an anonymous shared files, so even in that case shouldn't be much difference. I guess you could force telemetry tests with the flag enabled and see how it goes.
As for why not use by default, it was a pushed back by the shared memory team, I guess it makes sense it should be useing /dev/shm for shared memory by default.
Ultimately all this should be moving to use memfd_create, but I don't think that's going to happen any time soon, since it will require refactoring Chrome memory management significantly.
But what caused this specific error aboutDevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?
– user9315861
Jun 7 at 9:43
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
|
show 1 more comment
up vote
19
down vote
up vote
19
down vote
This error message...
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your code trials and the versioning information of all the binaries would have given us some hint about what's going wrong.
However as per Add --disable-dev-shm-usage to default launch flags seems adding the argument --disable-dev-shm-usage
will temporary solve the issue.
If you desire to initiate/span a new Chrome Browser session you can use the following solution:
System.setProperty("webdriver.chrome.driver", "C:\path\to\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
disable-dev-shm-usage
As per base_switches.cc disable-dev-shm-usage
seems to be valid only on Linux OS:
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The /dev/shm partition is too small in certain VM environments, causing
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
// work-around this issue (a temporary directory will always be used to create
// anonymous shared memory files).
const char kDisableDevShmUsage = "disable-dev-shm-usage";
#endif
In the discussion Add an option to use /tmp instead of /dev/shm David mentions:
I think it would depend on how are /dev/shm and /tmp mounted.
If they are both mounted as tmpfs I'm assuming there won't be any difference.
if for some reason /tmp is not mapped as tmpfs (and I think is mapped as tmpfs by default by systemd), chrome shared memory management always maps files into memory when creating an anonymous shared files, so even in that case shouldn't be much difference. I guess you could force telemetry tests with the flag enabled and see how it goes.
As for why not use by default, it was a pushed back by the shared memory team, I guess it makes sense it should be useing /dev/shm for shared memory by default.
Ultimately all this should be moving to use memfd_create, but I don't think that's going to happen any time soon, since it will require refactoring Chrome memory management significantly.
This error message...
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your code trials and the versioning information of all the binaries would have given us some hint about what's going wrong.
However as per Add --disable-dev-shm-usage to default launch flags seems adding the argument --disable-dev-shm-usage
will temporary solve the issue.
If you desire to initiate/span a new Chrome Browser session you can use the following solution:
System.setProperty("webdriver.chrome.driver", "C:\path\to\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
disable-dev-shm-usage
As per base_switches.cc disable-dev-shm-usage
seems to be valid only on Linux OS:
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The /dev/shm partition is too small in certain VM environments, causing
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
// work-around this issue (a temporary directory will always be used to create
// anonymous shared memory files).
const char kDisableDevShmUsage = "disable-dev-shm-usage";
#endif
In the discussion Add an option to use /tmp instead of /dev/shm David mentions:
I think it would depend on how are /dev/shm and /tmp mounted.
If they are both mounted as tmpfs I'm assuming there won't be any difference.
if for some reason /tmp is not mapped as tmpfs (and I think is mapped as tmpfs by default by systemd), chrome shared memory management always maps files into memory when creating an anonymous shared files, so even in that case shouldn't be much difference. I guess you could force telemetry tests with the flag enabled and see how it goes.
As for why not use by default, it was a pushed back by the shared memory team, I guess it makes sense it should be useing /dev/shm for shared memory by default.
Ultimately all this should be moving to use memfd_create, but I don't think that's going to happen any time soon, since it will require refactoring Chrome memory management significantly.
edited Sep 29 at 12:34
danronmoon
2,82542549
2,82542549
answered Jun 1 at 11:57
DebanjanB
37.4k73373
37.4k73373
But what caused this specific error aboutDevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?
– user9315861
Jun 7 at 9:43
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
|
show 1 more comment
But what caused this specific error aboutDevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?
– user9315861
Jun 7 at 9:43
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
But what caused this specific error about
DevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?– user9315861
Jun 7 at 9:43
But what caused this specific error about
DevToolsActivePort file doesn't exist
, and why did it suddenly start popping up?– user9315861
Jun 7 at 9:43
2
2
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
the arbitrary troubleshooting steps mentioned in "Additional Consideration" shouldn't be included in this answer.
– Corey Goldberg
Jun 7 at 14:11
3
3
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
The "Additional Consideration" items - they look like they're quite applicable to this issue. Especially this kind of situation where it hadn't been established exactly what caused the problem.
– Pete Kelley
Jun 11 at 17:01
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
removed "additional considerations"
– Corey Goldberg
Sep 25 at 17:51
2
2
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
From the deleted part of @DebanjanB's post, this can be caused by using a Chromedriver which does not support the version of the installed Chrome. This can happen, for example, if chrome is upgraded without upgrading Chromedriver.
– expz
Nov 29 at 21:12
|
show 1 more comment
up vote
15
down vote
I started seeing this problem on Monday 2018-06-04. Our tests run each weekday. It appears that the only thing that changed was the google-chrome version (which had been updated to current) JVM and Selenium were recent versions on Linux box ( Java 1.8.0_151, selenium 3.12.0, google-chrome 67.0.3396.62, and xvfb-run).
Specifically adding the arguments "--no-sandbox" and "--disable-dev-shm-usage" stopped the error.
I'll look into these issues to find more info about the effect, and other questions as in what triggered google-chrome to update.
ChromeOptions options = new ChromeOptions();
...
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this
– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
add a comment |
up vote
15
down vote
I started seeing this problem on Monday 2018-06-04. Our tests run each weekday. It appears that the only thing that changed was the google-chrome version (which had been updated to current) JVM and Selenium were recent versions on Linux box ( Java 1.8.0_151, selenium 3.12.0, google-chrome 67.0.3396.62, and xvfb-run).
Specifically adding the arguments "--no-sandbox" and "--disable-dev-shm-usage" stopped the error.
I'll look into these issues to find more info about the effect, and other questions as in what triggered google-chrome to update.
ChromeOptions options = new ChromeOptions();
...
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this
– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
add a comment |
up vote
15
down vote
up vote
15
down vote
I started seeing this problem on Monday 2018-06-04. Our tests run each weekday. It appears that the only thing that changed was the google-chrome version (which had been updated to current) JVM and Selenium were recent versions on Linux box ( Java 1.8.0_151, selenium 3.12.0, google-chrome 67.0.3396.62, and xvfb-run).
Specifically adding the arguments "--no-sandbox" and "--disable-dev-shm-usage" stopped the error.
I'll look into these issues to find more info about the effect, and other questions as in what triggered google-chrome to update.
ChromeOptions options = new ChromeOptions();
...
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
I started seeing this problem on Monday 2018-06-04. Our tests run each weekday. It appears that the only thing that changed was the google-chrome version (which had been updated to current) JVM and Selenium were recent versions on Linux box ( Java 1.8.0_151, selenium 3.12.0, google-chrome 67.0.3396.62, and xvfb-run).
Specifically adding the arguments "--no-sandbox" and "--disable-dev-shm-usage" stopped the error.
I'll look into these issues to find more info about the effect, and other questions as in what triggered google-chrome to update.
ChromeOptions options = new ChromeOptions();
...
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
edited Jun 6 at 17:21
answered Jun 6 at 17:08
Pete Kelley
19810
19810
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this
– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
add a comment |
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this
– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
I want to clarify that this code was running each weekday on an Ubuntu Linux box, but equivalent code on Windows desktop ran OK even on Monday. I've found no info about what the functionality of the DevToolsActivePort file is for and that would be useful too. PK
– Pete Kelley
Jun 6 at 17:15
1
1
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
These options stopped the error for me too. pd: using a Rails stack.
– Mario Pérez
Jun 8 at 17:19
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
--no-sandbox was enough for me but I had to put it in first position
– Olivier
Sep 10 at 9:09
I still get
[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this– Jonathan
Sep 14 at 2:28
I still get
[java] [1536892035.965][SEVERE]: Timed out receiving message from renderer: 60.000
errors even with this– Jonathan
Sep 14 at 2:28
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
@Jonathan - Hi! can you supply some more detail, like which OS, which versions of the components you're using, or how you're invoking the process?
– Pete Kelley
Sep 17 at 12:13
add a comment |
up vote
7
down vote
I had the same problem in python. The above helped. Here is what I used in python -
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',chrome_options=chrome_options)
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
add a comment |
up vote
7
down vote
I had the same problem in python. The above helped. Here is what I used in python -
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',chrome_options=chrome_options)
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
add a comment |
up vote
7
down vote
up vote
7
down vote
I had the same problem in python. The above helped. Here is what I used in python -
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',chrome_options=chrome_options)
I had the same problem in python. The above helped. Here is what I used in python -
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',chrome_options=chrome_options)
answered Jun 13 at 1:15
Vinodh Periyasamy
711
711
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
add a comment |
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
I solved my problem with upgrade chrome (I already had the latest chromedrive), hence I had to upgrade the usual browser as well.
– axel_ande
Sep 3 at 11:27
add a comment |
up vote
6
down vote
accepted
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
add a comment |
up vote
6
down vote
accepted
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
edited Jul 10 at 7:09
DebanjanB
37.4k73373
37.4k73373
answered Jun 8 at 15:32
Kumar Sampath
226128
226128
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
add a comment |
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
I'll see if I get the same results. Thanks for sharing your solution!
– Pete Kelley
Jun 12 at 14:44
2
2
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
great. How did you solve it? @PeteKelley
– alansiqueira27
Jun 25 at 18:57
add a comment |
up vote
6
down vote
We were having the same issues on our jenkins slaves (linux machine) and tried all the options above.
The only thing helped is setting the argument
chrome_options.add_argument('--headless')
But when we investigated further, noticed that XVFB screen doesn't started property and thats causing this error. After we fix XVFB screen, it resolved the issue.
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in--no-sandbox
.
– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
add a comment |
up vote
6
down vote
We were having the same issues on our jenkins slaves (linux machine) and tried all the options above.
The only thing helped is setting the argument
chrome_options.add_argument('--headless')
But when we investigated further, noticed that XVFB screen doesn't started property and thats causing this error. After we fix XVFB screen, it resolved the issue.
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in--no-sandbox
.
– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
add a comment |
up vote
6
down vote
up vote
6
down vote
We were having the same issues on our jenkins slaves (linux machine) and tried all the options above.
The only thing helped is setting the argument
chrome_options.add_argument('--headless')
But when we investigated further, noticed that XVFB screen doesn't started property and thats causing this error. After we fix XVFB screen, it resolved the issue.
We were having the same issues on our jenkins slaves (linux machine) and tried all the options above.
The only thing helped is setting the argument
chrome_options.add_argument('--headless')
But when we investigated further, noticed that XVFB screen doesn't started property and thats causing this error. After we fix XVFB screen, it resolved the issue.
edited Sep 6 at 14:43
DebanjanB
37.4k73373
37.4k73373
answered Jul 25 at 4:39
Sreejith Edayillam
611
611
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in--no-sandbox
.
– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
add a comment |
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in--no-sandbox
.
– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
this solved my problem, thanks
– Charles Chow
Aug 5 at 1:35
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
Can you please specify what was wrong with Xvfb?
– grafa
Sep 11 at 10:06
On some linux systems you have also to pass in
--no-sandbox
.– CSchulz
Oct 4 at 9:42
On some linux systems you have also to pass in
--no-sandbox
.– CSchulz
Oct 4 at 9:42
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
this solved my issue, when running using C# (in this case the option looked like this: options.AddArgument("--headless");
– ozz
Dec 3 at 11:30
add a comment |
up vote
1
down vote
I had the same issue, but in my case chrome previously was installed in user temp folder, after that was reinstalled to Program files. So any of solution provided here was not help me. But if provide path to chrome.exe all works:
chromeOptions.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
I hope this helps someone =)
add a comment |
up vote
1
down vote
I had the same issue, but in my case chrome previously was installed in user temp folder, after that was reinstalled to Program files. So any of solution provided here was not help me. But if provide path to chrome.exe all works:
chromeOptions.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
I hope this helps someone =)
add a comment |
up vote
1
down vote
up vote
1
down vote
I had the same issue, but in my case chrome previously was installed in user temp folder, after that was reinstalled to Program files. So any of solution provided here was not help me. But if provide path to chrome.exe all works:
chromeOptions.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
I hope this helps someone =)
I had the same issue, but in my case chrome previously was installed in user temp folder, after that was reinstalled to Program files. So any of solution provided here was not help me. But if provide path to chrome.exe all works:
chromeOptions.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
I hope this helps someone =)
answered Jul 13 at 13:21
Sergiy Konoplyaniy
1917
1917
add a comment |
add a comment |
up vote
1
down vote
It seems there are many possible causes for this error. In our case, the error happened because we had the following two lines in code:
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
chromeOptions.setBinary(chromeDriverPath);
It's solved by removing the second line.
add a comment |
up vote
1
down vote
It seems there are many possible causes for this error. In our case, the error happened because we had the following two lines in code:
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
chromeOptions.setBinary(chromeDriverPath);
It's solved by removing the second line.
add a comment |
up vote
1
down vote
up vote
1
down vote
It seems there are many possible causes for this error. In our case, the error happened because we had the following two lines in code:
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
chromeOptions.setBinary(chromeDriverPath);
It's solved by removing the second line.
It seems there are many possible causes for this error. In our case, the error happened because we had the following two lines in code:
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
chromeOptions.setBinary(chromeDriverPath);
It's solved by removing the second line.
answered Dec 3 at 23:45
shiuu
185
185
add a comment |
add a comment |
up vote
0
down vote
No solution worked for my. But here is a workaround:
maxcounter=5
for counter in range(maxcounter):
try:
driver = webdriver.Chrome(chrome_options=options,
service_log_path=logfile,
service_args=["--verbose", "--log-path=%s" % logfile])
break
except WebDriverException as e:
print("RETRYING INITIALIZATION OF WEBDRIVER! Error: %s" % str(e))
time.sleep(10)
if counter==maxcounter-1:
raise WebDriverException("Maximum number of selenium-firefox-webdriver-retries exceeded.")
add a comment |
up vote
0
down vote
No solution worked for my. But here is a workaround:
maxcounter=5
for counter in range(maxcounter):
try:
driver = webdriver.Chrome(chrome_options=options,
service_log_path=logfile,
service_args=["--verbose", "--log-path=%s" % logfile])
break
except WebDriverException as e:
print("RETRYING INITIALIZATION OF WEBDRIVER! Error: %s" % str(e))
time.sleep(10)
if counter==maxcounter-1:
raise WebDriverException("Maximum number of selenium-firefox-webdriver-retries exceeded.")
add a comment |
up vote
0
down vote
up vote
0
down vote
No solution worked for my. But here is a workaround:
maxcounter=5
for counter in range(maxcounter):
try:
driver = webdriver.Chrome(chrome_options=options,
service_log_path=logfile,
service_args=["--verbose", "--log-path=%s" % logfile])
break
except WebDriverException as e:
print("RETRYING INITIALIZATION OF WEBDRIVER! Error: %s" % str(e))
time.sleep(10)
if counter==maxcounter-1:
raise WebDriverException("Maximum number of selenium-firefox-webdriver-retries exceeded.")
No solution worked for my. But here is a workaround:
maxcounter=5
for counter in range(maxcounter):
try:
driver = webdriver.Chrome(chrome_options=options,
service_log_path=logfile,
service_args=["--verbose", "--log-path=%s" % logfile])
break
except WebDriverException as e:
print("RETRYING INITIALIZATION OF WEBDRIVER! Error: %s" % str(e))
time.sleep(10)
if counter==maxcounter-1:
raise WebDriverException("Maximum number of selenium-firefox-webdriver-retries exceeded.")
answered Oct 30 at 8:19
Alex
13.6k36122244
13.6k36122244
add a comment |
add a comment |
up vote
0
down vote
In my case it happened when I've tried to use my default user profile:
...
options.addArguments("user-data-dir=D:\MyHomeDirectory\Google\Chrome\User Data");
...
This triggered chrome to reuse processes already running in background, in such a way, that process started by chromedriver.exe was simply ended.
Resolution: kill all chrome.exe processes running in background.
add a comment |
up vote
0
down vote
In my case it happened when I've tried to use my default user profile:
...
options.addArguments("user-data-dir=D:\MyHomeDirectory\Google\Chrome\User Data");
...
This triggered chrome to reuse processes already running in background, in such a way, that process started by chromedriver.exe was simply ended.
Resolution: kill all chrome.exe processes running in background.
add a comment |
up vote
0
down vote
up vote
0
down vote
In my case it happened when I've tried to use my default user profile:
...
options.addArguments("user-data-dir=D:\MyHomeDirectory\Google\Chrome\User Data");
...
This triggered chrome to reuse processes already running in background, in such a way, that process started by chromedriver.exe was simply ended.
Resolution: kill all chrome.exe processes running in background.
In my case it happened when I've tried to use my default user profile:
...
options.addArguments("user-data-dir=D:\MyHomeDirectory\Google\Chrome\User Data");
...
This triggered chrome to reuse processes already running in background, in such a way, that process started by chromedriver.exe was simply ended.
Resolution: kill all chrome.exe processes running in background.
answered Nov 15 at 13:21
radzimir
834
834
add a comment |
add a comment |
up vote
0
down vote
In my case, I was trying to create a runnable jar on Windows OS with chrome browser and want to run the same on headless mode in unix box with CentOs on it. And I was pointing my binary to a driver that I have downloaded and packaged with my suite. For me, this issue continue to occur irrespective of adding the below:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
options.setBinary("/pointing/downloaded/driver/path/in/automationsuite");
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("window-size=1024,768"); // Bypass OS security model
options.addArguments("--log-level=3"); // set log level
options.addArguments("--silent");//
options.setCapability("chrome.verbose", false); //disable logging
driver = new ChromeDriver(options);
Solution that I've tried and worked for me is, download the chrome and its tools on the host VM/Unix box, install and point the binary to this in the automation suite and bingo! It works :)
Download command:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install command:
sudo yum install -y ./google-chrome-stable_current_*.rpm
Update suite with below binary path of google-chrome:
options.setBinary("/opt/google/chrome/google-chrome");
And.. it works!
add a comment |
up vote
0
down vote
In my case, I was trying to create a runnable jar on Windows OS with chrome browser and want to run the same on headless mode in unix box with CentOs on it. And I was pointing my binary to a driver that I have downloaded and packaged with my suite. For me, this issue continue to occur irrespective of adding the below:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
options.setBinary("/pointing/downloaded/driver/path/in/automationsuite");
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("window-size=1024,768"); // Bypass OS security model
options.addArguments("--log-level=3"); // set log level
options.addArguments("--silent");//
options.setCapability("chrome.verbose", false); //disable logging
driver = new ChromeDriver(options);
Solution that I've tried and worked for me is, download the chrome and its tools on the host VM/Unix box, install and point the binary to this in the automation suite and bingo! It works :)
Download command:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install command:
sudo yum install -y ./google-chrome-stable_current_*.rpm
Update suite with below binary path of google-chrome:
options.setBinary("/opt/google/chrome/google-chrome");
And.. it works!
add a comment |
up vote
0
down vote
up vote
0
down vote
In my case, I was trying to create a runnable jar on Windows OS with chrome browser and want to run the same on headless mode in unix box with CentOs on it. And I was pointing my binary to a driver that I have downloaded and packaged with my suite. For me, this issue continue to occur irrespective of adding the below:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
options.setBinary("/pointing/downloaded/driver/path/in/automationsuite");
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("window-size=1024,768"); // Bypass OS security model
options.addArguments("--log-level=3"); // set log level
options.addArguments("--silent");//
options.setCapability("chrome.verbose", false); //disable logging
driver = new ChromeDriver(options);
Solution that I've tried and worked for me is, download the chrome and its tools on the host VM/Unix box, install and point the binary to this in the automation suite and bingo! It works :)
Download command:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install command:
sudo yum install -y ./google-chrome-stable_current_*.rpm
Update suite with below binary path of google-chrome:
options.setBinary("/opt/google/chrome/google-chrome");
And.. it works!
In my case, I was trying to create a runnable jar on Windows OS with chrome browser and want to run the same on headless mode in unix box with CentOs on it. And I was pointing my binary to a driver that I have downloaded and packaged with my suite. For me, this issue continue to occur irrespective of adding the below:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
options.setBinary("/pointing/downloaded/driver/path/in/automationsuite");
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("window-size=1024,768"); // Bypass OS security model
options.addArguments("--log-level=3"); // set log level
options.addArguments("--silent");//
options.setCapability("chrome.verbose", false); //disable logging
driver = new ChromeDriver(options);
Solution that I've tried and worked for me is, download the chrome and its tools on the host VM/Unix box, install and point the binary to this in the automation suite and bingo! It works :)
Download command:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install command:
sudo yum install -y ./google-chrome-stable_current_*.rpm
Update suite with below binary path of google-chrome:
options.setBinary("/opt/google/chrome/google-chrome");
And.. it works!
answered Nov 19 at 7:04
parvez basha
1
1
add a comment |
add a comment |
up vote
-2
down vote
I solve this problem by installing yum -y install gtk3-devel gtk3-devel-docs
", it works ok
My work env is :
Selenium Version 3.12.0
ChromeDriver Version v2.40
Chrome 68 level
Before:
After:
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
add a comment |
up vote
-2
down vote
I solve this problem by installing yum -y install gtk3-devel gtk3-devel-docs
", it works ok
My work env is :
Selenium Version 3.12.0
ChromeDriver Version v2.40
Chrome 68 level
Before:
After:
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
add a comment |
up vote
-2
down vote
up vote
-2
down vote
I solve this problem by installing yum -y install gtk3-devel gtk3-devel-docs
", it works ok
My work env is :
Selenium Version 3.12.0
ChromeDriver Version v2.40
Chrome 68 level
Before:
After:
I solve this problem by installing yum -y install gtk3-devel gtk3-devel-docs
", it works ok
My work env is :
Selenium Version 3.12.0
ChromeDriver Version v2.40
Chrome 68 level
Before:
After:
edited Jul 30 at 7:54
JustBaron
2,01961728
2,01961728
answered Jul 30 at 6:43
何贤勇
52
52
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
add a comment |
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
8
8
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
From Review: Please don't post text in images. EDIT your answer and replace those images with text. Thanks
– sɐunıɔןɐqɐp
Jul 30 at 7:15
1
1
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
Does this solve the problem for anyone? This didn't solve the problem for me
– Bendram
Aug 31 at 13:25
add a comment |
up vote
-2
down vote
Since this is the most active message for this type of error, I wanted to mention my solution (after spending hours to fix this).
On Ubuntu 18.04, using Chrome 70 and Chromedriver 2.44, and Python3 I kept getting the same DevToolsActivePort error, even when I disabled all options listed above. The chromedriver log file as well as ps showed that the chromedriver I set in chrome_options.binary_location was running, but it always gave DevToolsActivePort error. When I removed chrome_options.binary_location='....' and add it to webdriver creation, I get it working fine.
webdriver.Chrome('/path to ... /chromedriver',chrome_options=chrome_options)
Thanks everybody for your comments that make me understand and resolve the issue.
add a comment |
up vote
-2
down vote
Since this is the most active message for this type of error, I wanted to mention my solution (after spending hours to fix this).
On Ubuntu 18.04, using Chrome 70 and Chromedriver 2.44, and Python3 I kept getting the same DevToolsActivePort error, even when I disabled all options listed above. The chromedriver log file as well as ps showed that the chromedriver I set in chrome_options.binary_location was running, but it always gave DevToolsActivePort error. When I removed chrome_options.binary_location='....' and add it to webdriver creation, I get it working fine.
webdriver.Chrome('/path to ... /chromedriver',chrome_options=chrome_options)
Thanks everybody for your comments that make me understand and resolve the issue.
add a comment |
up vote
-2
down vote
up vote
-2
down vote
Since this is the most active message for this type of error, I wanted to mention my solution (after spending hours to fix this).
On Ubuntu 18.04, using Chrome 70 and Chromedriver 2.44, and Python3 I kept getting the same DevToolsActivePort error, even when I disabled all options listed above. The chromedriver log file as well as ps showed that the chromedriver I set in chrome_options.binary_location was running, but it always gave DevToolsActivePort error. When I removed chrome_options.binary_location='....' and add it to webdriver creation, I get it working fine.
webdriver.Chrome('/path to ... /chromedriver',chrome_options=chrome_options)
Thanks everybody for your comments that make me understand and resolve the issue.
Since this is the most active message for this type of error, I wanted to mention my solution (after spending hours to fix this).
On Ubuntu 18.04, using Chrome 70 and Chromedriver 2.44, and Python3 I kept getting the same DevToolsActivePort error, even when I disabled all options listed above. The chromedriver log file as well as ps showed that the chromedriver I set in chrome_options.binary_location was running, but it always gave DevToolsActivePort error. When I removed chrome_options.binary_location='....' and add it to webdriver creation, I get it working fine.
webdriver.Chrome('/path to ... /chromedriver',chrome_options=chrome_options)
Thanks everybody for your comments that make me understand and resolve the issue.
answered Nov 27 at 22:48
Obrc
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50642308%2forg-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you update the question with the code that is causing this error?
– GPT14
Jun 1 at 11:27
Have the same error. This is the most unstable framework I've ever used.
– IKo
Jul 2 at 19:12
There is a reported issue already. github.com/SeleniumHQ/selenium/issues/6077.
– user3595231
Jul 4 at 1:11
I received this error when vncserver crashed and I had no X display anymore
– xtian
Aug 21 at 15:10