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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: driver location error #13888

Open
Datarambler opened this issue Apr 30, 2024 · 3 comments
Open

[馃悰 Bug]: driver location error #13888

Datarambler opened this issue Apr 30, 2024 · 3 comments
Labels
I-defect I-logging Applied to issues where logging information would help troubleshoot

Comments

@Datarambler
Copy link

What happened?

I have installed selenium 4.20 version on my virtual environment which has python 3.12 running and the VM is running on a Linux server. When I tried to open the Chrome browser with the webdriver, it's unable to find it.
image

Even if I try to specify the path to the chromedriver.exe via the service argument, it says "Permission issue - WebDriverException: Message: 'chromedriver.exe' executable may have wrong permissions.".

How can we reproduce the issue?

import logging
logging.getLogger('selenium')
import os
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")

driver_path = Path.cwd()/'drivers/chromedriver.exe'
print(driver_path)

# service = Service(driver_path)
# driver = webdriver.Chrome(service=service)

driver=webdriver.Chrome()

Relevant log output

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 /data/home/xfmh5ya/.cache/selenium/chrome/linux64/124.0.6367.91/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x560da9601cb3 <unknown>
#1 0x560da92f04a7 <unknown>
#2 0x560da9324a26 <unknown>
#3 0x560da9320980 <unknown>
#4 0x560da93697b0 <unknown>
#5 0x560da935d1b3 <unknown>
#6 0x560da932e24a <unknown>
#7 0x560da932ec1e <unknown>
#8 0x560da95c5fdb <unknown>
#9 0x560da95c9f2b <unknown>
#10 0x560da95b20f1 <unknown>
#11 0x560da95caa92 <unknown>
#12 0x560da9596faf <unknown>
#13 0x560da95f0e08 <unknown>
#14 0x560da95f0fe0 <unknown>
#15 0x560da9600e04 <unknown>
#16 0x7f4f8d574ea5 start_thread

Operating System

Linux

Selenium version

4.20

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

Chrome, Edge

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

Chromedriver

Are you using Selenium Grid?

No

Copy link

@Datarambler, 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!

@diemol diemol added I-logging Applied to issues where logging information would help troubleshoot and removed needs-triaging labels Apr 30, 2024
Copy link

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our
Troubleshooting documentation.

@Carmaiquel
Copy link

I had a similiar issue.

!pip install -U selenium

import logging

logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
!pytest -s -p no:logging

logging.basicConfig(level=logging.WARN)

from selenium import webdriver

driver = webdriver.Chrome()
driver.maximize_window()
url = 'https://www.carrefour.com.ar/almacen'
driver.get(url)

OUTPUT


DEBUG:selenium.webdriver.common.selenium_manager:Selenium Manager binary found at: /home/scaride/.pyenv/versions/taxifare-env/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager
DEBUG:selenium.webdriver.common.selenium_manager:Executing process: /home/scaride/.pyenv/versions/taxifare-env/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --debug --language-binding python --output json
DEBUG:selenium.webdriver.common.selenium_manager:chromedriver not found in PATH
DEBUG:selenium.webdriver.common.selenium_manager:chrome not found in PATH
DEBUG:selenium.webdriver.common.selenium_manager:chrome not found in the system
DEBUG:selenium.webdriver.common.selenium_manager:Required browser: chrome 124.0.6367.155
DEBUG:selenium.webdriver.common.selenium_manager:chrome 124.0.6367.155 already exists
DEBUG:selenium.webdriver.common.selenium_manager:chrome 124.0.6367.155 is available at /home/scaride/.cache/selenium/chrome/linux64/124.0.6367.155/chrome
DEBUG:selenium.webdriver.common.selenium_manager:Required driver: chromedriver 124.0.6367.155
DEBUG:selenium.webdriver.common.selenium_manager:chromedriver 124.0.6367.155 already in the cache
DEBUG:selenium.webdriver.common.selenium_manager:Driver path: /home/scaride/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
DEBUG:selenium.webdriver.common.selenium_manager:Browser path: /home/scaride/.cache/selenium/chrome/linux64/124.0.6367.155/chrome
DEBUG:selenium.webdriver.common.service:Started executable: `/home/scaride/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver` in a child process with pid: 10312 using 0 to output -3
DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:44933/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'chrome', 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'goog:chromeOptions': {'extensions': [], 'binary': '/home/scaride/.cache/selenium/chrome/linux64/124.0.6367.155/chrome', 'args': []}}}}
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=500 | data={"value":{"error":"session not created","message":"session not created: Chrome failed to start: exited normally.\n  (session not created: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location /home/scaride/.cache/selenium/chrome/linux64/124.0.6367.155/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)","stacktrace":"#0 0x556874a34df3 \u003Cunknown>\n#1 0x5568747234e7 \u003Cunknown>\n#2 0x556874757a66 \u003Cunknown>\n#3 0x5568747539c0 \u003Cunknown>\n#4 0x55687479c7f0 \u003Cunknown>\n#5 0x5568747901f3 \u003Cunknown>\n#6 0x55687476128a \u003Cunknown>\n#7 0x556874761c5e \u003Cunknown>\n#8 0x5568749f911b \u003Cunknown>\n#9 0x5568749fd06b \u003Cunknown>\n#10 0x5568749e5231 \u003Cunknown>\n#11 0x5568749fdbd2 \u003Cunknown>\n#12 0x5568749ca0ef \u003Cunknown>\n#13 0x556874a23f48 \u003Cunknown>\n#14 0x556874a24120 \u003Cunknown>\n#15 0x556874a33f44 \u003Cunknown>\n#16 0x7f29e1066609 start_thread\n"}} | headers=HTTPHeaderDict({'Content-Length': '966', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request

MORE

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 /home/scaride/.cache/selenium/chrome/linux64/124.0.6367.155/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x556874a34df3 <unknown>
#1 0x5568747234e7 <unknown>
#2 0x556874757a66 <unknown>
#3 0x5568747539c0 <unknown>
#4 0x55687479c7f0 <unknown>
#5 0x5568747901f3 <unknown>
#6 0x55687476128a <unknown>
#7 0x556874761c5e <unknown>
#8 0x5568749f911b <unknown>
#9 0x5568749fd06b <unknown>
#10 0x5568749e5231 <unknown>
#11 0x5568749fdbd2 <unknown>
#12 0x5568749ca0ef <unknown>
#13 0x556874a23f48 <unknown>
#14 0x556874a24120 <unknown>
#15 0x556874a33f44 <unknown>
#16 0x7f29e1066609 start_thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-defect I-logging Applied to issues where logging information would help troubleshoot
Projects
None yet
Development

No branches or pull requests

3 participants