BigelowLab / edna-dada2

Maine eDNA dada2
0 stars 0 forks source link

edna_user_installer.R normalizePath error #22

Closed robinsleith closed 3 years ago

robinsleith commented 3 years ago

Sam got the following error trying to use the install/update script. It is working for me but I am going to see if Rene can run it successfully.

bash-4.2$ Rscript /mnt/storage/data/edna/packages/edna_user_installer.R charlier dadautils

Error in normalizePath(paths, mustWork = TRUE) :

  path[1]="/home/stan/R/x86_64-conda-linux-gnu-library/4.0": No such file or directory

Calls: <Anonymous> -> set_libpaths -> normalizePath

Execution halted
btupper commented 3 years ago

Hmmm. This appears to likely caused by the fact that Sam doesn't seem to have installed a package prior to this. He doesn't have the ~/R install directory. Can we fire up a zoom with Sam today to noodle this out?

btupper commented 3 years ago

And why is Sam's prompt so different than mine?

btupper@cfe1 ~ $ 

vs

bash-4.2$

?

robinsleith commented 3 years ago

Hmm indeed. I wonder if it was run locally not on Charlie. Would it be a requirement that people have installed an R package prior to using edna_user_installer.R? I can see several folks for whom this will be the first thing they do on Charlie

robinsleith commented 3 years ago

Sam just walked by and I asked if we could log onto Charlie together and check the error. We logged on from the PC in the lab and did get the bash-4.2$ prompt so I think that might be a PC thing?

Got a different error trying to run edna_user_installer.R (see below). Then I tried navigating to the charlier and dadautils directories and running devtools::install(upgrade = FALSE) which worked for both. We then tried the tutorial and things seem to be working. Then tried edna_user_installer.R again and it worked that time so it does seem to matter that people have installed a package previously and is likely some path nightmare?

User doesn't have R_LIBS_USER directory, will try to create
  checking for file ‘/mnt/storage/data/edna/packages/charlier/DESCRIPTION’ (647ms)
─  preparing ‘charlier’: (664ms)
  checking DESCRIPTION meta-information
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘charlier_0.1.tar.gz’

Running /mnt/modules/bin/dada2/1.18/lib/R/bin/R CMD INSTALL \
  /tmp/RtmpuxY3i9/charlier_0.1.tar.gz --install-tests \
  '--library ~/R/x86_64-conda-linux-gnu-library/4.0'
Warning: unknown option ‘--library ~/R/x86_64-conda-linux-gnu-library/4.0’
* installing to library ‘/mnt/modules/bin/dada2/1.18/lib/R/library’
Error: ERROR: no permission to install to directory ‘/mnt/modules/bin/dada2/1.18/lib/R/library’

Error: System command 'R' failed, exit status: 1, stdout & stderr were printed

 Stack trace:

 1. devtools::install(path, args = paste("--library", lib_path),  ...
 2. pkgbuild::with_build_tools(required = FALSE, callr::rcmd("INSTALL ...
 3. callr::rcmd("INSTALL", c(install_path, opts), echo = !quiet,  ...
 4. callr:::run_r(options)
 5. base:::with(options, with_envvar(env, do.call(processx::run,  ...
 6. base:::with.default(options, with_envvar(env, do.call(processx::r ...
 7. base:::eval(substitute(expr), data, enclos = parent.frame())
 8. base:::eval(substitute(expr), data, enclos = parent.frame())
 9. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args  ...
 10. base:::force(code)
 11. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
 12. (function (command = NULL, args = character(), error_on_status = TRUE,  ...
 13. throw(new_process_error(res, call = sys.call(), echo = echo,  ...

 x System command 'R' failed, exit status: 1, stdout & stderr were printed

Execution halted
btupper commented 3 years ago

I have edited the code so I think it works. If I remove local packages (charlie, dadautils, mothurshelper) and delete my home R library, then run the script it runs successfully. That's as close as I can get to emulating a brand new user.

robinsleith commented 3 years ago

I think your edits are working, as I think this was essentially the case when upgrading to 1.2. I will test with an unsuspecting grad student but closing this for now.