rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

ls: cannot access '.': Operation not permitted #427

Closed kullrich closed 3 years ago

kullrich commented 3 years ago

Hi,

for a simple R installation and gitlab-ci.yml r-base fails to install the important devtools package, because some dependencies like 'fs' cannot be installed. I do not know if this is related to r-base docker image or gitlab-ci.yml.

Maybe there is a workaround.

Best regards

Kristian Ullrich

See here, the .gitlab-ci.yml

image: r-base

before_script:

And the error produced always have this issue:

"ls: cannot access '.': Operation not permitted"

$ R -e "sessionInfo()" R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux bullseye/sid Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.10.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached): [1] compiler_4.0.3

$ R -e "install.packages('fs',repos='http://cran.rstudio.com')" R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. install.packages('fs',repos='http://cran.rstudio.com') Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) trying URL 'http://cran.rstudio.com/src/contrib/fs_1.5.0.tar.gz' Content type 'application/x-gzip' length 796244 bytes (777 KB)

downloaded 777 KB

  • installing source package ‘fs’ ... package ‘fs’ successfully unpacked and MD5 sums checked using staged installation libs g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c dir.cc -o dir.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c error.cc -o error.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c file.cc -o file.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fs.cc -o fs.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c getmode.cc -o getmode.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c id.cc -o id.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.cc -o init.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c link.cc -o link.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c path.cc -o path.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c utils.cc -o utils.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/getmode.cc -o unix/getmode.o gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bsd/setmode.c -o bsd/setmode.o gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bsd/strmode.c -o bsd/strmode.o gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bsd/reallocarray.c -o bsd/reallocarray.o (cd libuv-1.38.1 \ && CC="gcc -std=gnu99" CFLAGS="-g -O2 -fdebug-prefix-map=/build/r-base-oKyfjH/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -fpic -fvisibility=hidden" AR="ar" RANLIB="ranlib" LDFLAGS="-Wl,-z,relro" ./configure --quiet) ls: cannot access '.': Operation not permitted configure: error: working directory cannot be determined make: * [Makevars:31: libuv-1.38.1/Makefile] Error 2 ERROR: compilation failed for package ‘fs’
  • removing ‘/usr/local/lib/R/site-library/fs’ The downloaded source packages are in ‘/tmp/RtmpnOt60N/downloaded_packages’ Warning message: In install.packages("fs", repos = "http://cran.rstudio.com") : installation of package ‘fs’ had non-zero exit status
eddelbuettel commented 3 years ago

I am going to close this as it does not appear to have any relationship with Rocker -- you are failing to install a package.

Maybe you are not root?

Maybe you miss build dependencies?

Maybe you are unaware you can just do sudo apt install r-cran-fs to get fs prebuilt.

edd@rob:~$ docker run --rm -ti r-base bash
root@b5e21aca9020:/# apt update -qq
42 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@b5e21aca9020:/# apt install r-cran-fs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libuv1
Recommended packages:
  r-cran-testthat r-cran-vctrs r-cran-tibble r-cran-pillar r-cran-crayon r-cran-knitr r-cran-withr r-cran-covr r-cran-rmarkdown
The following NEW packages will be installed:
  libuv1 r-cran-fs
0 upgraded, 2 newly installed, 0 to remove and 42 not upgraded.
Need to get 355 kB of archives.
After this operation, 689 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://deb.debian.org/debian testing/main amd64 libuv1 amd64 1.39.0-1 [131 kB]
Get:2 http://deb.debian.org/debian testing/main amd64 r-cran-fs amd64 1.5.0+dfsg-1 [224 kB]
Fetched 355 kB in 1s (564 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libuv1:amd64.
(Reading database ... 18085 files and directories currently installed.)
Preparing to unpack .../libuv1_1.39.0-1_amd64.deb ...
Unpacking libuv1:amd64 (1.39.0-1) ...
Selecting previously unselected package r-cran-fs.
Preparing to unpack .../r-cran-fs_1.5.0+dfsg-1_amd64.deb ...
Unpacking r-cran-fs (1.5.0+dfsg-1) ...
Setting up libuv1:amd64 (1.39.0-1) ...
Setting up r-cran-fs (1.5.0+dfsg-1) ...
Processing triggers for libc-bin (2.31-3) ...
root@b5e21aca9020:/# 
eddelbuettel commented 3 years ago

We really do not have the bandwidth to offer generic R or Linux training. Maybe you could try StackOverflow or community.rstudio.com or a local user group?

kullrich commented 3 years ago

Thanks for your help and resolving that issue. Works perfectly fine now.

Best regards

Kristian Ullrich

eddelbuettel commented 3 years ago

Glad to hear! The container is actually also meant as a base container so you could look into Docker tutorials about how to build your custom container on top of it. Also of note are the 'symmetric' Ubuntu containers as we have 4500+ r-cran-* binaries packages there thanks to Michael Rutter (and 'bspm' can make it very easy/natural to install them). And/or using RSPM (on Ubuntu too, somehow it does not exist for Debian). Lastly, for asking question or discussing approaches the r-sig-debian list (off the usual Zuerich mailhost) is helpful.

junnplus commented 3 years ago

I have the same problem, and I found that the root cause is r-base use debian:testing base image.

docker run --rm debian:testing ls -alwill raise Operation not permitted error in centos 7.4

eddelbuettel commented 3 years ago

The command you quote contains debian:testing so you are running the debian:testing container. This has little to do with Rocker. Maybe you have a security policy that is too tight on your CentOS 7.4 host?

FWIW works fine here (Ubuntu 20.10):

edd@rob:~$ docker run --rm debian:testing ls -al
total 72
drwxr-xr-x   1 root root 4096 Feb 28 15:23 .
drwxr-xr-x   1 root root 4096 Feb 28 15:23 ..
-rwxr-xr-x   1 root root    0 Feb 28 15:23 .dockerenv
drwxr-xr-x   2 root root 4096 Dec 24  2019 bin
drwxr-xr-x   2 root root 4096 Jul  9  2019 boot
drwxr-xr-x   5 root root  340 Feb 28 15:23 dev
drwxr-xr-x   1 root root 4096 Feb 28 15:23 etc
drwxr-xr-x   2 root root 4096 Jul  9  2019 home
drwxr-xr-x   8 root root 4096 Dec 24  2019 lib
drwxr-xr-x   2 root root 4096 Dec 24  2019 lib64
drwxr-xr-x   2 root root 4096 Dec 24  2019 media
drwxr-xr-x   2 root root 4096 Dec 24  2019 mnt
drwxr-xr-x   2 root root 4096 Dec 24  2019 opt
dr-xr-xr-x 621 root root    0 Feb 28 15:23 proc
drwx------   2 root root 4096 Dec 24  2019 root
drwxr-xr-x   3 root root 4096 Dec 24  2019 run
drwxr-xr-x   2 root root 4096 Dec 24  2019 sbin
drwxr-xr-x   2 root root 4096 Dec 24  2019 srv
dr-xr-xr-x  13 root root    0 Feb 28 15:23 sys
drwxrwxrwt   2 root root 4096 Dec 24  2019 tmp
drwxr-xr-x  10 root root 4096 Dec 24  2019 usr
drwxr-xr-x  11 root root 4096 Dec 24  2019 var
edd@rob:~$ 
defnull commented 3 years ago

I can reproduce the docker run --rm debian:testing ls -al bug on an Ubuntu 20.04 Host (on an OpenStack VM). The bug goes away if the docker container is started with --privileged, but that is not an option in public CI/CD environments. While not related to this project, this bug seems to be the issue and very strange.

defnull commented 3 years ago

There seems to be an issue with old docker dameon versions (<19) on new linux kernels (5.4.0-72-generic in my case). Upgrading docker to the most recent version solved the docker run --rm debian:testing ls -al bug for me.