Hi. I cant get Shiny to run with specific packages on Centos 7, although it runs locally.
The app runs an extremely simple/basic app which is visually confirmed with library(shiny) and library(bslib) however when I start to introduce other packages, such as with library(dplyr) it kicks the error ‘An error has occurred. Check your logs or contact the app author for clarification.’ . It is not just dplyr, I am focusing on this one only for this query.
The log prints this…
su: ignore --preserve-environment, it's mutually exclusive to --login.
Listening on http://127.0.0.1:46008
Warning: Error in library: no library trees found in 'lib.loc'
72: stop
71: library
Execution halted
I followed some online advise and placed the following as the top of ui.R, with the expectation that it would use a bit of brute force to install dplyr.
if(!require("dplyr"))
install.packages("dplyr")
it generated this log output…
su: ignore --preserve-environment, it's mutually exclusive to --login.
Listening on http://127.0.0.1:43237
Loading required package: dplyr
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘dplyr’
Warning in install.packages("dplyr") :
'lib = "/opt/R/3.6.2/lib/R/library"' is not writable
Warning: Error in install.packages: unable to install packages
72: stop
71: install.packages
It looks like it is trying to place dplyr in an old library for 3.6.2. I tried again specifying lib = "/home/kamanyi/R/x86_64-pc-linux-gnu-library/4.0" in the install.packages but it reverts that is not writable. I set it to chmod 777 but it still states the same ‘not writable’.
Even though it says there is no package, I can see it with installed.packages(). V 1.0.5 is listed in ‘/home/kamanyi/R/x86_64-pc-linux-gnu-library/4.0’.
The issue has occurred with shiny 1.6.0, but I have now installed the github version (1.6.0.9000) and it does the same. I unistalled shinyserver and reinstalled (confirmed as 1.5.16.958).
sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.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.4
Any suggestions on my next approach please? And what other info should I provide to shed light?
I took this task on yesterday and updated the existing 3.6.2 version of R. It took a couple of attempts and /opt/R/ has folders for 3.6.2, 4.0.0, 4.0.4 and devel. I wouldn’t have thought that’s applicable but I mention for clarity.