Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error has occurred The application failed to start. The application exited during initialization. #153

Closed
harryprince opened this issue Oct 22, 2015 · 15 comments

Comments

@harryprince
Copy link

commented Oct 22, 2015

I fail to use shiny by some unknown reasons.
I have try lots of methods from google,gmail-groups and so on.

here is my site: http://52.88.172.224:3838/sample-apps/hello/

uname -a
Linux 85e56e7be938 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.10

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

and

> library(shiny)

successfully use shiny.

shiny-server
[2015-10-22 03:06:38.300] [INFO] shiny-server - Shiny Server v1.4.0.756 (Node.js v0.10.21)
[2015-10-22 03:06:38.302] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2015-10-22 03:06:38.332] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2015-10-22 03:06:38.334] [INFO] shiny-server - Starting listener on 0.0.0.0:3838
[2015-10-22 03:06:38.338] [ERROR] shiny-server - HTTP server error (0.0.0.0:3838): listen EADDRINUSE
[2015-10-22 03:06:38.338] [INFO] shiny-server - Shutting down worker processes

and I use the default conf

sudo /opt/shiny-server/bin/deploy-example default

I am still curiosity the problem, and I fail to use

stop shiny-server 
restart shiny-server

there is no any response on terminal.

and I use this command to watch the thread

ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.4  28884  4660 ?        Ss   Oct17   0:00 /usr/bin/python3 -u /sbin/my_init
root         8  0.0  0.0    188    32 ?        S    Oct17   0:04 /usr/bin/runsvdir -P /etc/service
root         9  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv syslog-forwarder
root        10  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv syslog-ng
root        11  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv cron
root        14  0.0  0.0  28872   356 ?        S    Oct17   0:00 /usr/sbin/cron -f
root        15  0.0  0.2  64044  2580 ?        S    Oct17   0:00 syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root        16  0.0  0.0   7232   188 ?        S    Oct17   0:19 tail -F -n 0 /var/log/syslog
root        42  0.0  0.0  18260   552 ?        Ss+  Oct17   0:00 /bin/bash
root       472  0.0  0.0  18148   460 ?        Ss+  Oct17   0:00 /bin/bash
root       633  0.0  0.0  18152   616 ?        Ss+  Oct17   0:00 /bin/bash
root      2485  0.0  0.2  18168  2048 ?        Ss   02:24   0:00 /bin/bash
root      2510  0.0  0.0    168     4 ?        Ss   02:27   0:00 runsv shiny-server
root      2511  0.0  3.9 977952 39924 ?        Sl   02:27   0:00 /opt/shiny-server/ext/node/bin/shiny-server /opt/shiny-
root      2581  0.0  0.1  48360  1840 ?        S    02:49   0:00 sudo su
root      2582  0.0  0.1  48992  1520 ?        S    02:49   0:00 su
root      2583  0.0  0.2  21036  2092 ?        S    02:49   0:00 bash
root      2737  0.0  0.1  18444  1296 ?        R+   03:08   0:00 ps -aux

even I attempt to kill some related thread, these pid will be restart automaticlly

kill 2510 2511

the problem still here

ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.4  28884  4660 ?        Ss   Oct17   0:00 /usr/bin/python3 -u /sbin/my_init
root         8  0.0  0.0    188    32 ?        S    Oct17   0:04 /usr/bin/runsvdir -P /etc/service
root         9  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv syslog-forwarder
root        10  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv syslog-ng
root        11  0.0  0.0    168     4 ?        Ss   Oct17   0:00 runsv cron
root        14  0.0  0.0  28872   356 ?        S    Oct17   0:00 /usr/sbin/cron -f
root        15  0.0  0.2  64044  2580 ?        S    Oct17   0:00 syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root        16  0.0  0.0   7232   188 ?        S    Oct17   0:19 tail -F -n 0 /var/log/syslog
root        42  0.0  0.0  18260   552 ?        Ss+  Oct17   0:00 /bin/bash
root       472  0.0  0.0  18148   460 ?        Ss+  Oct17   0:00 /bin/bash
root       633  0.0  0.0  18152   616 ?        Ss+  Oct17   0:00 /bin/bash
root      2485  0.0  0.2  18168  2048 ?        Ss   02:24   0:00 /bin/bash
root      2581  0.0  0.1  48360  1840 ?        S    02:49   0:00 sudo su
root      2582  0.0  0.1  48992  1520 ?        S    02:49   0:00 su
root      2583  0.0  0.2  21040  2096 ?        S    02:49   0:00 bash
root      2738  0.0  0.0    168     4 ?        Ss   03:10   0:00 runsv shiny-server
root      2739 24.0  3.6 704840 36912 ?        Sl   03:10   0:00 /opt/shiny-server/ext/node/bin/shiny-server /opt/shiny-
root      2745  0.0  0.1  18444  1296 ?        R+   03:10   0:00 ps -aux

I need help, thanks!

@fereshtehRS

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2015

The error you are receiving the shiny-server log indicates that the port (3838) is in use. You can run a command like the following to check that:

netstat --tcp -a -n -p | grep 3838

And you can configure your Shiny Server to run on a different port that is not being used. (e.g 3839)

@jcheng5

This comment has been minimized.

Copy link
Member

commented Oct 26, 2015

Look at /var/log/shiny-server/*.log on the server to see if you can find the error log for your app.

BTW, are you running in a docker container or something?

@ErrolK

This comment has been minimized.

Copy link

commented Jul 6, 2016

Hi,

I am experiencing the same problem. Any solution in sight?

@ErrolK

This comment has been minimized.

Copy link

commented Jul 6, 2016

ok my problem wasn't with Rshiny but with the internal ufw
In order to fix it I did
sudo ufw allow 3838/tcp

Then it worked on ubuntu 14.04 on aws

@kmezhoud

This comment has been minimized.

Copy link

commented Oct 3, 2016

Hi,
It looks like you do not have right permission to access /srv/shiny-server.
type shiny-serverto see if you have access.
If not try to change in /etc/shiny-server/shiny-server.conf
run_as shiny by run_as session_name
sudo restart shiny-server
or maybe

cd /srv/shiny-server
chmod 555 shiny-app
sudo restart shiny-server
@ErrolK

This comment has been minimized.

Copy link

commented Oct 5, 2016

Hi,

I did have access. The main problem was that the firewall wasn't open.

Thanks for taking the time to answer

@agarwalnaimish

This comment has been minimized.

Copy link

commented Nov 17, 2016

I did the following to get it running:

  1. sudo gedit /etc/shiny-server/shiny-server.conf and then changed run_as shiny to run_as username which in my case is run_as agarwalnaimish.
  2. sudo ufw allow 3838/tcp
@harryprince

This comment has been minimized.

Copy link
Author

commented Dec 12, 2016

ln -s <your_lib> <sys_lib> can sovle this problem.

and ls -lrt /var/log/shiny-server/*.log |tail -1
can get latest shiny-server app log instantly.

@paullintilhac

This comment has been minimized.

Copy link

commented Dec 30, 2016

I am having the same issue. However, I don't want to run sudo ufw allow 3838/tcp because I am using apache as a gateway for authentication, according to this: https://www.r-bloggers.com/password-protect-shiny-apps/. Does this mean that my reverse proxy isn't congifured correctly?

@fereshtehRS

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2017

@paullintilhac Can you please provide the following info:

  • The apache reverse proxy configuration
  • Shiny server configuration file (/etc/shiny-server/shiny-server.conf)
  • The error messages from /var/log/shiny-server.log file
  • Any error in the application log file: /var/log/shiny-server/-xxxx.log
@yanshil

This comment has been minimized.

Copy link

commented Feb 20, 2017

I found out my problem was that I didn't install the shiny package.

sudo su - \ -c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""

REF: https://www.rstudio.com/products/shiny/download-server/

@XiaoruiZhu

This comment has been minimized.

Copy link

commented Sep 22, 2017

I spent a lot of time reading through you guys solution but still not work, until I find it could be the problem of "Configuring Firewall" of your instance.

If you deploy your instance in AWS or Aliyun, go to "Security Group" and add a rule for 3838(whatever port you set in your shiny-server.conf). Then you will have the permission to access shiny-server.

@bvvamsik

This comment has been minimized.

Copy link

commented Oct 9, 2017

I got the same issue when i published my application to shiny server. Usually we use something called setwd(//Current Directory) to set the environment to the current directory and perform actions on it. But, when pushing to cloud and running on server, such commands(setwd) should be removed. Once that was commented or removed and pushed to server, the application is working perfectly fine. Try this workaround. Once again this is one of the scenario which we might encounter this type of error.

@jmzeng1314

This comment has been minimized.

Copy link

commented Dec 16, 2017

I also got this problem, but that's my fault.
I use the sudo chgrp -R shiny-apps /srv/shiny-server/ as some other tutorial.
So I should change it back, sudo chgrp -R shiny /srv/shiny-server/

By the way, be careful about the files

  1. Shiny server configuration file (/etc/shiny-server/shiny-server.conf)
  2. The error messages from /var/log/shiny-server.log file
  3. Any error in the application log file: /var/log/shiny-server/-xxxx.log
@ray1919

This comment has been minimized.

Copy link

commented May 7, 2019

In my case, some package was installed in user dir, and the server was run_as shiny, so it could not find some package like "digest", this caused the error.

the solution is as what @agarwalnaimish answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.