Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: DevToolsActivePort file doesn't exist #12841

Closed
lpcoutinho opened this issue Sep 29, 2023 · 3 comments
Closed

[🐛 Bug]: DevToolsActivePort file doesn't exist #12841

lpcoutinho opened this issue Sep 29, 2023 · 3 comments

Comments

@lpcoutinho
Copy link

What happened?

Hey everyone!!! Can someone help me?

I use Selenium 4.13.0, Ubuntu 22.04.2 and Chrome 117.0.5938.132

When trying to run the script with the Chrome screen open, I notice that the script breaks and I can't even access the desired page. This does not occur when I use the "--headless" argument. The output logs are displayed below.

I noticed that when I run the browser in the background with the "--headless" argument everything happens normally and the screen is printed at the end.

I researched a lot before asking here, I don't know if this is the right place for this, but can anyone help?

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-extensions")

options.add_argument(r"--user-data-dir=/home/luiz/.config/google-chrome/")
options.add_argument(r'--profile-directory=Default')

driver = webdriver.Chrome(options=options)

url="https://www.google.com"
driver.get(url)
driver.save_screenshot('img.png')

Relevant log output

Traceback (most recent call last):
  File "/home/luiz/projects/scrap/scrap.py", line 17, in <module>
    driver = webdriver.Chrome(options=options)
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 56, in __init__
    super().__init__(
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 205, in __init__
    self.start_session(capabilities)
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 289, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 344, in execute
    self.error_handler.check_response(response)
  File "/home/luiz/projects/scrap/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x562f745d26b3 <unknown>
#1 0x562f742a81e7 <unknown>
#2 0x562f742db526 <unknown>
#3 0x562f742d769c <unknown>
#4 0x562f7431a23a <unknown>
#5 0x562f74310e93 <unknown>
#6 0x562f742e3934 <unknown>
#7 0x562f742e471e <unknown>
#8 0x562f74597cb8 <unknown>
#9 0x562f7459bbf0 <unknown>
#10 0x562f745a619c <unknown>
#11 0x562f7459c808 <unknown>
#12 0x562f7456927f <unknown>
#13 0x562f745c0e88 <unknown>
#14 0x562f745c1059 <unknown>
#15 0x562f745d1843 <unknown>
#16 0x7f8c8b294b43 <unknown>

Operating System

Ubuntu 22.04.2

Selenium version

4.13.0

What are the browser(s) and version(s) where you see this issue?

Chrome 117.0.5938.132

What are the browser driver(s) and version(s) where you see this issue?

Chrome 117.0.5938.132

Are you using Selenium Grid?

No response

@github-actions
Copy link

@lpcoutinho, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

Aha, there is a recommended fix now:

https://bugs.chromium.org/p/chromedriver/issues/detail?id=4403#c35

Copy link

github-actions bot commented Dec 4, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2023
@titusfortner titusfortner changed the title [🐛 Bug]: [🐛 Bug]: DevToolsActivePort file doesn't exist Dec 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants