10

I'm encountering a bug when building R on the amazonlinux:2018.03.0.20190212 docker image in bitbucket pipelines. The strange thing is if I run an EC2 (Amazon Linux 2018) I can run the exact same commands with no error.

Does anyone know how to solve this?

make[6]: Entering directory `/opt/R/src/library/graphics/src'
mkdir -p -- ../../../../library/graphics/libs
make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
Error : .onLoad failed in loadNamespace() for 'utils', details:
  call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
  error: error in running command
Error: unable to load R code in package 'graphics'
Execution halted

Manually, on EC2:

make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Entering directory `/opt/R/src/library/stats'
building package 'stats'

I'm not too familiar with R and don't find the error messages particularly informative.

daveloyall
  • 2,140
  • 21
  • 23
8t12c7081
  • 683
  • 3
  • 9
  • 30
  • Try reinstalling graphic package and the dependencies. `remove.packages("graphics")` and `install.packages("graphics",dependencies=TRUE)` – noah Jun 07 '19 at 19:42
  • I get very similar behaviour compiling 3.6.0 on a CentOS cluster. – Jay Moore Jun 13 '19 at 10:56
  • I know it might be simple answer that you are not looking for, yet worth mentioning. If the R version number is not that critical to your business task, then you might want to try a little earlier version than 3.6.0 :) – Krassi Em Jun 23 '19 at 03:39
  • @KrassiEm yes, I was able to workaround by using an earlier version of the package that depended on 3.6. No issues with earlier R version. It is just strange that it should fail in pipelines/docker container and not on EC2 with same (evidently not exact same) configuration. – 8t12c7081 Jun 25 '19 at 19:36

1 Answers1

9

I had the same issue, though not with Docker but with Singularity. For me it turned out that I was missing the 'which' binary from the container. After installing the 'which' package (I'm on CentOS7) and I was able to progress passed that error.

TuxTobin
  • 106
  • 1
  • 2