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
Chromium/Chrome does not work in an OpenVZ container #938
Comments
@gildegoma Thanks for opening this.
Googling for it, I found this chromium issue, marked as won't fix --> http://code.google.com/p/chromium/issues/detail?id=31077 Apparently, the partition where /opt lives should be mounted without an option called Hope this helps |
I'm placing a 20 bucks bounty for this issue on FreedomSponsors. If there's anyone out there who's suffering from this as well, please feel free to chip in :-) |
ping @joshk |
All travis boxes are now 64-bit and |
I verified: this problem is still present (issue renamed) and sounds very hard to fix. |
Thanks for verifying. Looking forward to see my tests running again :-) |
According to chromium bug reports above, Chrome does not support OpenVZ integration. @joshk could you double check with bluebox support, if no 🌟 magical workaround exists (very little hope, but who knows...) |
I will check with BlueBox about this. |
At the moment, the best workaround consists in running the client tests from SauceLabs. See:
(or use other Selenium Drivers, like WebDriver or Firefox) |
From looking at the bug linked above I found;
Working if --no-sandbox might allow chrome to run? |
Yeap, that seems to work for me!
|
Oh, you also need to fix the permissions of /dev/shm
|
@mithro, I tried using this workaround, but still no luck.
Any idea what I might be doing wrong? |
Not sure, but we are using a different chrome driver / chrome version I export CHROME=google-chrome-${VERSION}_current_amd64.deb
wget https://dl.google.com/linux/direct/$CHROME (Version is stable/beta/unstable) chromedriver_url = "
https://chromedriver.googlecode.com/files/chromedriver2_linux64_0.6.zip"
else: |
Is there anything we (Travis) can do to fix this issue? (apart from moving off OpenVZ) On 2/05/2013, at 7:43 AM, Tim Ansell notifications@github.com wrote:
|
Sadly, I can't see anyway that Travis can fix this problem at the moment. It looks like they are trying to fix this limitation in the kernel which On 2 May 2013 21:30, Josh Kalderimis notifications@github.com wrote:
|
Wasn't getting anywhere with the --no-sandbox and misc hacks on linux. Sorted by simply switching to OSX VMs. |
--no-sandbox definitely works because we are using it daily :) Tim On 26 June 2013 00:20, Luis Abreu notifications@github.com wrote:
|
Humm, alright, guess I need to try again :) ( wonder if being on Pro makes any diff ) |
If you are using the latest Chrome unstable you will now get a "Failed to move to new PID namespace: Operation not permitted" error even when running with --no-sandbox (none of the --no-sandbox related flags seem to work any more). I have created a custom version of the sandbox which doesn't fail with this error. You can install it the following way; # If we don't have PID namespace support, download a custom
# chrome-sandbox which works even without it.
if [ -f /opt/google/chrome/chrome-sandbox ]; then
export CHROME_SANDBOX=/opt/google/chrome/chrome-sandbox
else
export CHROME_SANDBOX=$(ls /opt/google/chrome*/chrome-sandbox)
fi
sudo rm -f $CHROME_SANDBOX
sudo wget https://googledrive.com/host/0B5VlNZ_Rvdw6NTJoZDBSVy1ZdkE -O $CHROME_SANDBOX
sudo chown root:root $CHROME_SANDBOX; sudo chmod 4755 $CHROME_SANDBOX
sudo md5sum $CHROME_SANDBOX |
I'm now getting this:
Here's my .travis.yml
|
Even with my custom sandbox binary installed? |
@mithro I wasn't able to install your sandbox binary. Checkout the output here: https://travis-ci.org/jsdevel/webdriver-sync/builds/15840074 I added your script as a |
@mithro I think I've found a smoking gun. My VM doesn't have google chrome, it has chromium! Adding ' - "find / -maxdepth 5"' to my before_install yielded the following:
No sign of google-chrome anywhere. This is a problem for ChromeDriver, as it expects to find the binary at I'm going to investigate creating a symlink that points to chromium, and / or removing chromium and installing google-chrome before_install. |
@mithro I was finally able to get chrome to load, but it sure isn't elegant. Using your and others suggestions in this thread, my .travis.yml file now looks like this: language: node_js
node_js:
- "0.10"
before_install:
- "sudo apt-get remove chromium-browser"
- "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections"
- "sudo apt-get install ttf-mscorefonts-installer"
- "sudo apt-get install x-ttcidfont-conf"
- "sudo mkfontdir"
- "sudo apt-get install defoma libgl1-mesa-dri xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic"
- "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
- "sudo mkdir -p /usr/share/desktop-directories"
- "sudo dpkg -i google-chrome-stable_current_amd64.deb"
- "sudo apt-get install -f"
- "sudo dpkg -i google-chrome-stable_current_amd64.deb"
- "export CHROME_SANDBOX=/opt/google/chrome/chrome-sandbox"
- "sudo rm -f $CHROME_SANDBOX"
- "sudo wget https://googledrive.com/host/0B5VlNZ_Rvdw6NTJoZDBSVy1ZdkE -O $CHROME_SANDBOX"
- "sudo chown root:root $CHROME_SANDBOX; sudo chmod 4755 $CHROME_SANDBOX"
- "sudo md5sum $CHROME_SANDBOX"
- "export DISPLAY=:99.0"
- "Xvfb :99.0 -extension RANDR > /dev/null &"
- "sudo chmod 1777 /dev/shm"
install: "npm install"
cache:
directories:
- node_modules I'm still getting strange error output in my builds, namely:
However, this is more related to fonts than anything. Is there a way to get stuff like this baked into the VMs? |
Ok, without installing chrome, https://travis-ci.org/lookfirst/systemjs-seed/jobs/53600350 uncommented no-sandbox and i get this: https://travis-ci.org/lookfirst/systemjs-seed/jobs/53600788 and uncommenting https://travis-ci.org/lookfirst/systemjs-seed/jobs/53601000 Note that I added https://travis-ci.org/lookfirst/systemjs-seed/jobs/53601000#L99 So, I guess we are back to square one, but with a faster server now. 👍 |
So now that I can't sudo, how do I install stuff with apt? |
@joshk Any more thoughts? |
Not sure right now sorry, Can you please open a new ticket with the information you posted above summerizing the issue and I can escalated this within the team. Thanks :) |
Due to the recent change over to docker by default and the fact that it has an ancient version of chrome, this is what I'm using now...
|
Thanks @lookfirst -- google-chrome (launched via python/selenium/chromedriver) is working for me with your bash script, sudo: required, and the --no-sandbox flag activated. |
@andy11 I found that installing chrome via apt takes an inordinate amount of time because of all the dependencies. The comment above where I just download the .zip file and use that binary works much better. |
Revert "lets try again ChromeDriver" This reverts commit 07557b7.
I am installing chrome driver via grunt and as of this build it had errors with the chrome driver: https://travis-ci.org/dtracers/coursesketch/builds/120990028 |
It seems we are currently trying to run Chrome on Travis. Which is a bit hard (travis-ci/travis-ci#938). Firefox is recommended: https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to -Run-Tests-That-Require-a-GUI But it's still only Firefox. We can keep the chrome work for local tests, but I think Travis should ping Sauce Labs: https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-Sauce-L abs So they can spin up 180 real browsers and test on those.
Hope it helps:
|
This appears to no longer be an issue for the "Trusty Tahr" (e.g. 14.04) release of Ubuntu and onward. If you are able to upgrade to that release in your (I just spoke with some folks on the Chromium team in the #chromium IRC channel on Freenode. Chrome only uses a "setuid sandbox" as a fallback when the kernel does not support more advanced features. It seems likely that Ubuntu 14.04 has the namespace features that allow it to use other technologies--ones that are compatible with the environment provided by TravisCI.) |
* Expand and refactor AccessToken to allow for parsing OAuth requests and authenticating them. * Expand AccessTokenAgent with methods for getting the keys from the Access Token Service, which are required for authentication of OAuth requests. * Add a Protocol utility model for encapsulating common OAuth protocol needs. * Add oauth_parameters to OAuthError * Add explicit parameter checking to AccessToken#from_authorization_header * Add signature_method massage to AccessToken#initialize * Correct some typos and documentation issues * Clean up RuboCop configuration * Add lightweight caching of AccessToken and Key instances in AccessTokenAgent * Remove ruby-2.3 from Trave CI config to match gemspec * Add utility for converting oauth_problem to HTTP Status for service providers * Add more HTTP response helpers to Protocol and misc cleanup * correct rubygems link in README * Set version to 2.0.0.rc1 * Clean up lint * use binstub for rspec in travis config * Update README to use binstubs * Try workaround for Travis CI, per travis-ci/travis-ci#938
Problem initially reported in https://groups.google.com/forum/m/?fromgroups#!topic/travis-ci/YG9j5wN4YeE
See attempts to install chrome browser and test driver on the fly here: https://travis-ci.org/freedomsponsors/www.freedomsponsors.org/builds
As pointed out below, this a well-known integration problem: Chrome cannot be executed in a OpenVZ container/guest, because of suid binaries. Details there:
//cc @tonylampada
The text was updated successfully, but these errors were encountered: