New issue
Advanced search Search tips

Issue 869855 link

Starred by 2 users

Issue metadata

Status: Closed
Owner: ----
Closed: Oct 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Chromedriver cannot launch Chrome. Error says DevToolsActivePort File doesn't exist

Reported by gurmeet....@uoit.net, Aug 1

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36

Steps to reproduce the problem:
1. Launch Chromedriver
2. Add options
3. Fails

What is the expected behavior?
I had a script running for the past 6 months that would just open a session of chrome and then parse through various websites.

What went wrong?
It seems to be opening other chrome.exe processes and if I cancel those processes selectively it will actually start working again. One of the processes is hanging the script.

Tried numerous option suggestions online but to no avail.

Did this work before? Yes Chromedriver 1.38 Chrome 65

Chrome version: 68.0.3440.84  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
chromeError.JPG
37.9 KB View Download
Labels: Needs-Triage-M68 Needs-Bisect
Cc: viswa.karala@chromium.org
Components: Tests>WebDriver
Labels: Triaged-ET TE-NeedsTriageHelp
Thanks for filing the issue!

As per comment# 0 from the reporter the issue seems to be related to Chromedriver, which is out of scope from TE end, hence adding TE-NeedsTriageHelp label to it for further triaging from Dev team.
Note: Tentatively adding Tests>WebDriver component to it.

Thanks!
Cc: johnchen@chromium.org crouleau@chromium.org khachatryan@chromium.org
Components: -Platform>DevTools
Labels: Needs-Feedback
gurmeet....@uoit.net: Could you please provide the source code that can be used to repro this issue, and/or attach ChromeDriver verbose log (see http://chromedriver.chromium.org/logging for ways to enable verbose logging)? Those information may help us investigate this issue.

You might also try adding --remote-debugging-port=9222 to the Chrome command line to see if it fixes the problem. For example, in Python, you can do something like:
  options.add_argument("--remote-debugging-port=9222")

Thanks!
import selenium.webdriver as webdriver
import selenium.webdriver.support.ui as ui
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException

options = webdriver.ChromeOptions()
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--ignore-certificate-errors")
options.add_argument("--ignore-ssl-errors")
browser = webdriver.Chrome(chromedriver_location, chrome_options=options)


errorMessage.JPG
67.6 KB View Download
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 3

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
Hi, Could you please also attach a verbose chromedriver log?
Putting in the service args makes it crash a lot sooner. Normally it takes at least 30 secs.
Before:
browser = webdriver.Chrome(chromedriver_location, chrome_options=options)
After:
browser = webdriver.Chrome(chromedriver_location, chrome_options=options, service_args=["--verbose", "--log-path=C:\\qc1.log"])


errorMessage.JPG
47.3 KB View Download
Project Member

Comment 9 by sheriffbot@chromium.org, Aug 3

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
That's most likely because ChromeDriver doesn't have permission to write to C:\\qc1.log.
Removing the --log-path argument results in the following error.

errorMessage.JPG
31.7 KB View Download
Can you try writing the log to a different location? One that you have permission to access? Otherwise we can't help you. We need that log file.
Project Member

Comment 13 by sheriffbot@chromium.org, Aug 7

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
Okay I launched as administrator and it is able to write. But the behavior is different. It now opens the browser ... see if there's anything there that could point to a culprit
qc1.log
9.4 KB View Download
Project Member

Comment 16 by sheriffbot@chromium.org, Aug 7

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
The error message shown in comment #11 is benign, and can be ignored. see  issue 848232 .

Everything in the log file attached to comment #15 looks normal.

Please let us know if you're still experiencing any issues. Thanks.
Issue has gone away. Unsure if update had anything to do with it but it seems as though the issue never happened. Will update on this board if I see it again. Or reference this in the future
Status: WontFix (was: Unconfirmed)
Thanks for the update. I'm closing this bug, but please let us know if you encounter any further issues in the future.
Hey I had the issue again. FYI, I have the python script setup to run through VBA scripts on my systems, so I caught this from last night's jobs. Attached the log file
qc1.log
3.2 KB View Download
Status: Unconfirmed (was: WontFix)
It does seem like there's a problem, but I don't have enough information to know what it is.

John, do you think it would make sense for us to print the stdout of the Chrome process to the ChromeDriver log in the event of a startup failure? I think that information would help us debug this type of problem.
gurmeet.sidhu.. could you please run your code with adding Chrome options
"--user-data-dir=<path>" where the path is a directory with full read/write access

Looks like your application doesn't have access to hidden directory at "C:\Users\hzjksd\AppData\Local\Temp\scoped_dir2432_32661"

You can use ProcMon tool and set filter for Chrome and Chromedriver processes to monitor them.

This kind of issues mostly happening on Windows machines where user has restricted access to file system.


Chrome-Logs.zip
1.6 KB Download
Re comment #21: On Linux and Mac, we already redirect stderr from Chrome into the verbose log of ChromeDriver, but this mechanism doesn't appear to work on Windows. Also, we're not currently re-directing stdout.

I agree that it's useful to have more output from Chrome redirected into the log file. We should investigate why the stderr redirection isn't working on Windows, and consider redirect stdout as well.
I'm not too sure how to do that. I will try and investigate myself as well and see if I can get something today
Per Comment #22: I read the ChromeDriver code and I see that if ChromeDriver didn't have permission to create a directory then it would throw an error:

  base::FilePath default_dir =
      user_data_dir.AppendASCII(chrome::kInitialProfile);
  if (!base::CreateDirectory(default_dir))
    return Status(kUnknownError, "cannot create default profile directory");

https://cs.chromium.org/chromium/src/chrome/test/chromedriver/chrome_launcher.cc?l=869

I also traced the code and feel confident that that error would be properly surfaced to the user in that case.

Re comment #25: John is talking about ChromeDriver developer work. We are happy to take external contributions ( http://chromedriver.chromium.org/contributing ), but otherwise there isn't anything you can do from client side: you would need to edit ChromeDriver code.
gurmeet.sidhu... you can get process monitor tool (ProcMon) at https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

Please run it and monitor Chrome process to see if Chrome can write 'DevToolsActivePort' file by the path defined by 'user-data-dir'.

That will help us to investigate the issue.


gurmeet.sidhu... do you have an update for this issue?

I ended up using GeckoDriver as it did not run in to the same issue. And that has allowed me to quickly refract the script and get my reports running
Status: Closed (was: Unconfirmed)
Closing the bug as we're unable to repro this issue. 
Please let us know if you have additional information that can help us to reproduce the issue.

Sign in to add a comment