Application runs locally, deploys "successfully", but fails to start. Problem with Windows encoding, shapefiles, packages, API key, or something else?

727 views
Skip to first unread message

Cathleen Balantic

unread,
Apr 2, 2018, 6:07:13 PM4/2/18
to shinyapps.io Users

Hi there,


My app runs locally, and I get a "Application successfully deployed" message after running rsconnect::deployApp()


On my shinyapps site, though, I get the dreaded black screen with green text: 



Specifically, the error message is:

An error has occurred.

The application failed to start.

Error in value[[3L]](cond) : replacement has length zero Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> In addition: Warning message: In rep(no, length.out = length(ans)) : 'x' is NULL so the result will be NULL Execution halted 


Things I've tried:

  • I made sure all of my installed packages are up-to-date (as per the troubleshooting guide). RStudio and R are also up-to-date.
  • I call all packages using library() (no packages are being installed in the app, no working directories being set, etc.). Packages I'm using:
    • library(data.table)
    • library(dplyr)
    • library(DT)
    • library(googlesheets)
    • library(leaflet)
    • library(rgdal)
    • library(shiny)
    • library(shinyjs)
  • I checked to ensure that I'm not exceeding 1GB (the app data takes up only about 2MB). When I look at my memory usage under my shinyapps metrics dashboard, my memory peaks at about 6MB, so it looks like this isn't the problem.
  • The app doesn't take very long to load locally, but I tried extending the startup time to 120 seconds just in case this might help. It didn't.
  • Checked my logs using rsconnect::showLogs() -- I can't figure out where the problem is from the logs alone. I've copy-pasted logs below my message in case this is useful.
  • Investigated encoding issues: I'm running this on Windows (have tried it on two separate machines, one running Windows 10, the other Windows 7). I see that shinyapps runs on Linux, and that there can be mismatches between Linux and Windows related to encoding. I've verified that my app's R and md files are saved with UTF-8 encoding (these files include a single R ui + server script for the app, an R file with helper functions which is sourced by the app using a relative file path, and three .md files) .
My app also takes in several shapefiles -- could those also be running into some kind of encoding problem? The shapefiles sit in a 'data' folder within the app's project, and are pointed to and read in using a relative file path, i.e., './data' -- but maybe I am making some basic mistake by doing that.


I'm using the package googlesheets to access a Google Sheet, which requires authentication -- perhaps I've bungled something with this.


Code is here: https://github.com/cbalantic/Birding-GOT, and "data" folder containing shapefiles is attached. I can provide the Google sheet key privately if useful. 


Thank you for any troubleshooting help you can provide! 


Cathleen Balantic



 
> rsconnect::showLogs()
2018-04-02T19:59:38.365636+00:00 shinyapps[313252]: rmarkdown version: 1.9
2018-04-02T19:59:38.365636+00:00 shinyapps[313252]: knitr version: 1.20
2018-04-02T19:59:38.365638+00:00 shinyapps[313252]: RJSONIO version: NA
2018-04-02T19:59:38.365637+00:00 shinyapps[313252]: jsonlite version: 1.5
2018-04-02T19:59:38.365644+00:00 shinyapps[313252]: htmltools version: 0.3.6
2018-04-02T19:59:38.563702+00:00 shinyapps[313252]: Using jsonlite for JSON processing
2018-04-02T19:59:38.657580+00:00 shinyapps[313252]:
2018-04-02T19:59:38.657582+00:00 shinyapps[313252]: Starting R with process ID: '17'
2018-04-02T19:59:38.700764+00:00 shinyapps[313252]: Error in value[[3L]](cond) : replacement has length zero
2018-04-02T19:59:38.700767+00:00 shinyapps[313252]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2018-04-02T19:59:38.700769+00:00 shinyapps[313252]: In addition: Warning message:
2018-04-02T19:59:38.700806+00:00 shinyapps[313252]: In rep(no, length.out = length(ans)) :
2018-04-02T19:59:38.700808+00:00 shinyapps[313252]:   'x' is NULL so the result will be NULL
2018-04-02T19:59:38.700809+00:00 shinyapps[313252]: Execution halted
2018-04-02T19:59:43.324730+00:00 shinyapps[313252]: Server version: 1.5.14-6
2018-04-02T19:59:43.324734+00:00 shinyapps[313252]: LANG: en_US.UTF-8
2018-04-02T19:59:43.324760+00:00 shinyapps[313252]: R version: 3.4.4
2018-04-02T19:59:43.324761+00:00 shinyapps[313252]: shiny version: 1.0.5
2018-04-02T19:59:43.324767+00:00 shinyapps[313252]: rmarkdown version: 1.9
2018-04-02T19:59:43.324796+00:00 shinyapps[313252]: knitr version: 1.20
2018-04-02T19:59:43.324808+00:00 shinyapps[313252]: jsonlite version: 1.5
2018-04-02T19:59:43.324823+00:00 shinyapps[313252]: RJSONIO version: NA
2018-04-02T19:59:43.324827+00:00 shinyapps[313252]: htmltools version: 0.3.6
2018-04-02T21:19:11.778783+00:00 shinyapps[313252]: Server version: 1.5.14-6
2018-04-02T21:19:11.778819+00:00 shinyapps[313252]: LANG: en_US.UTF-8
2018-04-02T21:19:11.778820+00:00 shinyapps[313252]: R version: 3.4.4
2018-04-02T21:19:11.778826+00:00 shinyapps[313252]: shiny version: 1.0.5
2018-04-02T21:19:11.778826+00:00 shinyapps[313252]: rmarkdown version: 1.9
2018-04-02T21:19:11.778837+00:00 shinyapps[313252]: knitr version: 1.20
2018-04-02T21:19:11.778842+00:00 shinyapps[313252]: jsonlite version: 1.5
2018-04-02T21:19:11.778866+00:00 shinyapps[313252]: RJSONIO version: NA
2018-04-02T21:19:11.778867+00:00 shinyapps[313252]: htmltools version: 0.3.6
2018-04-02T21:19:11.970979+00:00 shinyapps[313252]: Using jsonlite for JSON processing
2018-04-02T21:19:12.038742+00:00 shinyapps[313252]:
2018-04-02T21:19:12.082902+00:00 shinyapps[313252]: Error in value[[3L]](cond) : replacement has length zero
2018-04-02T21:19:12.038744+00:00 shinyapps[313252]: Starting R with process ID: '17'
2018-04-02T21:19:12.082906+00:00 shinyapps[313252]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2018-04-02T21:19:12.082923+00:00 shinyapps[313252]: In rep(no, length.out = length(ans)) :
2018-04-02T21:19:12.082907+00:00 shinyapps[313252]: In addition: Warning message:
2018-04-02T21:19:12.082924+00:00 shinyapps[313252]:   'x' is NULL so the result will be NULL
2018-04-02T21:19:12.082924+00:00 shinyapps[313252]: Execution halted
2018-04-02T21:19:16.153193+00:00 shinyapps[313252]: Server version: 1.5.14-6
2018-04-02T21:19:16.153225+00:00 shinyapps[313252]: LANG: en_US.UTF-8
2018-04-02T21:19:16.153226+00:00 shinyapps[313252]: R version: 3.4.4
2018-04-02T21:19:16.153227+00:00 shinyapps[313252]: shiny version: 1.0.5
2018-04-02T21:19:16.153227+00:00 shinyapps[313252]: rmarkdown version: 1.9
2018-04-02T21:19:16.153228+00:00 shinyapps[313252]: knitr version: 1.20
2018-04-02T21:19:16.153228+00:00 shinyapps[313252]: jsonlite version: 1.5
2018-04-02T21:19:16.153229+00:00 shinyapps[313252]: RJSONIO version: NA
2018-04-02T21:19:16.153239+00:00 shinyapps[313252]: htmltools version: 0.3.6
2018-04-02T21:19:16.344518+00:00 shinyapps[313252]: Using jsonlite for JSON processing
 
 
 
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252   
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    
other attached packages:
 [1] rsconnect_0.8.8     yaml_2.1.18         shinyjs_1.0         rgdal_1.2-18        sp_1.2-7            leaflet_1.1.0     
 [7] googlesheets_0.2.2  DT_0.4              dplyr_0.7.4         data.table_1.10.4-3 shiny_1.0.5       
loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16         BiocInstaller_1.26.0 cellranger_1.1.0     pillar_1.2.1         compiler_3.4.4       bindr_0.1.1        
 [7] bitops_1.0-6         tools_3.4.4          packrat_0.4.9-1      digest_0.6.15        evaluate_0.10.1      jsonlite_1.5       
[13] tibble_1.4.2         lattice_0.20-35      pkgconfig_2.0.1      rlang_0.2.0          crosstalk_1.0.0      curl_3.2           
[19] bindrcpp_0.2.2       knitr_1.20           httr_1.3.1           stringr_1.3.0        xml2_1.2.0           hms_0.4.2          
[25] htmlwidgets_1.0      rprojroot_1.3-2      grid_3.4.4           glue_1.2.0           R6_2.2.2             rmarkdown_1.9      
[31] RJSONIO_1.3-0        readr_1.1.1          purrr_0.2.4          magrittr_1.5         backports_1.1.2      htmltools_0.3.6    
[37] assertthat_0.2.0     mime_0.5             xtable_1.8-2         httpuv_1.3.6.2       stringi_1.1.7        RCurl_1.95-4.10    

[43] openssl_1.0.1        markdown_0.8    

 

data.zip

Joshua Spiewak

unread,
Apr 3, 2018, 10:42:27 AM4/3/18
to shinyapps.io Users
Because you do not have an app.R, nor server.R and ui.R, the deploy is deciding that you have a static RMarkdown site and you don't specify shiny as the runtime for the Rmd.

Try renaming got-app.R to app.R and see if that helps.

Cathleen Balantic

unread,
Apr 3, 2018, 11:25:38 AM4/3/18
to shinyapps.io Users
Hi Joshua,

Perfect, that did the trick; I'm up and running! Can't believe I overlooked that, but happy the solution was so simple. 

Best,

Cathleen
Reply all
Reply to author
Forward
0 new messages