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

Shiny server disconnected from the server: The application unexpectedly exited #4097

Closed
jk45019975 opened this issue Jul 10, 2024 · 10 comments
Closed

Comments

@jk45019975
Copy link

We have a web-based Shiny server application that is used to copy files in a virtual machine from Azure.

As a user, after visiting the application, I encounter an error in the UI showing Disconnected from Server with a reload option.

image (1)

Upon further inspection in the developer tools (Microsoft Edge) on console, I can see the message:

“The application unexpectedly exited. Diagnostic information is private. Please ask your system admin for permission if you need to check the R logs.”

We have a server.R file where I have set the log level to TRACE. However, we are not able to see the root cause, or any information related to the “Disconnected from Server” issue in these logs.

I would appreciate any suggestions on how we should monitor R logs to diagnose this issue. If anyone has faced a similar issue with their Shiny app, your help would be greatly appreciated.

Thanks in advance!

@gadenbuie
Copy link
Member

Duplicate of #4096, opened accidentally?

@gadenbuie gadenbuie closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
@jk45019975
Copy link
Author

yes

@sanitingz
Copy link

@jk45019975 I had the same issue, my app run in docker env.
Edit /etc/shiny-server/shiny-server.conf, and add "sanitize_errors false;" , the detail error message will show in brower console. my case is miss a library.

@ndeke254
Copy link

@jk45019975 I had the same issue, my app run in docker env. Edit /etc/shiny-server/shiny-server.conf, and add "sanitize_errors false;" , the detail error message will show in brower console. my case is miss a library.

@sanitingz This was helpful! Thanks.

@Shubhamdhadag
Copy link

hello I'm also facing same issue plz help me

@ndeke254
Copy link

@Shubhamdhadag after including the "sanitize_errors false;" in you conf, inspect and check the console tab for the error. Mine was also a missing library.

@Shubhamdhadag
Copy link

Hi so i am making an dashboard using shiny . my dashboard is runnig on local R but when i open it on shiny after some sec the page crash and disconnected from server Reload comes
and i am not able to see my data also

Mon Jan 13 2025 01:55:04 GMT+0530 (India Standard Time) [INF]: Connection opened. https://shubhamdhadage.shinyapps.io/project/
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:04 GMT+0530 (India Standard Time) [DBG]: Open channel 0
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:12 GMT+0530 (India Standard Time) [DBG]: 1 message(s) discarded from buffer
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:21 GMT+0530 (India Standard Time) [DBG]: 2 message(s) discarded from buffer
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:28 GMT+0530 (India Standard Time) [INF]: Connection closed. Info: {"type":"close","bubbles":false,"cancelable":false,"timeStamp":1736713528827,"wasClean":true,"code":4702,"reason":"Error reading from Shiny"}
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:28 GMT+0530 (India Standard Time) [DBG]: SockJS connection closed
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:28 GMT+0530 (India Standard Time) [DBG]: Channel 0 is closed
shiny-server-client.min.js:1 Mon Jan 13 2025 01:55:28 GMT+0530 (India Standard Time) [DBG]: Removed channel 0, 0 left
This is my console
and below is my logs of shiny
2025-01-12T20:42:58.962751+00:00 shinyapps[13702825]: LANG: C.UTF-8
2025-01-12T20:42:58.968457+00:00 shinyapps[13702825]: Working directory: /srv/connect/apps/project
2025-01-12T20:42:58.972628+00:00 shinyapps[13702825]: Using R 4.4.2
2025-01-12T20:42:58.976871+00:00 shinyapps[13702825]: R.home(): /opt/R/4.4.2/lib/R
2025-01-12T20:42:58.981088+00:00 shinyapps[13702825]: Content will use current R environment
2025-01-12T20:42:58.985225+00:00 shinyapps[13702825]: R_LIBS: (unset)
2025-01-12T20:42:58.989376+00:00 shinyapps[13702825]: .libPaths(): /usr/lib/R, /opt/R/4.4.2/lib/R/library
2025-01-12T20:42:58.993741+00:00 shinyapps[13702825]: shiny version: 1.10.0
2025-01-12T20:42:58.997989+00:00 shinyapps[13702825]: httpuv version: 1.6.15
2025-01-12T20:42:59.002030+00:00 shinyapps[13702825]: rmarkdown version: 2.29
2025-01-12T20:42:59.006193+00:00 shinyapps[13702825]: knitr version: 1.49
2025-01-12T20:42:59.010214+00:00 shinyapps[13702825]: jsonlite version: 1.8.9
2025-01-12T20:42:59.014294+00:00 shinyapps[13702825]: RJSONIO version: (none)
2025-01-12T20:42:59.018615+00:00 shinyapps[13702825]: htmltools version: 0.5.8.1
2025-01-12T20:42:59.022833+00:00 shinyapps[13702825]: reticulate version: (none)
2025-01-12T20:42:59.027129+00:00 shinyapps[13702825]: Using pandoc: /opt/connect/ext/pandoc/2.16
2025-01-12T20:42:59.031360+00:00 shinyapps[13702825]:
2025-01-12T20:42:59.036014+00:00 shinyapps[13702825]: Starting R with process ID: '32'
2025-01-12T20:42:59.040625+00:00 shinyapps[13702825]: Shiny application starting ...
2025-01-12T20:42:59.045008+00:00 shinyapps[13702825]:
2025-01-12T20:42:59.048982+00:00 shinyapps[13702825]: Attaching package: ‘shinydashboard’
2025-01-12T20:42:59.053199+00:00 shinyapps[13702825]:
2025-01-12T20:42:59.057115+00:00 shinyapps[13702825]: The following object is masked from ‘package:graphics’:
2025-01-12T20:42:59.061126+00:00 shinyapps[13702825]:
2025-01-12T20:42:59.066183+00:00 shinyapps[13702825]: box
2025-01-12T20:42:59.070250+00:00 shinyapps[13702825]:
2025-01-12T20:42:59.074530+00:00 shinyapps[13702825]: Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
2025-01-12T20:43:01.933414+00:00 shinyapps[13702825]: Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
2025-01-12T20:43:01.942847+00:00 shinyapps[13702825]: remotes::install_github('r-tmap/tmap')
2025-01-12T20:43:01.948063+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.953131+00:00 shinyapps[13702825]: Attaching package: ‘dplyr’
2025-01-12T20:43:01.957511+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.962013+00:00 shinyapps[13702825]: The following objects are masked from ‘package:stats’:
2025-01-12T20:43:01.966562+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.970962+00:00 shinyapps[13702825]: filter, lag
2025-01-12T20:43:01.975292+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.979651+00:00 shinyapps[13702825]: The following objects are masked from ‘package:base’:
2025-01-12T20:43:01.983927+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.988188+00:00 shinyapps[13702825]: intersect, setdiff, setequal, union
2025-01-12T20:43:01.992648+00:00 shinyapps[13702825]:
2025-01-12T20:43:01.997128+00:00 shinyapps[13702825]: Reading layer NFHS_4_Dist_PoK_CoL_Updated_Fixed' from data source 2025-01-12T20:43:02.001479+00:00 shinyapps[13702825]: /srv/connect/apps/project/NFHS_4_Dist_PoK_CoL_Updated_Fixed.shp'
2025-01-12T20:43:02.005869+00:00 shinyapps[13702825]: using driver `ESRI Shapefile'
2025-01-12T20:43:02.934331+00:00 shinyapps[13702825]: Simple feature collection with 642 features and 4 fields
2025-01-12T20:43:02.938561+00:00 shinyapps[13702825]: Geometry type: MULTIPOLYGON
2025-01-12T20:43:02.942552+00:00 shinyapps[13702825]: Dimension: XY
2025-01-12T20:43:02.946854+00:00 shinyapps[13702825]: Bounding box: xmin: 68.16256 ymin: 6.752917 xmax: 97.39555 ymax: 37.09701
2025-01-12T20:43:02.950995+00:00 shinyapps[13702825]: Geodetic CRS: WGS 84
2025-01-12T20:43:03.933912+00:00 shinyapps[13702825]:
2025-01-12T20:43:03.938539+00:00 shinyapps[13702825]: Listening on http://127.0.0.1:39897

@jcheng5
Copy link
Member

jcheng5 commented Jan 13, 2025

@Shubhamdhadag First guess is you’re hitting the RAM limit for that container and the process is being killed. Can you start by either redeploying with a small subset of the data to see if that might be the reason? Or you can increase the instance size in shinyapps settings.

@Shubhamdhadag
Copy link

Shubhamdhadag commented Jan 16, 2025

Thank you. It is working with a subset of data. But my total app size is 47 MB, so why is it crashing? We are having a limit of 1 GB for free.

@gadenbuie
Copy link
Member

@Shubhamdhadag you might find this talk helpful. It's an old talk but the concepts and tools haven't changed since it was given. https://posit.co/resources/videos/profiling/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants