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.

9
  • 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, 2017 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, 2017 at 5:06
  • Make sure you have the right permissions
    – MLavoie
    Feb 18, 2017 at 8:36
  • Thank you MLavoie! Finally get some idea about this debugging.
    – Jessie
    Feb 18, 2017 at 9:54
  • @Jessie Did you figure out what has gone wrong?
    – lkq
    May 11, 2017 at 20:24

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.