shiny server running but shiny app does not spawn up from rstudio run button

I have recently launched a new ubuntu 20.04 server on the cloud, installed R, Rstudio and shiny server (all open source). The rstudio is accessible on a remote browser connection. But somehow I am unable to make a simple shiny app to spawn up. Even the sample app /sample-apps/hello/ does not load the shiny app (while taking me to Welcome to Shiny Server! titled page).
I tried the following to fix the issue but none worked till now,

  1. checked run_as in fileshiny-server.conf ; it is set to rstudio( this is the user name I use for all the apps)
cat /etc/shiny-server/shiny-server.conf 
# Define the user to run Shiny apps as
run_as rstudio;
preserve_logs true;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define the location for the Shiny apps directory
  location / {
    site_dir /srv/shiny-server;
    log_dir /var/log/shiny-server;
    directory_index on;
  }
}
  1. checked app logs (nothing worthwhile found)
rstudio@e2e-115-9:/var/log/shiny-server$ cat hello-rstudio-20231106-010600-39523.log 
su: ignoring --preserve-environment, it's mutually exclusive with --login

Listening on http://127.0.0.1:39523


Execution halted
  1. changed owner of the log directory from shiny to rstudio (as this could be one problem - fixed)
sudo chown -R rstudio:rstudio /var/log/shiny-server

rstudio@e2e-115-9:/var/log/shiny-server$ ls -lt
total 56
-rw-r----- 1 rstudio rstudio 131 Nov  6 01:07 hello-rstudio-20231106-010600-39523.log
-rw-r----- 1 rstudio rstudio 131 Nov  6 01:07 rmd-rstudio-20231106-010600-44697.log
-rw-r----- 1 rstudio rstudio 131 Nov  6 01:05 rmd-rstudio-20231106-010402-46739.log
-rw-r----- 1 rstudio rstudio 131 Nov  6 01:05 hello-rstudio-20231106-010402-38939.log
-rw-r----- 1 rstudio rstudio 131 Nov  5 01:18 jsw-rstudio-20231105-011719-35935.log
-rw-r----- 1 rstudio rstudio 131 Nov  5 01:15 jsw-rstudio-20231105-011401-41293.log
-rw-r----- 1 rstudio rstudio 131 Nov  5 01:13 jsw-rstudio-20231105-011339-38651.log
-rw-r----- 1 rstudio rstudio 247 Nov  5 01:01 jsw-shiny-20231105-010129-44253.log
-rw-r----- 1 rstudio rstudio 247 Nov  5 00:57 rmd-shiny-20231105-005741-35543.log
-rw-r----- 1 rstudio rstudio 247 Nov  5 00:57 hello-shiny-20231105-005741-43759.log
-rw-r----- 1 rstudio rstudio 247 Nov  4 22:21 rmd-shiny-20231104-222117-40815.log
-rw-r----- 1 rstudio rstudio 247 Nov  4 22:21 hello-shiny-20231104-222117-33111.log
-rw-r----- 1 rstudio rstudio 247 Nov  4 22:21 hello-shiny-20231104-222059-33401.log
-rw-r----- 1 rstudio rstudio 247 Nov  4 22:20 rmd-shiny-20231104-222059-42555.log
  1. checked the shiny server log and here is its tail,
2023-11-06T01:02:01.315] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2023-11-06T01:02:01.318] [INFO] shiny-server - Starting listener on http://[::]:3838
[2023-11-06T01:05:02.754] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:05:02.755] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:05:02.756] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.830] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.831] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.831] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.833] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.833] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.
[2023-11-06T01:07:00.833] [INFO] shiny-server - Error getting worker: Error: The application took too long to respond.

the above log is generated when I try to launch the shiny app from a remote web connection. But since the app does not start even locally from rstudio and the sample hello shiny app also does not show up there seems to be a fundamental problem in the app. Above error is anyway expected as no app is getting launched.

Note: the shiny apps were working till 2 days ago, but as I started to fiddle the settings (copied several files from old server to new server) something that must have disturbed something. The copied files are though all related to sites-available and sites-enabled, which are nginx related files so should not impact the basic shiny app launch, I guess.

I have also restarted rstudio-server and even the ubuntu server.
the reboot is recorded in the following journal entry

sudo journalctl -u shiny-server -n 50
.....
Nov 06 00:43:26 e2e-115-9 systemd[1]: Stopped ShinyServer.
-- Reboot --
Nov 06 00:43:33 e2e-115-9 systemd[1]: Started ShinyServer.
Nov 06 00:48:13 e2e-115-9 su[2392]: (to rstudio) root on none
Nov 06 00:48:13 e2e-115-9 su[2392]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)
Nov 06 00:48:13 e2e-115-9 su[2398]: (to rstudio) root on none
Nov 06 00:48:13 e2e-115-9 su[2398]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)
Nov 06 01:01:55 e2e-115-9 systemd[1]: Stopping ShinyServer...
Nov 06 01:01:55 e2e-115-9 systemd[1]: shiny-server.service: Main process exited, code=exited, status=143/n/a
Nov 06 01:02:00 e2e-115-9 systemd[1]: shiny-server.service: Failed with result 'exit-code'.
Nov 06 01:02:00 e2e-115-9 systemd[1]: Stopped ShinyServer.
Nov 06 01:02:00 e2e-115-9 systemd[1]: Started ShinyServer.
Nov 06 01:04:02 e2e-115-9 su[2652]: (to rstudio) root on none
Nov 06 01:04:02 e2e-115-9 su[2652]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)
Nov 06 01:04:02 e2e-115-9 su[2655]: (to rstudio) root on none
Nov 06 01:04:02 e2e-115-9 su[2655]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)
Nov 06 01:06:00 e2e-115-9 su[2701]: (to rstudio) root on none
Nov 06 01:06:00 e2e-115-9 su[2701]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)
Nov 06 01:06:00 e2e-115-9 su[2703]: (to rstudio) root on none
Nov 06 01:06:00 e2e-115-9 su[2703]: pam_unix(su-l:session): session opened for user rstudio by (uid=0)

Post reboot there was an error in starting the shiny app as I was experimenting with some setting that did not work, and it was reverted and now the shiny server is running.

But the shiny apps are not getting loaded.

Would appreciate any pointers to where the problem could be.

Note: I also looked up another related question on the rstudio community but it did not have any conclusive answers.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.