-
Notifications
You must be signed in to change notification settings - Fork 3
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
DevToolsActivePort file doesn't exist. #46
Comments
Don't think it's has a heroku issue. Had a similar issue with docker container as well. Here is my fix that worked in docker - ` ` |
I wrote that error message. It means that ChromeDriver isn't finding the port it needs to talk to Chrome over. That could happen because Chrome crashed or failed to start or because you were using an old version of Chrome. ChromeDriver 2.40 only supports Chrome versions 66.x.x.x to 68.x.x.x. It's also possible that it is failing because you are setting the "remote-debugging-port" argument. Could you try removing that argument? |
We are not using heroku but had the same issue. The advice from @vinodhkps helped. We already used "--headless" but after adding the other arguments it didn't fail anymore. |
We had this same issue even though we had all the necessary arguments for running Chrome. It was working and then suddenly it stopped working. Turns out that we were still on the It looks like the I've raised the following issue as a way to have more control over versioning: #48 |
have a docker image that opens chrome via python-> selenium -> chromedriver as soon i run 51 docker containers through my vpn container i get
How to Solve this issue, and why does this error accour? |
I also have this issue running on Chromedriver 2.40, Google Chrome 67, Ubuntu 16.04 w/ selenium python |
Hi everyone! This error usually means that the Chrome binary that you passed in failed to start. If you can get a chromedriver.log file (instructions: http://chromedriver.chromium.org/logging ) and find where it prints "Launching Chrome" or something like that, then you can take that commandline and paste it into this bug. You can also try running that commandline locally and see if it successfully starts Chrome. |
Ran my script after enabling logs. Below are my logs. @CalebRouleau [1532599807.795][INFO]: Launching chrome: /var/tmp/qa_automation/chromedriver --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-extensions-except=/tmp/.org.chromium.Chromium.6muhD4/internal --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --headless --ignore-certificate-errors --log-level=0 --metrics-recording-only --no-first-run --no-sandbox --password-store=basic --remote-debugging-port=0 --start-maximized --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.org.chromium.Chromium.VkT4E5 data:, |
Hello everyone. I'm also having the same issue on the Selenium Grid Chrome node container I've made using Docker. The containers I've made both for the node and the hub use windowsservercore as its base image. Here's the Dockerfile contents for both of them if you want to take a look: Windows Selenium Hub: https://hub.docker.com/r/nehirgokce/windows-selenium-hub/ FROM microsoft/windowsservercore RUN powershell (new-object System.Net.WebClient).Downloadfile('http://javadl.oracle.com/webapps/download/AutoDL?BundleId=234443_96a7b8442fe848ef90c96a2fad6ed6d1', 'C:\JavaSetup8u181.exe') Windows Selenium Chrome Node FROM microsoft/windowsservercore RUN powershell (new-object System.Net.WebClient).Downloadfile('http://javadl.oracle.com/webapps/download/AutoDL?BundleId=234443_96a7b8442fe848ef90c96a2fad6ed6d1', 'C:\JavaSetup8u181.exe') Finally, here's the error message I receive org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed The chrome version installed on my node container is v68. Also, I've already tried adding the following arguements onto my chrome options: |
Same thing happens to me. For the first several scheduled tasks work, but after a few hours it fails with the same message. |
@nehirgokce Have you found out what was the problem? |
@DimitryRd Apparently, the windowsservercore image does not support GUI applications, Google Chrome included. --headless option does not seem to work as well, eventhough GUI support is the problem. So the team I'm working with provided a VM for me in order to build and create the chrome nodes. The automation within the browser/s (based on your max session preference) is also run in this VM. |
My problem was that using fakedisplay pyvirtualdisplay xfvc has a maximum client, if the maximum client is achieved it won't create any chrome instances anymore, so this error gets thrown. So this error gets not only thrown like the exception explains that a port was not possible to find, it also get thrown if it can't create a instance session because of displaying issues in any way |
chrome_options.add_argument('--headless') option alone (see above) seems to fix the issue in chrome68/chromedriver 2.41 pair on a ubuntu without gui. |
from selenium import webdriver chrome_options = webdriver.ChromeOptions() browser = webdriver.Chrome(chrome_options=chrome_options) |
c.f. ttps://github.com/heroku/heroku-buildpack-google-chrome/issues/46#issuecomment-416828268
c.f. ttps://github.com/heroku/heroku-buildpack-google-chrome/issues/46#issuecomment-416828268
Doesn't work for me |
I used
and it worked, I havent used option for driver and before run above code better to add to requirements.txt |
I have the same issue and I created a workaround:
|
Throwing my 2 cents in: I tried most of the suggestions here, none of them worked. What worked was changing from Chromium to Chrome. Both are version 70, with chromedriver 2.44. I got this same error, "DevToolsActivePort file doesn't exist", as well as something like "Failed to connect to chrome" in my debug log (sorry, accidentally wiped my log file after it worked.) |
@eduardostalinho have you tried deleting the GOOGLE_CHROME_BIN heroku variable since the google chrome heroku buildpack already creates one? I just fixed this same issue with a Selenium python app I am deploying to heroku reference: https://github.com/heroku/heroku-buildpack-google-chrome#selenium |
…olved my 'Chrome cannot launch on Heroku' problem
I faced a similar issue while running my automation test inside a docker container. Addition information in my situation is: |
interesting documentation, xywang68, thank you. |
it is now in version 2.4* with chrome 70 that from a ubuntu on which a gui interface has ben installed (gnome):
|
when deploying your code to heroku did you still have to use the pyvirtualdisplay library or any similar ones to create a virtual display for the code or where they any other implementations you used to pass that area |
I'm having similar issues and my verbose log includes the following
Running Windows, ChromeDriver 2.45, Chrome 70.x and selenium-server 3.14.0. 😭 |
On MacOS I noticed that I get this error when I try to run selenium when the browser is already opened. Two ways of fixing that :
|
@sliwinski-milosz, Selenium already added contextmanager support to webdriver, a good way to avoid lingering instances eating out your memory is to use it, like so:
And in the case you're trying to speed up your tests with parallelization, go for a grid instead of standalone (or local), a really nice tutorial about all of these: https://github.com/SeleniumHQ/docker-selenium. |
Ran it as root in my case and the issue was that my terminal session was root and executing as root, but the desktop session was for my own non sudo user. I ran it as my own server user nonroot and it worked just fine. |
I get the same issue when trying to run my {selenium, testng & java) scripts in Linux machine (It works without any issue in Windows machine). Exception I was able to get pass through it by adding "headless" option to the Chrome driver. But, wondering if there is any other way to resolve it without adding "headless" option Workaround |
@learncodetest I think this is the same issue that @saltypatrick commented before, being root while running the tests, if you don't start a new process for the rendering (xvfb, GTK or anyother you might be using for display) you'll be just fine (like the headless option you're currently doing). There are several ways to address that problem, one is to create a non-root user and test with it (which I personally consider the best option since you're running in a limited and controlled environment), other is to add the executing process (python for example) to wheel group, another is to start the rendering/display process with root, which can be done using the --privileged option for docker (I personally discourage this, I considered it to be risky). |
thank you |
Hi |
I am having this problem with heroku-18 using webdrivers. The shim seems like it is adding the required arguments:
Here's what our setup looks like: require 'webdrivers'
chrome_shim = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
chrome_bin = ENV.fetch('GOOGLE_CHROME_BIN', nil)
Selenium::WebDriver::Chrome.path = chrome_bin if chrome_bin
chrome_args = { args: %w[window-size=1280,1024] }
selenium_options = Selenium::WebDriver::Chrome::Options.new(chrome_args)
selenium_options.binary = chrome_shim if chrome_shim
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome, options: selenium_options
)
end
Capybara.javascript_driver = :chrome We did have to specify the Still, when running my tests, we're seeing
|
Hi, facing this issue and @eespitiarea solution did work for me, using Edit: why 9222 though? where is this documented? |
Can be any port actually, as long as you specify this while launching the binary, 9222 is the default. Found it digging Chromedriver's project: https://chromedevtools.github.io/devtools-protocol. |
Facing the sample issue @
@vinodhkps I'm facing the same issue. I have a project running in docker container where ; driver = webdriver.Chrome(executable_path=root + '/drivers/chromedriver', options=options) So how to and what to set as executable PATH |
@as3379 - sorry for the delayed response, I had chrome driver installed in this location -
|
it works for me,but '--headless' means chrome will not open, dose have any way to solve it |
|
* Init for API project for fetching data from Quora. * Added project scoped maven build tools. * Refactoring of infinite scroller to be more efficient, added limit support to the API interface, * Refactored driver to a factory component. * Refactored small cleanup of data classes and removed extra spacing. * Added happy path test for service. Extracted cache setup to Spring configuration stage. * Added support for handling multiple requests concurrently (using blocking queue implementation). * Added configuration support for web driver and minor renames and documentation. * Refactor to the client pool to simplify the consumer interface. * Added first pass of testing service layer. * Refactor to align domain and model package layout, included openapi UI within API. * Added configuration to tune headless mode. * Added contact email configuration as required by Quora TOS. * Added client shutdown support and base test to verify the API is returning a response. * Updated readme and added heroku deployment properties. * Added spring configuration to produce a fat jar for deployment. * Added web deployment configuration for Heroku. * Added additional chrome driver options to prevent crashes when running inside a dymo/container. * Added additional chrome driver options for binary location override as documented in chrome build pack. * Removed disable sim command as buildpack should take care of this now. * Workaround for chrome issue in Heroku using extra build config until fix applied for - heroku/heroku-buildpack-google-chrome#46 * Added tests to verify API endpoint. Renamed loader artifact to follow standard maven conventions. * Added heroku app.json for quick deployment. * Refactored client library as a new component & updated readme with details of the different sub components. * Minor tweak to readme to update Functions text. * Minor tweak to readme to update testing text case. * Updated to 1.8.0 application version.
I have had these arguments specified in my script for a while without issue. Needed to update Chrome Driver to version 93 recently as the script decided to stop working. This is when I started encountering this error. As others have mentioned adding in the following argument completely fixed my issue.
|
thanks, am run it stop in i delete
its working |
For me, the problem that was causing this error was that Selenium was not picking up the Chrome that had been installed by heroku-buildpack-google-chrome, and so it installed a new copy (which wasn't adapted to work on Heroku). The instructions given at https://github.com/heroku/heroku-buildpack-google-chrome#selenium therefore were not having the desired effect. I think this may be to do with recent changes to the selenium-webdriver Ruby gem (I updated to 4.12 because of titusfortner/webdrivers#247). Selenium logs:
I eventually discovered I could force Selenium to pick up the correct Chrome by passing in the SHIM environment variable as the chrome_shim = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
Capybara.register_driver :chrome_headless do |app|
options = if ENV['GOOGLE_CHROME_SHIM'].present?
::Selenium::WebDriver::Chrome::Options.new(binary: chrome_shim)
else
::Selenium::WebDriver::Chrome::Options.new
end
options.add_argument('--headless')
options.add_argument('--window-size=1920,1080')
Capybara::Selenium::Driver.new(app, browser: :chrome, options:)
end
Capybara.default_driver = :chrome_headless
Capybara.javascript_driver = :chrome_headless I've submitted a PR that updates the README Selenium example. |
I`m trying to run selenium with chromedriver (with python) on heroku and I'm getting this error:
I added the builpack for chromedriver (https://github.com/heroku/heroku-buildpack-chromedriver) and added the following config keys:
I've tried locally and in heroku (with a builpack fork) without the
--remote-debugging option=9222
. It worked locally, but it didn't work on heroku.Can I get some help here?
The text was updated successfully, but these errors were encountered: