craigcitro / r-travis

Tools for using R with Travis (http://travis-ci.org) in lieu of a website:

Home Page:https://github.com/craigcitro/r-travis/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sudo error during travis check

thibautjombart opened this issue · comments

Travis seems to be failing with the basic file created by devtools::add_travis()
Just as of today, worked a few hours ago. See:
https://github.com/thibautjombart/apex

Apparently config file would need a

sudo: require

or

sudo: true

But neither worked for me.
Here's the log:

Using worker: worker-linux-docker-0b3a6124.prod.travis-ci.org:travis-linux-8

Build system information
Build language: r
Build image provisioning date and time
Thu Feb  5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
Linux Version
3.13.0-29-generic
Cookbooks Version
a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"

$ git clone --depth=50 --branch=master git://github.com/thibautjombart/apex.git thibautjombart/apex
Cloning into 'thibautjombart/apex'...
remote: Counting objects: 356, done.
remote: Compressing objects: 100% (234/234), done.
remote: Total 356 (delta 221), reused 252 (delta 117), pack-reused 0
Receiving objects: 100% (356/356), 368.31 KiB | 0 bytes/s, done.
Resolving deltas: 100% (221/221), done.
Checking connectivity... done.
$ cd thibautjombart/apex
$ git checkout -qf 6bd4bb4b5ce97f05653ca520d256e435cb29737b

This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.
If you require sudo, add 'sudo: required' to your .travis.yml
See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
R for Travis-CI is not officially supported, but is community maintained.
Please file any issues using the following link
  https://github.com/travis-ci/travis-ci/issues/new?labels=community:r
and mention @craigcitro, @eddelbuettel and @hadley in the issue
Installing R
$ sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -cs)/"
sudo: must be setuid root

The command "sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -cs)/"" failed and exited with 1 during .

Your build has been stopped.

I'm using language: r in my .travis.yml file and got a very similar error message about needing sudo and failure to build.

This was fixed by adding sudo: required to my .travis.yml file, the build now succeeds. Here's my working .travis.yml file:

language: r
sudo: required
warnings_are_errors: true
r_binary_packages:
  - dplyr
  - httr
  - jsonlite

Note that I've got required but you have require, I wonder if that might be why it didn't work for you?

This all seems to be related to Travis' container infrastructure, on which they don't allow sudo.

Thanks for the reply. Sorry, 'require' was a typo.
Testing it again now, but travis doesn't use the latest commit.. Will try again later.
Oddly enough, the 'sudo' issue pops in and out on various packages. I have seen the same commit succeed/fail in alternance on the same day.
Varying containers?

Maybe they're in the middle of some kind of migration... in any case, it seems like containers are going to be the new normal for Travis: http://docs.travis-ci.com/user/workers/container-based-infrastructure/

I wonder how this will impact travis for R packages. Currently it looks like R is freshly installed via apt-get every time a check is run. Ideally the right container should contain a fresh snapshot of R packages. @hlapp might have suggestions there?

this is interesting -- it does seem to be the case that travis has started opting people into container-based builds. i just filed travis-ci/travis-ci#3521 to hopefully find out more.

in the interim, it seems like sudo: true or sudo: required should get you up and running. if that's now the norm, i'll make sure we get it added to the defaults in devtools.

so it looks like this is on the way for everyone.

i'm going to keep this open to track updating docs everywhere.

Good to know. ooks like the apt add-on should do the trick, so sudo should
no longer me a requirement..

On Tue, Mar 31, 2015 at 5:43 PM, Craig Citro notifications@github.com
wrote:

so it looks like this is on the way for everyone
http://blog.travis-ci.com/2015-03-31-docker-default-on-the-way/.

i'm going to keep this open to track updating docs everywhere.


Reply to this email directly or view it on GitHub
#151 (comment).

@thibautjombart actually, it won't quite get us there yet -- we have to pre-specify the list of packages we'd want to be available in that case. i don't know if it would be possible to get a handful of packages approved from a PPA (marutter's PPA), but i should look into it.

Does look like this is repo-specific, as I still don't need sudo: required for the language: r build I had set up last month. cryptic thing to track down when I am looking at two builds that are doing nearly identical setups, and one fails w/o sudo. Good to run into this thread to know I am not crazy.

@jread-usgs yep, thus far it's only for new repos as of feb 14. definitely a bit crazy-making. ;)

Hi,
why is it sudo: required needed? my other packages went fine without it.

@jangorecki the R support uses sudo for various things (eg installing R), and doesn't work out of the box with container-based builds.

for new repos, they're being opted in to container-based builds by default, which causes trouble. older repos are using the VM infrastructure, which allows sudo without any extra configuration.

Thanks for explanation. If it is going to stay like that it would be worth to update all the examples.