Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Chromium/Chrome does not work in an OpenVZ container #938
Comments
gildegoma
referenced this issue
in travis-ci/travis-ci.github.com
Feb 16, 2013
Closed
Update and Clean documentation about new "Ubuntu-64bit / OpenVZ / Bluebox" stack #220
tonylampada
commented
Feb 16, 2013
|
@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 |
tonylampada
commented
Feb 21, 2013
|
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. |
tonylampada
commented
Mar 10, 2013
|
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 |
|
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) |
mithro
commented
Apr 13, 2013
|
From looking at the bug linked above I found;
Working if --no-sandbox might allow chrome to run? |
mithro
commented
Apr 13, 2013
|
Yeap, that seems to work for me!
|
mithro
commented
Apr 14, 2013
|
Oh, you also need to fix the permissions of /dev/shm
|
tonylampada
commented
May 2, 2013
|
@mithro, I tried using this workaround, but still no luck.
Any idea what I might be doing wrong? |
mithro
commented
May 2, 2013
|
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:
|
mithro
commented
May 6, 2013
|
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:
|
added a commit
to niklas/cataract
that referenced
this issue
Jun 2, 2013
lmjabreu
commented
Jun 25, 2013
|
Wasn't getting anywhere with the --no-sandbox and misc hacks on linux. Sorted by simply switching to OSX VMs. |
mithro
commented
Jun 26, 2013
|
--no-sandbox definitely works because we are using it daily :) Tim On 26 June 2013 00:20, Luis Abreu notifications@github.com wrote:
|
lmjabreu
commented
Jun 29, 2013
|
Humm, alright, guess I need to try again :) ( wonder if being on Pro makes any diff ) |
jakoch
referenced this issue
in giorgiosironi/phpunit-selenium
Jul 24, 2013
Open
Selenium2TestCase "chrome not reachable" #259
mithro
commented
Dec 5, 2013
|
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 |
jsdevel
commented
Dec 21, 2013
|
I'm now getting this:
Here's my .travis.yml
|
mithro
commented
Dec 22, 2013
|
Even with my custom sandbox binary installed? |
added a commit
to jsdevel/webdriver-sync
that referenced
this issue
Dec 22, 2013
jsdevel
commented
Dec 22, 2013
|
@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 |
jsdevel
commented
Dec 22, 2013
|
@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. |
jsdevel
commented
Dec 23, 2013
|
@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_modulesI'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? |
|
Which of the steps would you like to see baked into the VMs? |
jsdevel
commented
Dec 23, 2013
|
@roidrage I'd personally like to see all of them baked in. It would really help me out, as I'm actively working on webdriver-sync. For me, any user that wishes to test chrome using that module will have to add everything from my .travis.yml above to their project's yml. I wish I could get that last warning about TrueType to go away, but that can wait. |
jsdevel
commented
Dec 23, 2013
|
@roidrage These two lines can probably be ignored from my previous statement: - "export DISPLAY=:99.0"
- "Xvfb :99.0 -extension RANDR > /dev/null &"I think it's acceptable for users to configure that on their own, but I leave it to you. |
|
I think one thing that's worth for us to look into is to use a proper Chrome instead of Chromium and utilize the sandbox script. Unfortunately a change like this isn't that easy to implement, as it's certain to break tests for a lot of people in the process. |
jsdevel
commented
Dec 23, 2013
|
@roidrage Who's using chromium ? :P (only half joking) I guess I can attempt setting the binary location to use chromium. Worth a shot. Maybe a flag could be supported, like: language: node_js
node_js:
- "0.10"
use_chrome: true
before_install:
- "export DISPLAY=:99.0"
- "Xvfb :99.0 -extension RANDR > /dev/null &"
install: "npm install"
cache:
directories:
- node_modulesWith |
mithro
commented
Dec 30, 2013
|
My set up script for Chrome (and Firefox) on Travis can be found at On the Chrome case I should create a PPA with a divert and the custom It would be really nice if their was a browser section part of travis.yml
|
jsdevel
commented
Dec 31, 2013
|
@mithro Thank you for sharing. It would be really nice to make setup like this transparent to users. |
added a commit
to handcooler/hand_cooler
that referenced
this issue
Feb 8, 2014
timthelion
referenced this issue
in subuser-security/subuser
Feb 11, 2014
Closed
Chromium doesn't work #1
pushed a commit
to philnate/textManager
that referenced
this issue
Feb 19, 2014
|
Is this still an active issue? |
roidrage
added
the
awaiting-followup
label
May 6, 2014
|
Hey, we haven't heard back from you, so I'm closing this. If you have any more issues, you can either give us an update here or file a new one. |
roidrage
closed this
May 9, 2014
jsdevel
commented
May 9, 2014
|
Unfortunately I'm fairly certain it isn't at this point. Chrome is a strange beast. What we could do is distill the steps into an addon that people can opt into. |
jsdevel
commented
May 9, 2014
|
@roidrage that would be cool. Anything that would make it easier would be appreciated. Is that something I can do? |
|
Thinking about it some more, it's actually fairly straight-forward. Distilling this into a runnable shell script as a Gist would do the trick. |
|
It could also make sense to remove Chromium from the Travis VM image. |
|
At this point it's hard to guess how many people rely on it to be installed, but a GitHub search could help :) |
roidrage
referenced this issue
May 10, 2014
Closed
Lack of addons docs, therefore, browser problems (chrome and firefox). #2286
jsdevel
commented
May 28, 2014
|
@roidrage for some reason, chromedriver is now unable to luanch on travis builds given my install steps that were working on Apr 25th. Here's the latest from the webdriver-sync build. I'll try and see if it was something that changed on chrome's end. I even tried reverting my changes back to |
mithro
commented
May 29, 2014
|
The Chrome version did change recently (they do a release every 6 weeks). You might need to update your changes so they match what we were doing for Otherwise we might need to rebuild the "broken sandbox" binary. I won't get a chance to look at this further till next week at the earliest.
|
jsdevel
commented
May 29, 2014
|
Thanks for the response @mithro !!!! Is this all related to sandboxing? |
mithro
commented
May 29, 2014
|
The issue with Chrome that I fixed was caused by the sandbox; The Chrome sandbox uses a method which is incompatible with OpenVZ containers (as OpenVZ containers use the same technology to actually sandbox the containers and the technology doesn't support nesting). I'm assuming that you are hitting the issue again but have not looked at your output to confirm. From the web-animation-js .travis-setup.sh -- https://github.com/web-animations/web-animations-js/blob/master/.travis-setup.sh echo "Getting $VERSION of $BROWSER"
export CHROME=google-chrome-${VERSION}_current_amd64.deb
wget https://dl.google.com/linux/direct/$CHROME
sudo dpkg --install $CHROME || sudo apt-get -f install
which google-chrome
ls -l `which google-chrome`
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
# Download a custom chrome-sandbox which works inside OpenVC containers (used on travis).
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
google-chrome --version
;; |
jsdevel
commented
May 29, 2014
|
@mithro is that currently working for you? |
jsdevel
commented
May 29, 2014
|
@mithro I have checked the output, but all I get is "opening chrome crashed." I haven't tried with a verbose flag or anything like that. |
mithro
commented
May 29, 2014
|
Seems too https://travis-ci.org/web-animations/web-animations-js On 29 May 2014 16:44, Joseph Spencer notifications@github.com wrote:
|
jsdevel
commented
May 29, 2014
|
@mithro have you uploaded that to |
mithro
commented
May 29, 2014
|
I keep meaning too but have never gotten around to it. I'd also like to take the sandbox binary and put it inside a deb package with proper diverts so the setup becomes;
Happy to review / comment on a gist if you have the time to create one and test it. |
jsdevel
commented
May 29, 2014
|
@mithro currently I'm doing this in my language: node_js
node_js:
- "0.10"
before_install:
- "wget https://raw.githubusercontent.com/web-animations/web-animations-js/master/.travis-setup.sh"
- "chmod 777 ./.travis-setup.sh"
- "sudo ./.travis-setup.sh"
- "export DISPLAY=:99.0"
- "Xvfb :99.0 -extension RANDR > /dev/null &"
- "WEBDRIVER_SYNC_ENABLE_SELENIUM_STDOUT=true"
- "WEBDRIVER_SYNC_ENABLE_SELENIUM_STDERR=true"
install: "npm install"
cache:
directories:
- node_modulesMy builds are failing though with this: |
mithro
commented
May 29, 2014
|
The part that copies PIL.pth into the virtualenv of .travis-setup.sh isn't needed by you (you get a virtualenv when you set "language: python"). You should skip lines 16 to 22 in your node set up. You will also need to set the BROWSER environment (I believe ARGS is optional), here is an example that we use; env:
matrix:
- BROWSER=Chrome-stable ARGS='-x -b Chrome -u'
- BROWSER=Chrome-beta ARGS='-x -b Chrome -u'
- BROWSER=Chrome-unstable ARGS='-x -b Chrome -u'
- BROWSER=Chrome-unstable ARGS='-x -b Chrome -u --flag=--enable-experimental-web-platform-features'
- BROWSER=Firefox-stable ARGS='-x -b Firefox -u'
- BROWSER=Firefox-beta ARGS='-x -b Firefox -u'
- BROWSER=Firefox-aurora ARGS='-x -b Firefox -u'
- BROWSER=Remote ARGS='--verbose -b Remote --sauce --remote-caps=INTERNETEXPLORER --remote-caps=version=10 --remote-caps=platform="Windows 8"'
- BROWSER=Remote ARGS='--verbose -b Remote --sauce --remote-caps=SAFARI --remote-caps=version=6 --remote-caps=platform="OS X 10.8"'
- BROWSER=Remote ARGS='--verbose -b Remote --sauce --remote-caps=IPHONE --remote-caps=version=6 --remote-caps=platform="OS X 10.8"'
- BROWSER=Remote ARGS='--verbose -b Remote --sauce --remote-caps=ANDROID --remote-caps=version=4.0 --remote-caps=platform=Linux' |
jsdevel
commented
May 29, 2014
|
Thanks @mithro. I'm a bit confused by "You should skip lines 16 to 22 in your node set up." Can you provide me a link? What does |
jsdevel
commented
May 30, 2014
|
@mithro sorry for my confusion. I see now that you meant 16 to 22 in your setup script. I had no idea about
I found out it was the way I was invoking |
added a commit
to balthazar/ng-markdown
that referenced
this issue
Jun 29, 2014
added a commit
to codecentric/zucchini
that referenced
this issue
Jul 22, 2014
added a commit
to bocoup/todomvc-vanillajs
that referenced
this issue
Aug 20, 2014
jeromew
commented
Sep 15, 2014
|
As a cross-post after a discussion with @mithro here is a link to a chromium issue that I opened regarding the chrome sandbox on an openvz machine: https://code.google.com/p/chromium/issues/detail?id=412698 The sandbox can be bypassed by recompiling the "chrome_sandbox" target of the chromium project after commenting the 2 lines
in src/sandbox/linux/suid/sandbox.c in the chromium source code. use with care: this removes the annoying UI message that you get with the |
referenced
this issue
in enkidulan/hangout_api
Sep 18, 2014
added a commit
to bocoup/todomvc-vanillajs
that referenced
this issue
Oct 2, 2014
added a commit
to bocoup/todomvc-vanillajs
that referenced
this issue
Oct 2, 2014
added a commit
to bocoup/todomvc-vanillajs
that referenced
this issue
Oct 5, 2014
LoveIsGrief
commented
Nov 8, 2014
|
I see this has been marked as "awaiting-followup" and somebody impacted (trying to run tests using karma in chrome on travis), karma just times out looking for a chrome instance (example). It all works locally, just not on travisCI. |
LoveIsGrief
referenced this issue
in LoveIsGrief/videojs-soundcloud
Nov 8, 2014
Merged
Continuous integration with travis CI #9
BanzaiMan
removed
the
awaiting-followup
label
Nov 8, 2014
|
Hi @lookfirst Could you open a new issue and we can dive into this problem once more with fresh eyes. Were you having issues on .org or .com? Thanks, Josh |
lookfirst
commented
Mar 9, 2015
|
Sorry for the previous (now deleted) comment... After an insane amount of hours wasted today... I finally got this working with Angular Protractor. As everyone has suggested, the no-sandbox argument is the key. It was difficult to figure out how to pass that into Protractor since there isn't any examples that I could find (note the protractor.conf.js near the bottom). Hopefully the bits and pieces of my config below will help someone. Example project: https://github.com/lookfirst/systemjs-seed ./.travis.chrome.sh
.travis.yml
package.json:
protractor.conf.js
|
lookfirst
commented
Mar 9, 2015
|
So, now my request is for the admins of Travis to install Chrome in the default image so that I don't have to run that |
|
Hi @lookfirst Can you please open a separate issue for this.
Can you try adding Thanks |
lookfirst
commented
Mar 9, 2015
|
I'd like to understand your suggestions before I make fixes and break things.
thanks. |
|
You will still need to start |
lookfirst
commented
Mar 9, 2015
|
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. |
lookfirst
commented
Mar 9, 2015
|
So now that I can't sudo, how do I install stuff with apt? |
lookfirst
commented
Mar 9, 2015
|
@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 :) |
This was referenced Mar 10, 2015
lookfirst
commented
Apr 8, 2015
|
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...
|
ghost
commented
May 24, 2015
|
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. |
lookfirst
commented
May 24, 2015
|
@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. |
This was referenced Jun 19, 2015
added a commit
to angular-buch/code
that referenced
this issue
Jul 23, 2015
This was referenced Aug 7, 2015
added a commit
to lkwg82/de.lgohlke.selenium-pageobjects
that referenced
this issue
Sep 21, 2015
lbustelo
referenced this issue
in jupyter-widgets/declarativewidgets
Oct 2, 2015
Merged
Skip remote tests if SAUCE* environment variables not defined. #20
added a commit
to VandeurenGlenn/web-import
that referenced
this issue
Oct 4, 2015
This was referenced Jan 29, 2016
dtracers
commented
Apr 5, 2016
|
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 |
added a commit
to transloadit/uppy
that referenced
this issue
Apr 6, 2016
dtracers
referenced this issue
Apr 13, 2016
Open
Latest version of Chrome fails to install on Precise #5899
fulls1z3
commented
Dec 9, 2016
|
Hope it helps:
|
jugglinmike
commented
Jan 19, 2017
|
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.) |
gildegoma commentedFeb 16, 2013
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