Skip to content
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

notebook build errors -- unexpected operator #3

Open
jeremydouglass opened this issue Nov 18, 2016 · 3 comments
Open

notebook build errors -- unexpected operator #3

jeremydouglass opened this issue Nov 18, 2016 · 3 comments

Comments

@jeremydouglass
Copy link
Collaborator

While building, the log shows repeated

"/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator"

The error looks like it might be an expecting-bash-but-ran-in-sh problem:

Docker build log:

Step 12 : RUN Rscript -e 'install.packages("mallet", repos="http://cran.rstudio.com/")'
 ---> Running in e8c819c09034
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator
trying URL 'http://cran.rstudio.com/src/contrib/mallet_1.0.tar.gz'
Content type 'application/x-gzip' length 4460706 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator
* installing *source* package ‘mallet’ ...
** package ‘mallet’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator
* DONE (mallet)

The downloaded source packages are in
	‘/tmp/Rtmp8dDq5e/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
 ---> 83e37ef1de7b
Removing intermediate container e8c819c09034
Step 13 : RUN Rscript -e 'devtools::install_github("agoldst/dfrtopics", quiet = TRUE)'
 ---> Running in 81731fc33920
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator
Installing 10 packages: DBI, dplyr, lattice, Matrix, R6, Rcpp, RcppEigen, stringi, stringr, tibble
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In utils::install.packages(pkgs, repos = repos, type = type, dependencies = dependencies,  :
  installation of package ‘Rcpp’ had non-zero exit status
2: In utils::install.packages(pkgs, repos = repos, type = type, dependencies = dependencies,  :
  installation of package ‘stringi’ had non-zero exit status
 ---> 3a2475da200c
Removing intermediate container 81731fc33920
Successfully built 3a2475da200c
@jeremydouglass jeremydouglass changed the title notebook build errors notebook build errors -- unexpected operator Nov 18, 2016
@jeremydouglass
Copy link
Collaborator Author

jeremydouglass commented Nov 18, 2016

  • https:// github.com/jupyter/docker-stacks/ issues/210
  • https:// github.com/ContinuumIO/anaconda-issues/ issues/1063
  • https:// github.com/jupyterhub/jupyterhub/ issues/800

Two resolutions:

datascience-notebook:54552d36cf0a works for me. I can plot again!

And:

With irkernel 0.7 and conda r-base 3.3.1-3, I can crash the kernel by simply entering x <- 1 in a new notebook. The error on the console is the same ....
Switching back to r-base 3.3.1-1 resolves the issue. It seems that conda 3.3.1-3 build is the culprit again.

@jeremydouglass
Copy link
Collaborator Author

Our RUN Rscript -e lines may be failing due to Rscript exec happening through sh rather than bash. Still not sure why it worked on all our earlier builds and then just stopped working -- perhaps jupyter, perhaps anaconda.

We might try mapping the command to bash using the RUN command form:

RUN ["/bin/bash", "-c", "echo hello"]

so:

RUN ["/bin/bash", "-c", "RUN Rscript -e etc etc etc"]

as per:

  • https:// github.com/docker/docker/issues/ 8100
  • https:// github.com/docker/docker/issues/ 7281
  • moby/moby@55dc4f2

@jeremydouglass
Copy link
Collaborator Author

Nope. Looks like the Jupyter R is just damaged (probably as per 120 ?). Running from jupyter bash:

jovyan@717fbe331266:~/work$ Rscript -e 'install.packages("mallet", repos="http://cran.rstudio.com/")'                              
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator                                                                          
trying URL 'http://cran.rstudio.com/src/contrib/mallet_1.0.tar.gz'

...and running from Jupyter R repl:

> install.packages("mallet", repos="http://cran.rstudio.com/")                                                                     
trying URL 'http://cran.rstudio.com/src/contrib/mallet_1.0.tar.gz'                                                                 
Content type 'application/x-gzip' length 4460706 bytes (4.3 MB)                                                                    
==================================================                                                                                 
downloaded 4.3 MB                                                                                                                  

/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator                                                                          
/opt/conda/lib/R/bin/R: 12: [: Linux: unexpected operator                                                                          
* installing *source* package ‘mallet’ ...      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant