title: The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed for Selenium
body: <p>I’m running a jupyter notebook on ubuntu server.  I’m trying run the selenium code below using chromedriver.  I’m getting the error below but if I run the line of code below in Ubuntu terminal it returns the output below.  Does anyone know what the issue might be?  I’m still pretty new to ubuntu.</p>
  
  <p>Ubuntu code:</p>
  
  <pre><code>which google-chrome
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>/usr/bin/google-chrome
  </code></pre>
  
  <p>jupyter notebook code:</p>
  
  <pre><code>driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/chromedriver"), chrome_options=chrome_options)
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  WebDriverException                        Traceback (most recent call last)
  &lt;ipython-input-5-bcd3289fe282&gt; in &lt;module&gt;
       16 options.add_argument('headless') #downlod Chrome driver.exe
       17 #driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/stuff/JobHuntCode/chromedriver"), chrome_options=chrome_options)
  ---&gt; 18 driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/chromedriver"), chrome_options=chrome_options)
       19 
       20 
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
       79                     remote_server_addr=self.service.service_url,
       80                     keep_alive=keep_alive),
  ---&gt; 81                 desired_capabilities=desired_capabilities)
       82         except Exception:
       83             self.quit()
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
      155             warnings.warn("Please use FirefoxOptions to set browser profile",
      156                           DeprecationWarning, stacklevel=2)
  --&gt; 157         self.start_session(capabilities, browser_profile)
      158         self._switch_to = SwitchTo(self)
      159         self._mobile = Mobile(self)
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities, browser_profile)
      250         parameters = {"capabilities": w3c_caps,
      251                       "desiredCapabilities": capabilities}
  --&gt; 252         response = self.execute(Command.NEW_SESSION, parameters)
      253         if 'sessionId' not in response:
      254             response = response['value']
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
      319         response = self.command_executor.execute(driver_command, params)
      320         if response:
  --&gt; 321             self.error_handler.check_response(response)
      322             response['value'] = self._unwrap_value(
      323                 response.get('value', None))
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
      240                 alert_text = value['alert'].get('text')
      241             raise exception_class(message, screen, stacktrace, alert_text)
  --&gt; 242         raise exception_class(message, screen, stacktrace)
      243 
      244     def _value_or_default(self, obj, key, default):
  
  WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-46-generic x86_64)
  </code></pre>
  
  <p>Update:</p>
  
  <p>Update:</p>
  
  <p>Ubuntu</p>
  
  <p>code:</p>
  
  <pre><code>google-chrome --version
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>Google Chrome 73.0.3683.103
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  WebDriverException                        Traceback (most recent call last)
  &lt;ipython-input-1-4c82dc01ab87&gt; in &lt;module&gt;
       18 options.add_argument('headless') #downlod Chrome driver.exe
       19 #driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/stuff/JobHuntCode/chromedriver"), chrome_options=chrome_options)
  ---&gt; 20 driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/chromedriver"), chrome_options=chrome_options)
       21 
       22 
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
       79                     remote_server_addr=self.service.service_url,
       80                     keep_alive=keep_alive),
  ---&gt; 81                 desired_capabilities=desired_capabilities)
       82         except Exception:
       83             self.quit()
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
      155             warnings.warn("Please use FirefoxOptions to set browser profile",
      156                           DeprecationWarning, stacklevel=2)
  --&gt; 157         self.start_session(capabilities, browser_profile)
      158         self._switch_to = SwitchTo(self)
      159         self._mobile = Mobile(self)
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities, browser_profile)
      250         parameters = {"capabilities": w3c_caps,
      251                       "desiredCapabilities": capabilities}
  --&gt; 252         response = self.execute(Command.NEW_SESSION, parameters)
      253         if 'sessionId' not in response:
      254             response = response['value']
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
      319         response = self.command_executor.execute(driver_command, params)
      320         if response:
  --&gt; 321             self.error_handler.check_response(response)
      322             response['value'] = self._unwrap_value(
      323                 response.get('value', None))
  
  ~/anaconda3/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
      240                 alert_text = value['alert'].get('text')
      241             raise exception_class(message, screen, stacktrace, alert_text)
  --&gt; 242         raise exception_class(message, screen, stacktrace)
      243 
      244     def _value_or_default(self, obj, key, default):
  
  WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.15.0-46-generic x86_64)
  </code></pre>
  
  <p>UPDATE:</p>
  
  <pre><code>chrome_options.add_argument("no-sandbox")
  chrome_options.add_argument("--disable-extensions")
  chrome_options.add_argument("--headless")
  </code></pre>
  
  <p>For some reason adding the lines above to my code solved the issue.  I found the code in the post below.</p>
  
  <p><a href="https://stackoverflow.com/questions/50790733/unknown-error-devtoolsactiveport-file-doesnt-exist-error-while-executing-selen">unknown error: DevToolsActivePort file doesn&#39;t exist error while executing Selenium UI test cases on ubuntu</a></p>