error deploying to shinyapps.io

131 views
Skip to first unread message

Nate Klass

unread,
Apr 24, 2018, 4:10:11 PM4/24/18
to shinyapps.io Users
Hi there,

I have successfully created an app locally, and am trying to deploy to shinyapps.io. I keep running into the same error:















I understand that something in my shinydashboard library is being masked by graphics (or do I have that backwards), but I'm not sure why it's blocking me from being able to deploy.

Does anyone know what the issue might be?

Any help is appreciated.

Nate

Nate Klass

unread,
Apr 24, 2018, 4:11:48 PM4/24/18
to shinyapps.io Users
Sorry, should have mentioned, it says in R that it deploys successfully but when the browser opens, it shows the error I screenshotted.

Thanks,
Nate

Joshua Spiewak

unread,
Apr 24, 2018, 4:14:00 PM4/24/18
to shinyapps.io Users
What is in your application's logs?

Nate Klass

unread,
Apr 24, 2018, 4:18:22 PM4/24/18
to shinyapps.io Users
> rsconnect::showLogs
function (appPath = getwd(), appFile = NULL, appName = NULL, 
    account = NULL, entries = 50, streaming = FALSE) 
{
    target <- deploymentTarget(appPath, appName, NULL, NULL, 
        account)
    accountDetails <- accountInfo(target$account)
    client <- lucidClient(shinyappsServerInfo()$url, accountDetails)
    application <- getAppByName(client, accountDetails, target$appName)
    if (is.null(application)) 
        stop("No application found. Specify the application's directory, name, ", 
            "and/or associated account.")
    if (streaming) {
        httpType <- getOption("rsconnect.http", "rcurl")
        if (!identical("rcurl", httpType)) {
            stop("RCurl is required to show streaming logs. Install RCurl and set ", 
                "rsconnect.http to 'rcurl', or call showLogs with streaming = ", 
                "FALSE to show a log snapshot.")
        }
    }
    if (streaming) {
        rPath <- file.path(R.home("bin"), "R")
        killfile <- tempfile()
        outfile <- tempfile()
        on.exit(unlink(outfile), add = TRUE)
        cmd <- paste0("rsconnect:::showStreamingLogs(", "account = '", 
            target$account, "', ", "applicationId = '", application$id, 
            "', ", "entries = ", entries, ", ", "outfile = '", 
            gsub("\\", "\\\\", outfile, fixed = TRUE), "', ", 
            "killfile = '", gsub("\\", "\\\\", killfile, fixed = TRUE), 
            "')")
        args <- paste("--vanilla", "--slave", paste0("-e \"", 
            cmd, "\""))
        system2(command = rPath, args = args, stdout = NULL, 
            stderr = NULL, wait = FALSE)
        tries <- 0
        repeat {
            tryCatch({
                Sys.sleep(0.1)
                tries <- tries + 1
                logReader <- file(outfile, open = "rt", blocking = FALSE)
                break
            }, error = function(e, ...) {
                if (tries > 500) {
                  stop("Failed to start log listener.")
                }
            }, warning = function(...) {
            })
        }
        on.exit(close(logReader), add = TRUE)
        repeat {
            tryCatch({
                if (file.exists(killfile)) 
                  break
                writeLines(readLines(con = logReader, warn = FALSE))
                Sys.sleep(0.1)
            }, interrupt = function(...) {
                close(file(killfile, open = "wt"))
            }, error = function(e, ...) {
                print(e$message)
            })
        }
    }
    else {
        logs <- client$getLogs(application$id, entries, FALSE, 
            NULL)
        cat(logs)
    }
}
<environment: namespace:rsconnect>

Joshua Spiewak

unread,
Apr 24, 2018, 4:19:41 PM4/24/18
to shinyapps.io Users
You need to call it with parens, rsconnect::showLogs()

Nate Klass

unread,
Apr 24, 2018, 4:37:04 PM4/24/18
to shinyapps.io Users
Oops. My mistake.

2018-04-24T20:26:29.890771+00:00 shinyapps[328088]: epsg (SRID):    NA
2018-04-24T20:26:29.890783+00:00 shinyapps[328088]: proj4string:    +proj=lcc +lat_1=39.93333333333333 +lat_2=40.96666666666667 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs
2018-04-24T20:26:29.934829+00:00 shinyapps[328088]: Reading layer `Census_Block_Groups_2010' from data source `/srv/connect/apps/foreclosurewarningsystem/Census_Block_Groups_2010.shp' using driver `ESRI Shapefile'
2018-04-24T20:26:30.063379+00:00 shinyapps[328088]: Simple feature collection with 1336 features and 15 fields
2018-04-24T20:26:30.063383+00:00 shinyapps[328088]: geometry type:  POLYGON
2018-04-24T20:26:30.063406+00:00 shinyapps[328088]: dimension:      XY
2018-04-24T20:26:30.063486+00:00 shinyapps[328088]: epsg (SRID):    4326
2018-04-24T20:26:30.063501+00:00 shinyapps[328088]: proj4string:    +proj=longlat +datum=WGS84 +no_defs
2018-04-24T20:26:30.079398+00:00 shinyapps[328088]: Reading layer `neighborhood_blocks-new' from data source `/srv/connect/apps/foreclosurewarningsystem/neighborhood_blocks-new.shp' using driver `ESRI Shapefile'
2018-04-24T20:26:30.146296+00:00 shinyapps[328088]: geometry type:  POLYGON
2018-04-24T20:26:30.146382+00:00 shinyapps[328088]: bbox:           xmin: -75.28031 ymin: 39.86747 xmax: -74.95575 ymax: 40.13793
2018-04-24T20:26:30.146394+00:00 shinyapps[328088]: epsg (SRID):    4326
2018-04-24T20:26:30.146315+00:00 shinyapps[328088]: dimension:      XY
2018-04-24T20:26:30.063444+00:00 shinyapps[328088]: bbox:           xmin: -75.28031 ymin: 39.86747 xmax: -74.95575 ymax: 40.13793
2018-04-24T20:26:30.146408+00:00 shinyapps[328088]: proj4string:    +proj=longlat +datum=WGS84 +no_defs
2018-04-24T20:26:30.159822+00:00 shinyapps[328088]: Reading layer `alldata_randmizedPreds' from data source `/srv/connect/apps/foreclosurewarningsystem/alldata_randmizedPreds.shp' using driver `ESRI Shapefile'
2018-04-24T20:26:30.146293+00:00 shinyapps[328088]: Simple feature collection with 1336 features and 24 fields
2018-04-24T20:27:02.508228+00:00 shinyapps[system]: Out of memory!
2018-04-24T20:35:51.196261+00:00 shinyapps[328088]: Server version: 1.6.0-9
2018-04-24T20:35:51.196313+00:00 shinyapps[328088]: R version: 3.4.3
2018-04-24T20:35:51.196315+00:00 shinyapps[328088]: shiny version: 1.0.5
2018-04-24T20:35:51.196317+00:00 shinyapps[328088]: rmarkdown version: 1.9
2018-04-24T20:35:51.196318+00:00 shinyapps[328088]: knitr version: 1.20
2018-04-24T20:35:51.196264+00:00 shinyapps[328088]: LANG: en_US.UTF-8
2018-04-24T20:35:51.196318+00:00 shinyapps[328088]: jsonlite version: 1.5
2018-04-24T20:35:51.196319+00:00 shinyapps[328088]: RJSONIO version: NA
2018-04-24T20:35:51.196319+00:00 shinyapps[328088]: htmltools version: 0.3.6
2018-04-24T20:35:52.229283+00:00 shinyapps[328088]: ── Attaching packages ─────────────────────────────────────── tidyverse 1.2.1 ──
2018-04-24T20:35:52.234800+00:00 shinyapps[328088]: ✔ ggplot2 2.2.1.9000     ✔ purrr   0.2.4     
2018-04-24T20:35:52.234802+00:00 shinyapps[328088]: ✔ tibble  1.4.2          ✔ dplyr   0.7.4     
2018-04-24T20:35:52.234803+00:00 shinyapps[328088]: ✔ tidyr   0.8.0          ✔ stringr 1.3.0     
2018-04-24T20:35:52.234804+00:00 shinyapps[328088]: ✔ readr   1.1.1          ✔ forcats 0.3.0     
2018-04-24T20:35:52.397622+00:00 shinyapps[328088]: ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
2018-04-24T20:35:52.397626+00:00 shinyapps[328088]: ✖ dplyr::lag()    masks stats::lag()
2018-04-24T20:35:52.397625+00:00 shinyapps[328088]: ✖ dplyr::filter() masks stats::filter()
2018-04-24T20:35:52.639486+00:00 shinyapps[328088]: Linking to GEOS 3.5.0, GDAL 2.1.0, proj.4 4.8.0
2018-04-24T20:35:52.701135+00:00 shinyapps[328088]: 
2018-04-24T20:35:52.701138+00:00 shinyapps[328088]: Attaching package: ‘shinydashboard’
2018-04-24T20:35:52.701140+00:00 shinyapps[328088]: 
2018-04-24T20:35:52.701835+00:00 shinyapps[328088]: The following object is masked from ‘package:graphics’:
2018-04-24T20:35:52.701836+00:00 shinyapps[328088]: 
2018-04-24T20:35:52.701836+00:00 shinyapps[328088]:     box
2018-04-24T20:35:52.701837+00:00 shinyapps[328088]: 
2018-04-24T20:35:52.780061+00:00 shinyapps[328088]: geometry type:  POLYGON
2018-04-24T20:35:52.780097+00:00 shinyapps[328088]: dimension:      XY
2018-04-24T20:35:52.730291+00:00 shinyapps[328088]: Reading layer `Neighborhoods_Philadelphia' from data source `/srv/connect/apps/foreclosurewarningsystem/Neighborhoods_Philadelphia.shp' using driver `ESRI Shapefile'
2018-04-24T20:35:52.780057+00:00 shinyapps[328088]: Simple feature collection with 158 features and 5 fields
2018-04-24T20:35:52.780140+00:00 shinyapps[328088]: bbox:           xmin: 2660586 ymin: 204650.6 xmax: 2750109 ymax: 304965.3
2018-04-24T20:35:52.780153+00:00 shinyapps[328088]: epsg (SRID):    NA
2018-04-24T20:35:52.780203+00:00 shinyapps[328088]: proj4string:    +proj=lcc +lat_1=39.93333333333333 +lat_2=40.96666666666667 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs
2018-04-24T20:35:52.821901+00:00 shinyapps[328088]: Reading layer `Census_Block_Groups_2010' from data source `/srv/connect/apps/foreclosurewarningsystem/Census_Block_Groups_2010.shp' using driver `ESRI Shapefile'

Joshua Spiewak

unread,
Apr 24, 2018, 4:43:31 PM4/24/18
to shinyapps.io Users
2018-04-24T20:27:02.508228+00:00 shinyapps[system]: Out of memory!

Try a larger instance type, or make the application more memory efficient.

Nate Klass

unread,
Apr 24, 2018, 5:52:01 PM4/24/18
to shinyapps.io Users
Thanks Josh - I'll focus my attention on efficiency. I'm already using a large instance type, so unless I pay for more space, it seems like efficiency is the best option.

Nate Klass

unread,
Apr 26, 2018, 1:43:17 PM4/26/18
to shinyapps.io Users
Hi Josh,

Do you know of ways that I can see how much storage and/or memory my app is using. I need to create an argument for my professor as to why purchasing more memory is needed, and he is looking for an understanding of how much over on storage and memory our app is. 

Any guidance would be appreciated!

Thanks,
Nate

Joshua Spiewak

unread,
Apr 26, 2018, 3:46:52 PM4/26/18
to shinyapps.io Users
You can run it locally and see how much memory the R process consumes.
If you reduce the amount of data loaded such that it doesn't run out of memory on shinyapps.io, we provide metrics at 1 minute granularity that can be viewed on the dashboard or obtained via the rsconnect package.
You can add gc() statements to your application to log memory usage.

I am sure there might be other ways, but honestly, I am not actually an expert at R. :)
Reply all
Reply to author
Forward
0 new messages