rstudio / shiny

Easy interactive web applications with R
http://shiny.rstudio.com
Other
5.3k stars 1.87k forks source link

shiny app examples crashes without error #4059

Closed wvictor14 closed 1 month ago

wvictor14 commented 1 month ago

Describe the problem in detail

My shiny apps today are suddenly all crashing without any error showing in R console. I run an app from rstudio-server (ubuntu 22) on R version 4.4.0, shiny 1.8.1 and the app greys out as if an error occurred. Even occurs running shiny example apps via shiny::runExample

See screenshot of dead app:

image

System details

Browser Version:

Output of sessionInfo():

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: America/Los_Angeles
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bslib_0.7.0   shiny_1.8.1.1

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       cli_3.6.2         rlang_1.1.3      
 [4] promises_1.3.0    jsonlite_1.8.8    xtable_1.8-4     
 [7] glue_1.7.0        htmltools_0.5.8.1 httpuv_1.6.15    
[10] sass_0.4.9        fansi_1.0.6       jquerylib_0.1.4  
[13] tibble_3.2.1      fastmap_1.1.1     lifecycle_1.0.4  
[16] memoise_2.0.1     compiler_4.4.0    fs_1.6.4         
[19] pkgconfig_2.0.3   Rcpp_1.0.12       rstudioapi_0.16.0
[22] later_1.3.2       digest_0.6.35     R6_2.5.1         
[25] utf8_1.2.4        pillar_1.9.0      magrittr_2.0.3   
[28] tools_4.4.0       withr_3.0.0       mime_0.12        
[31] cachem_1.0.8     

Example application or steps to reproduce the problem

```R Restarting R session... > library(shiny) > shiny::runExample() Valid examples in {shiny}: "01_hello", "02_text", "03_reactivity", "04_mpg", "05_sliders", "06_tabsets", "07_widgets", "08_html", "09_upload", "10_download", "11_timer" > shiny::runExample('01_hello') Attaching package: ‘bslib’ The following object is masked from ‘package:utils’: page Listening on http://127.0.0.1:5809 ```
wvictor14 commented 1 month ago

I have discovered that the apps will run if started from R from bash, rather than directly in my rstudio-server console.

This made me think that maybe it is an issue with running shiny from Rstudio-server. So I updated to one of the recent rstudio-server dailies but still bug is not fixed

https://dailies.rstudio.com/rstudio/chocolate-cosmos/server/jammy-amd64/ rstudio-server-2024.04.2-755-amd64.deb

cpsievert commented 1 month ago

Do you see anything else in the viewer when running shiny::devmode(TRUE) before launching the app?

cpsievert commented 1 month ago

There might also be something weird with the default graphics device...

wvictor14 commented 1 month ago

Hi @cpsievert, thank you for your help,

shiny::plotPNG(function() plot(1)) #runs without error [1] "/tmp/RtmpmdNfhq/file78241653308.png"

I updated ragg to v1.3.2 (latest) and still error occurs

I tried running shiny::devmode(TRUE) before running the shiny example app and no informative messages appear in console / viewer

> shiny::devmode(TRUE);shiny::runExample('01_hello')
shiny devmode - Turning on shiny autoreload. To disable, call `options(shiny.autoreload = FALSE)`
This message is displayed once every 8 hours.

Listening on http://127.0.0.1:7135
shiny devmode - Using full shiny javascript file. To use the minified version, call `options(shiny.minified = TRUE)`
This message is displayed once every 8 hours.
shiny devmode - Turning off caching of Sass -> CSS compilation. To turn caching on, call `options(sass.cache = TRUE)`
This message is displayed once every 8 hours.
shiny devmode - Disabling the use of bslib precompiled themes. To be able to use precompiled themes, call `options(bslib.precompiled = TRUE)`
This message is displayed once every 8 hours.
shiny devmode - Enabling warnings about low color contrasts found inside `bslib::bs_theme()`. To suppress these warnings, set `options(bslib.color_contrast_warnings = FALSE)`
This message is displayed once every 8 hours.
cpsievert commented 1 month ago

Huh, ok, if you right-click -> Inspect -> Console do you see (JavaScript) errors?

jeremydudek commented 1 month ago

Hello, I have a similar issue since, I am not able to launch the shiny app example.

R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2012 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252 [4] LC_NUMERIC=C LC_TIME=German_Switzerland.1252

time zone: Europe/Zurich tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] bslib_0.7.0 shiny_1.8.1.1

loaded via a namespace (and not attached): [1] digest_0.6.35 later_1.3.2 R6_2.5.1 httpuv_1.6.15 fastmap_1.2.0 magrittr_2.0.3
[7] cachem_1.1.0 memoise_2.0.1 htmltools_0.5.8.1 lifecycle_1.0.4 promises_1.3.0 cli_3.6.1
[13] xtable_1.8-4 sass_0.4.9 jquerylib_0.1.4 withr_3.0.0 compiler_4.3.1 rstudioapi_0.16.0 [19] tools_4.3.1 mime_0.12 Rcpp_1.0.12

And I only get this message : Error in is.call(funBody[[idx]]) && as.character(funBody[[idx]][[1]]) ==  :   'length = 3' in coercion to 'logical(1)'

wvictor14 commented 1 month ago

It is very strange but it seems that the error has went away after these few days...

I can update if encountered again, but otherwise feelfree to close this issue