Shiny: Disconnected From Server

I have been trying to publish my shinapp and have been running into an error. Whenever I open my app using shinyapps.io it gives the error: "disconnected from the server" within 5 seconds. The app runs perfectly fine locally, however.

I checked the setting of my app on shinyapps.io and the instance size is set to large and the startup and idle timeout are both set to 60 seconds.

This is the code:

library(shiny)
library(tidyverse)
library(ggplot2)

ui <- fluidPage(
    titlePanel(strong("ms_6")),
    sidebarLayout(
        sidebarPanel(
            selectInput("countryInput", "Country",         
                choices = c("Choose one" = "", "Australia", "England","India", "Pakistan"))),
        mainPanel(plotOutput("coolplot"))))

server <- function(input, output) {
    load("./Data/data.Rdata")
    output$plot <-renderPlot({   
    filtered <-  subsetpk %>% filter(team==input$countryInput)  
    filtered %>% ggplot() + geom_point(aes(x = factor(year), 
                               group = factor(bracket),                                
                               color = factor(bracket), y = prop_won), 
                                size=2) +            
                labs(title = "Proportion of Matches won Sorted by Runs Scored in the \n First Five Overs", subtitle = "Sorted According to Run Bracket - Period: 2010-2017",   x = "Year", y = "Proportion Won", col = "Runs Scored Bracket") +  labs(caption = "Source: cricsheet.org") + theme_classic()+  theme(legend.position = "right", axis.text.x = element_text(angle = 45, hjust = 1))})
        
        
}

shinyApp(ui = ui, server = server)



These are the logs:

2020-04-04T07:00:26.371406+00:00 shinyapps[2054208]: Using jsonlite for JSON processing
2020-04-04T07:00:26.379721+00:00 shinyapps[2054208]: 
2020-04-04T07:00:26.379722+00:00 shinyapps[2054208]: Starting R with process ID: '73'
2020-04-04T07:00:27.354468+00:00 shinyapps[2054208]: ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
2020-04-04T07:00:27.359358+00:00 shinyapps[2054208]: ✔ ggplot2 3.2.1     ✔ purrr   0.3.3
2020-04-04T07:00:27.359358+00:00 shinyapps[2054208]: ✔ tibble  2.1.3     ✔ dplyr   0.8.3
2020-04-04T07:00:27.359359+00:00 shinyapps[2054208]: ✔ tidyr   1.0.2     ✔ stringr 1.4.0
2020-04-04T07:00:27.359360+00:00 shinyapps[2054208]: ✔ readr   1.3.1     ✔ forcats 0.4.0
2020-04-04T07:00:27.450046+00:00 shinyapps[2054208]: ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
2020-04-04T07:00:27.450048+00:00 shinyapps[2054208]: ✖ dplyr::filter() masks stats::filter()
2020-04-04T07:00:27.450049+00:00 shinyapps[2054208]: ✖ dplyr::lag()    masks stats::lag()
2020-04-04T07:00:27.463010+00:00 shinyapps[2054208]: 
2020-04-04T07:00:27.463012+00:00 shinyapps[2054208]: Listening on http://127.0.0.1:38406
2020-04-04T07:00:30.336765+00:00 shinyapps[2054208]: Warning in readChar(con, 5L, useBytes = TRUE) :
2020-04-04T07:00:30.336767+00:00 shinyapps[2054208]:   cannot open compressed file './Data/data.Rdata', probable reason 'No such file or directory'
2020-04-04T07:00:30.337569+00:00 shinyapps[2054208]: Warning: Error in readChar: cannot open the connection
2020-04-04T07:00:30.341051+00:00 shinyapps[2054208]:   63: readChar
2020-04-04T07:00:30.341052+00:00 shinyapps[2054208]:   61: server [/srv/connect/apps/ms_6/app.R#31]
2020-04-04T07:00:30.341052+00:00 shinyapps[2054208]:   62: load
2020-04-04T07:00:30.341250+00:00 shinyapps[2054208]: Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
2020-04-04T07:18:56.953407+00:00 shinyapps[2054208]: LANG: en_US.UTF-8
2020-04-04T07:18:56.953386+00:00 shinyapps[2054208]: Server version: 1.8.2-10
2020-04-04T07:18:56.953408+00:00 shinyapps[2054208]: R version: 3.6.2
2020-04-04T07:18:56.953408+00:00 shinyapps[2054208]: shiny version: 1.4.0
2020-04-04T07:18:56.953409+00:00 shinyapps[2054208]: httpuv version: 1.5.2
2020-04-04T07:18:56.953409+00:00 shinyapps[2054208]: rmarkdown version: 2.1
2020-04-04T07:18:56.953410+00:00 shinyapps[2054208]: jsonlite version: 1.6
2020-04-04T07:18:56.953409+00:00 shinyapps[2054208]: knitr version: 1.27
2020-04-04T07:18:56.953429+00:00 shinyapps[2054208]: htmltools version: 0.4.0
2020-04-04T07:18:56.953425+00:00 shinyapps[2054208]: RJSONIO version: (none)
2020-04-04T07:18:56.953617+00:00 shinyapps[2054208]: Using pandoc: /opt/connect/ext/pandoc2
2020-04-04T07:18:57.081510+00:00 shinyapps[2054208]: Using jsonlite for JSON processing
2020-04-04T07:18:57.089072+00:00 shinyapps[2054208]: 
2020-04-04T07:18:57.089072+00:00 shinyapps[2054208]: Starting R with process ID: '26'
2020-04-04T07:18:57.827844+00:00 shinyapps[2054208]: ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
2020-04-04T07:18:57.832017+00:00 shinyapps[2054208]: ✔ ggplot2 3.2.1     ✔ purrr   0.3.3
2020-04-04T07:18:57.832018+00:00 shinyapps[2054208]: ✔ tibble  2.1.3     ✔ dplyr   0.8.3
2020-04-04T07:18:57.832019+00:00 shinyapps[2054208]: ✔ tidyr   1.0.2     ✔ stringr 1.4.0
2020-04-04T07:18:57.832019+00:00 shinyapps[2054208]: ✔ readr   1.3.1     ✔ forcats 0.4.0
2020-04-04T07:18:57.916949+00:00 shinyapps[2054208]: ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
2020-04-04T07:18:57.916950+00:00 shinyapps[2054208]: ✖ dplyr::filter() masks stats::filter()
2020-04-04T07:18:57.916951+00:00 shinyapps[2054208]: ✖ dplyr::lag()    masks stats::lag()
2020-04-04T07:18:57.928484+00:00 shinyapps[2054208]: 
2020-04-04T07:18:57.928484+00:00 shinyapps[2054208]: Listening on http://127.0.0.1:39221
2020-04-04T07:19:08.168093+00:00 shinyapps[2054208]: Warning in readChar(con, 5L, useBytes = TRUE) :
2020-04-04T07:19:08.168095+00:00 shinyapps[2054208]:   cannot open compressed file 'Data/data.Rdata', probable reason 'No such file or directory'
2020-04-04T07:19:08.168846+00:00 shinyapps[2054208]: Warning: Error in readChar: cannot open the connection
2020-04-04T07:19:08.172267+00:00 shinyapps[2054208]:   63: readChar
2020-04-04T07:19:08.172267+00:00 shinyapps[2054208]:   62: load
2020-04-04T07:19:08.172269+00:00 shinyapps[2054208]:   61: server [/srv/connect/apps/ms_6/app.R#31]
2020-04-04T07:19:08.172431+00:00 shinyapps[2054208]: Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection

Thanks for the help!

These seem to be the key lines in the log:

2020-04-04T07:19:08.168093+00:00 shinyapps[2054208]: Warning in readChar(con, 5L, useBytes = TRUE) :
2020-04-04T07:19:08.168095+00:00 shinyapps[2054208]:   cannot open compressed file 'Data/data.Rdata', probable reason 'No such file or directory'
1 Like