5

I've encountered a problem with deploying my shiny app on linux Ubuntu 16.04 LTS. After I run sudo systemctl start shiny-server, and open up my browser heading to http://192.168..*:3838/StockVis/, the web page greys out in a second.

I found some warnings in the web console as below, and survey some information on the web for like two weeks, but still have no solution. :(

***"Thu Feb 16 2017 12:20:49 GMT+0800 (CST) [INF]: Connection opened. http://192.168.**.***:3838/StockVis/"  

Thu Feb 16 2017 12:20:49 GMT+0800 (CST) [DBG]: Open channel 0  

The application unexpectedly exited.

Diagnostic information is private. Please ask your system admin for permission if you need to check the R logs.  

**Thu Feb 16 2017 12:20:50 GMT+0800 (CST) [INF]: Connection closed. Info: {"type":"close","code":4503,"reason":"The application unexpectedly exited","wasClean":true}  
Thu Feb 16 2017 12:20:50 GMT+0800 (CST) [DBG]: SockJS connection closed  
Thu Feb 16 2017 12:20:50 GMT+0800 (CST) [DBG]: Channel 0 is closed 
Thu Feb 16 2017 12:20:50 GMT+0800 (CST) [DBG]: Removed channel 0, 0 left*****

Please kindly give some suggestions to move on.

lmo
  • 37,904
  • 9
  • 56
  • 69
Jessie
  • 51
  • 5
  • I got the same error twice a few weeks ago. The first time was caused by a package not installed and the second time was related to a permission issue. Are you trying to read or write something in your app? – MLavoie Feb 16 '17 at 13:34
  • Yes, I use read.csv () to import some firm tickers to interact with the getSymbols of the quantmod. I import the file in r as follow : read.csv(/srv/shiny-server/StockVis/www/ticker.csv). Does it possibly cause any problem through this importing? – Jessie Feb 18 '17 at 05:06
  • Make sure you have the right permissions – MLavoie Feb 18 '17 at 08:36
  • Thank you MLavoie! Finally get some idea about this debugging. – Jessie Feb 18 '17 at 09:54
  • @Jessie Did you figure out what has gone wrong? – lkq May 11 '17 at 20:24
  • @KeqiangLi Not yet, still cannot find a solution. Please kindly give some suggestion. – Jessie Jul 09 '17 at 10:24
  • @Jessie Can you try using Chrome to open your app, and press the shortcut shift+control+alt+A, then a window pops up showing you all the network methods that are enabled. Try unchecking all the methods except one and then press OK and refresh your app, do this for every method and see if it works. – lkq Jul 10 '17 at 14:01
  • @KeqiangLi Got it, thanks a lot! – Jessie Jul 12 '17 at 14:19
  • @Jessie any results? – vladli Jan 17 '18 at 10:20

1 Answers1

3

This can indicate something in your R code is causing an error. As that R error could be anything, this answer is to help you gather that info. The browser console messages will not tell you what that is. In order to access the error, you need to configure Shiny to not delete the log upon exiting the application.

Assuming you have sudo access:

$ sudo vi /etc/shiny-server/shiny-server.conf

Place the following line in the file after run_as shiny; :

preserve_logs true;

Restart shiny:

sudo systemctl restart shiny-server

Reload your Shiny app.

In the var/log/shiny-sever/ directory there will be a log file with your application name. Viewing that file will give you more information on what is going on.

Warning. After you are done, take out the preserve_logs true; line in the conf file and restart Shiny. If not, you will start generating a bunch of log files you don't want.

teemoleen
  • 118
  • 6