Installation of Shiny Server. "An error has occurred The application failed to start."

5,298 views
Skip to first unread message

Stefano Mas

unread,
Sep 12, 2016, 11:36:11 AM9/12/16
to Shiny - Web Framework for R
Hi,

I recently installed Shiny server on a headless linux machine running Ubuntu 14.04.

I successfully installed R, shiny and shiny server, and I am able to see in the browser the webpage showing the sampleApp and it says that the shiny server has been installed successfully.

Unfortunately on the right side of the page I cannot see the R plot. Instead I see the text
"
ERROR: An error has occurred. Check your logs or contact the app author for clarification.
"

And I have no idea why it is not working.

When checking the log, I got these lines:

more /var/log/shiny-server.log
[2016-09-12 16:20:58.326] [INFO] shiny-server - Shiny Server v1.4.4.807 (Node.js v0.10.46)
[2016-09-12 16:20:58.328] [INFO] shiny-server - Using pidfile /var/run/shiny-server.pid
[2016-09-12 16:20:58.329] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2016-09-12 16:20:58.368] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2016-09-12 16:20:58.371] [INFO] shiny-server - Starting listener on 0.0.0.0:3838
[2016-09-12 16:22:01.622] [INFO] shiny-server - Created bookmark state directory: /var/lib/shiny-server/bookmarks
[2016-09-12 16:22:01.635] [INFO] shiny-server - Created user bookmark state directory: /var/lib/shiny-server/bookmarks/shiny
[2016-09-12 16:22:02.475] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-09-12 16:24:01.891] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.



I also tried checking if the shiny user had access to R and the required packages to switch to the shiny user using sudo:

sudo su - shiny
R



I was able to call

library(shiny) without any problems.

This is the output from
> installed.packages()
           
Package       LibPath                         Version
curl        
"curl"        "/usr/local/lib/R/site-library" "1.2"
devtools    
"devtools"    "/usr/local/lib/R/site-library" "1.12.0"
digest      
"digest"      "/usr/local/lib/R/site-library" "0.6.10"
git2r      
"git2r"       "/usr/local/lib/R/site-library" "0.15.0"
htmltools  
"htmltools"   "/usr/local/lib/R/site-library" "0.3.5"
httpuv      
"httpuv"      "/usr/local/lib/R/site-library" "1.3.3"
httr        
"httr"        "/usr/local/lib/R/site-library" "1.2.1"
jsonlite    
"jsonlite"    "/usr/local/lib/R/site-library" "1.0"
markdown    
"markdown"    "/usr/local/lib/R/site-library" "0.7.7"
memoise    
"memoise"     "/usr/local/lib/R/site-library" "1.0.0"
mime        
"mime"        "/usr/local/lib/R/site-library" "0.5"
openssl    
"openssl"     "/usr/local/lib/R/site-library" "0.9.4"
R6          
"R6"          "/usr/local/lib/R/site-library" "2.1.3"
Rcpp        "Rcpp"        "/usr/local/lib/R/site-library" "0.12.7"
rstudioapi  
"rstudioapi"  "/usr/local/lib/R/site-library" "0.6"
shiny      
"shiny"       "/usr/local/lib/R/site-library" "0.14"
sourcetools
"sourcetools" "/usr/local/lib/R/site-library" "0.1.2"
whisker    
"whisker"     "/usr/local/lib/R/site-library" "0.3-2"
withr      
"withr"       "/usr/local/lib/R/site-library" "1.0.2"
xtable      
"xtable"      "/usr/local/lib/R/site-library" "1.8-2"



... cut ...


and here's the output from

> sessionInfo()
R version
3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

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

other attached packages
:
[1] shiny_0.14

loaded via a
namespace (and not attached):
[1] digest_0.6.10   htmltools_0.3.5 httpuv_1.3.3    mime_0.5


[5] R6_2.1.3        Rcpp_0.12.7     tools_3.0.2     xtable_1.8-2



My options for debugging are limited, since there is no GUI in the machine and I cannot install Rstudio. Does anybody have an idea on what can be wrong? Many thanks in advance

max...@gmail.com

unread,
Sep 20, 2016, 10:21:27 AM9/20/16
to Shiny - Web Framework for R, stoca...@gmail.com
I met the same failure in the index.html, I can see the plot, but cannot see the code, where show a error message "Error: An error has occurred. Check your logs or contact the app author for clarification." I'm sure the "rmarkdown" package has been installed.

then I go to my app, which works well before, but after deployed to shiny server, I see may error messages as "Error: An error has occurred. Check your logs or contact the app author for clarification." then I go to my pc without server, it works well.


Who can show me how to fix this problem? Thanks.



在 2016年9月12日星期一 UTC+8下午11:36:11,Stefano Mas写道:

Peter Tyrrell

unread,
Sep 28, 2016, 6:11:14 AM9/28/16
to Shiny - Web Framework for R, stoca...@gmail.com
Hi guys,

I'm also having a similar problem, App working well locally and shinyapp.io, but encountering the same error at this stage. 

Peter

rjss

unread,
Sep 28, 2016, 10:55:39 AM9/28/16
to Shiny - Web Framework for R, stoca...@gmail.com

rjss

unread,
Sep 28, 2016, 10:56:56 AM9/28/16
to Shiny - Web Framework for R, stoca...@gmail.com
Message has been deleted

Nan Zhou

unread,
Sep 28, 2016, 8:36:57 PM9/28/16
to Shiny - Web Framework for R
The same problem (http://139.129.132.159:3838/). Please provide a solution.
CentOS 7 (no GUI, cloud server)
R 3.3.1
Shiny-server 1.4.6

Interestingly, on my personal laptop, ubuntu 16.04, I installed and configure shiny-server the same way, it works perfectly!

Joe Cheng

unread,
Sep 28, 2016, 10:12:45 PM9/28/16
to Nan Zhou, Shiny - Web Framework for R
Can you check the log files under /var/log/shiny-server/*.log?
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/f74589bf-a0a1-4a16-8342-4c8fe902f545%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Cheng

unread,
Sep 28, 2016, 10:15:12 PM9/28/16
to Nan Zhou, Shiny - Web Framework for R
Also, if you would prefer to see real error messages in your app instead of generic ones, you can add "sanitize_errors off;" to your /etc/shiny-server/shiny-server.conf, then restart shiny server (or send SIGHUP if you don't want to interrupt the process).

Nan Zhou

unread,
Sep 28, 2016, 10:33:45 PM9/28/16
to Shiny - Web Framework for R
Hi Joe, thanks a lot. According to your advice, I first added "sanitize_errors off;" to the shiny-server.conf, then I restarted the shiny-server. Please find the log here (http://139.129.132.159:3838/log.txt)
Then, refresh (http://139.129.132.159:3838/), I got more specific error info
  1) Error, cannot open file 'Rplots.pdf'
  2) Error: dev.control() called without an open graphics device
Reply all
Reply to author
Forward
0 new messages