Error starting app, package not found

Hello,

How are you? I am having a similar problem now. I do not have install.packages in my code but I am getting these messages:

2022-05-26T23:57:50.347703+00:00 shinyapps[2508390]: Starting R with process ID: '200'
2022-05-26T23:57:50.347749+00:00 shinyapps[2508390]: Shiny application starting ...
2022-05-26T23:57:50.347790+00:00 shinyapps[2508390]: Error in value[3L] : there is no package called ‘shinyWidgets’
2022-05-26T23:57:50.347878+00:00 shinyapps[2508390]: Execution halted
2022-05-26T23:57:50.347922+00:00 shinyapps[2508390]: Shiny application exiting ...
2022-05-26T23:57:50.347834+00:00 shinyapps[2508390]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->

Could you help me to understand what is going on?

Thank you very much!

Do you have a library call for this package in your code?

library(shinyWidgets)

If not, try adding it and re-deploy the app.

Yes, I have this package loaded in the app script. When I Run App without deploying the app works just fine. But when I deploy it I have this problem!

Thank you!

That package is not being installed into the container for your app for some reason but we don't have enough information to troubleshoot, can you re-deploy your app and see if you get any warnings or error messages in the console concerning package installation issues?
Does your app's code contain non-ASCII characters in it? If so, it is possible that shinyapps.io is failing to parse the content thus not recognizing the package dependency.

I tried taking out the shinyWidgets library because is was not used, but now I get the same error message with shinydashboard library. I ran this line yesterday from another user:

update.packages(lib.loc = "/data/R-libs/x86_64-pc-linux-gnu-library/3.4/", ask=FALSE, checkBuilt=TRUE)

And I got some error messages, after this, the app got these error messages.

Here I put more LOG data of the app:
2022-05-27T15:02:09.447244+00:00 shinyapps[2508390]: Running on host: faa63cfcffe9
2022-05-27T15:02:09.447297+00:00 shinyapps[2508390]: Server version: 2022.03.1
2022-05-27T15:02:09.447347+00:00 shinyapps[2508390]: LANG: C.UTF-8
2022-05-27T15:02:09.447439+00:00 shinyapps[2508390]: R version: 3.4.4
2022-05-27T15:02:09.447740+00:00 shinyapps[2508390]: htmltools version: 0.5.2
2022-05-27T15:02:09.447489+00:00 shinyapps[2508390]: shiny version: 1.7.1
2022-05-27T15:02:09.447698+00:00 shinyapps[2508390]: RJSONIO version: (none)
2022-05-27T15:02:09.447898+00:00 shinyapps[2508390]: Using jsonlite for JSON processing
2022-05-27T15:02:09.447605+00:00 shinyapps[2508390]: knitr version: (none)
2022-05-27T15:02:09.447848+00:00 shinyapps[2508390]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-05-27T15:02:09.447528+00:00 shinyapps[2508390]: httpuv version: 1.6.5
2022-05-27T15:02:09.447788+00:00 shinyapps[2508390]: reticulate version: (none)
2022-05-27T15:02:09.447650+00:00 shinyapps[2508390]: jsonlite version: 1.8.0
2022-05-27T15:02:09.448120+00:00 shinyapps[2508390]: Shiny application exiting ...
2022-05-27T15:02:09.447398+00:00 shinyapps[2508390]: Working directory: /srv/connect/apps/Test-5_PanelQPE
2022-05-27T15:02:09.447564+00:00 shinyapps[2508390]: rmarkdown version: (none)
2022-05-27T15:02:09.448157+00:00 shinyapps[2508390]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
2022-05-27T15:02:09.447938+00:00 shinyapps[2508390]:
2022-05-27T15:02:09.448007+00:00 shinyapps[2508390]: Starting R with process ID: '179'
2022-05-27T15:02:09.448046+00:00 shinyapps[2508390]: Shiny application starting ...
2022-05-27T15:02:09.448079+00:00 shinyapps[2508390]: Error in value[3L] : there is no package called ‘shinydashboard’
2022-05-27T15:02:09.448203+00:00 shinyapps[2508390]: Execution halted

Sorry but I think we don't have enough information to help you with this, I still suspect this is an encoding issue but you have not answered my request for further clarification so I can't be sure.

I am not sure about the non-ASCII characters question, what do you mean?

When I deploy the app I get everything ok:
Preparing to deploy application...
Update application currently deployed at
https://dsssmn.shinyapps.io/Test-5_PanelQPE/? [Y/n] Y
DONE
Uploading bundle for application: 2508390...DONE
Deploying bundle: 5951866 for application: 2508390 ...
Waiting for task: 1160644386
building: Processing bundle: 5951866
building: Parsing manifest
building: Installing packages
building: Installing files
building: Pushing image: 6949852
deploying: Starting instances
rollforward: Activating new instances
terminating: Stopping old instances
Application successfully deployed to https://dsssmn.shinyapps.io/Test-5_PanelQPE/

Thank you!

In practical terms I mean non English characters, like letters with accents (e. g. á, é, í, ü, etc)

Can you show your app's code? I still can't see any evident cause with the information we have so far.

my educated guess is that your R version is 3.4, and that this might cause an issue? I consider 3.4 to be 'ancient'.
perhaps try a more modern R version, 3.6 at a minimum, or probably better something over 4 --- just a guess in the dark.

Hello nirgrahamuk,

It could be this option, but the truth is that the app was working just fine yesterday. After running:

update.packages(lib.loc = "/data/R-libs/x86_64-pc-linux-gnu-library/3.4/", ask=FALSE, checkBuilt=TRUE)

it crashed

Anyway, I will consider this option! Thank you!

Oh ok, no, I tried taking out the accents but I get the same error.

Of course, I leave here my code. Thank you very much!

library("shiny"         )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
#library("shinyWidgets"  )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("shinydashboard")#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("leaflet"       )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("lubridate"     )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")

# Set up the UI 
ui <- dashboardPage(
    dashboardHeader(title = "Panel QPE - Control de ejecución", titleWidth = 350),
    
    dashboardSidebar(
      sidebarMenu(
        sliderInput("DatesMerge", label = "Seleccion de fecha del control:", 
                    min = as.Date(Sys.Date() - 30, "%Y-%m-%d"), 
                    max = as.Date(Sys.Date()    , "%Y-%m-%d"), 
                    value = as.Date(Sys.Date()), 
                    timeFormat = "%Y-%m-%d",
                    width = 250, dragRange = FALSE),
      menuItem("QPE Merge", tabName = "maps", icon = icon("globe"),
               menuSubItem("Control archivos de entrada IMERG"            , tabName = "c_files_1", icon = icon("table")),
               menuSubItem("Control archivos de entrada OBS"              , tabName = "c_files_2", icon = icon("table")),
               menuSubItem("Estaciones utilizadas y BIAS interpolado v0.1", tabName = "c_algor_1"  , icon = icon("map")),
               menuSubItem("IMERG-ER y SQPE-OBS-v0.1"                     , tabName = "c_algor_2"  , icon = icon("map")),
               menuSubItem("Estaciones utilizadas y BIAS interpolado v0.2", tabName = "c_algor_3"  , icon = icon("map")),
               menuSubItem("IMERG-ER y SQPE-OBS-v0.2"                     , tabName = "c_algor_4"  , icon = icon("map"), selected = TRUE)),
      menuItem("Aplicaciones hidrologicas", tabName = "maps", icon = icon("globe"),
               menuSubItem("Garruchos"            , tabName = "c_algor_5", icon = icon("table")),
               menuSubItem("Paso de los Libres"     , tabName = "c_algor_6", icon = icon("table")))
        ), width = 320
      ),
    
    dashboardBody(tabItems(
      tabItem(tabName = "c_files_1", fluidRow(box(title = "Seccion del Panel del Control: archivos de entrada IMERG-ER",
                                                  collapsible = TRUE, width = "100%", height = "100%",
                                                  htmlOutput("data_files_1")))),
      tabItem(tabName = "c_files_2", fluidRow(box(title = "Seccion del Panel del Control: archivos de entrada OBS", 
                                                  collapsible = TRUE, width = "100%", height = "100%",
                                                  htmlOutput("data_files_2")))),
      tabItem(tabName = "c_algor_1"  , fluidRow(box(title = "Seccion del Panel del Control: estaciones utilizadas y BIAS interpolado", 
                                                  collapsible = TRUE, width = "100%",
                                                  imageOutput("data_algor_1")))),
      tabItem(tabName = "c_algor_2"  , fluidRow(box(title = "Seccion del Panel del Control: mapas IMERG-ER y SQPE-OBS-v0.1", 
                                                  collapsible = TRUE, width = "100%",
                                                  imageOutput("data_algor_2")))),
      tabItem(tabName = "c_algor_3"  , fluidRow(box(title = "Seccion del Panel del Control: estaciones utilizadas y BIAS interpolado", 
                                                  collapsible = TRUE, width = "100%",
                                                  imageOutput("data_algor_3")))),
      tabItem(tabName = "c_algor_4"  , fluidRow(box(title = "Seccion del Panel del Control: mapas IMERG-ER y SQPE-OBS-v0.2", 
                                                  collapsible = TRUE, width = "100%",
                                                  imageOutput("data_algor_4")))),
      tabItem(tabName = "c_algor_5"  , fluidRow(box(title = "Simulaciones de caudal - Rio Uruguay (Garruchos)", 
                                                    collapsible = TRUE, width = "100%",
                                                    imageOutput("data_algor_5")))),
      tabItem(tabName = "c_algor_6"  , fluidRow(box(title = "Simulaciones de caudal - Rio Uruguay (Paso de los Libres)", 
                                                    collapsible = TRUE, width = "100%",
                                                    imageOutput("data_algor_6"))))
      )
    )
)




# Define a server for the Shiny app
server <- function (input, output) 
{
  
  rv.listado <- reactive({
    imerg <- as.character(seq(from = as.POSIXct(paste0(input$DatesMerge - 1, " 12:00:00"), tz = "UTC"), 
                              to = as.POSIXct(paste0(input$DatesMerge, " 11:30:00"), tz = "UTC"), 
                              by = "30 min"))
    listado.dia1 <- list.files(path = paste0("/ms-36/ESTPP/1_HourlyData/imerg_er/", year(input$DatesMerge), "/"), 
                               pattern = paste0("3B-HHR-E.MS.MRG.3IMERG.", format(input$DatesMerge - 1, "%Y%m%d"), "-S", 
                                                "\\d{6}\\-E", "\\d{6}\\", ".", "\\d{4}\\", ".V06B.RT-H5"))
    listado.dia2 <- list.files(path = paste0("/ms-36/ESTPP/1_HourlyData/imerg_er/", year(input$DatesMerge), "/"), 
                               pattern = paste0("3B-HHR-E.MS.MRG.3IMERG.", format(input$DatesMerge, "%Y%m%d"), "-S", 
                                                "\\d{6}\\-E", "\\d{6}\\", ".", "\\d{4}\\", ".V06B.RT-H5"))
    listado <- c(listado.dia1, listado.dia2)
    listado.reducido <- as.POSIXlt(substr(listado, start = 24, stop = 39), format = "%Y%m%d-S%H%M%S")
    listado.reducido <- as.character(listado.reducido)
    paste0(imerg, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", imerg %in% listado.reducido)
  })
  
  output$data_files_1 <- renderText({
    paste0("<p>", rv.listado(), "</p>")
  })
  
  rv.listado.obs <- reactive({
    if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 3, ".txt")) == TRUE)
      {out.1 <- paste0("precip24h_emas+conv_", input$DatesMerge - 3, ".txt existe")} else 
      {out.1 <- paste0("precip24h_emas+conv_", input$DatesMerge - 3, ".txt FALTANTE")}
    if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 2, ".txt")) == TRUE)
      {out.2 <- paste0("precip24h_emas+conv_", input$DatesMerge - 2, ".txt existe")} else 
      {out.2 <- paste0("precip24h_emas+conv_", input$DatesMerge - 2, ".txt FALTANTE")}
    if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 1, ".txt")) == TRUE)
      {out.3 <- paste0("precip24h_emas+conv_", input$DatesMerge - 1, ".txt existe")} else
      {out.3 <- paste0("precip24h_emas+conv_", input$DatesMerge - 1, ".txt FALTANTE")}
    rbind(out.1, out.2, out.3)
  })
  
  output$data_files_2 <- renderText({
    paste0("<p>", rv.listado.obs(), "</p>")
  })

  # v0.1 ------------------------------------------------------------------------
  rv.imagenes <- reactive({
    listado.imagenes.1 <- list.files(path = "./ajuste/", 
                                     pattern = paste0("Obs_", format(input$DatesMerge - 1, "%Y%m%d"), "_D\\d{3}\\_E\\d{1}\\^?[,.]?\\d{1}\\", ".png"))
    listado.imagenes.2 <- list.files(path = "./ajuste/", 
                                     pattern = paste0("Ajuste_", format(input$DatesMerge - 1, "%Y%m%d"), "_D\\d{3}\\_E\\d{1}\\^?[,.]?\\d{1}\\", ".png"))
    listado.imagenes <- list(a = listado.imagenes.1[1], b = listado.imagenes.2[1])
    listado.imagenes
  })

  output$data_algor_1 <- renderImage({
    #out.imagenes <- rv.imagenes()
    filename <- normalizePath(file.path('./ajuste/', paste(rv.imagenes()$a)))
    
    # Return a list containing the filename
    list(src = filename)
    
  }, deleteFile = FALSE)  
  
  output$data_algor_2 <- renderImage({
    #out.imagenes <- rv.imagenes()
    filename <- normalizePath(file.path('./ajuste/', paste(rv.imagenes()$b)))
    
    # Return a list containing the filename
    list(src = filename)
    
  }, deleteFile = FALSE)
  # -----------------------------------------------------------------------------
  
  # v0.2 ------------------------------------------------------------------------
  rv.imagenes.0.2 <- reactive({
    listado.imagenes.1 <- list.files(path = "./ajuste_v0.2/", 
                                     pattern = paste0("Obs_", format(input$DatesMerge - 1, "%Y%m%d"), ".png"))
    listado.imagenes.2 <- list.files(path = "./ajuste_v0.2/", 
                                     pattern = paste0("Ajuste_", format(input$DatesMerge - 1, "%Y%m%d"), ".png"))
    listado.imagenes <- list(a = listado.imagenes.1, b = listado.imagenes.2)
    listado.imagenes
  })
  
  output$data_algor_3 <- renderImage({
    #out.imagenes <- rv.imagenes()
    filename <- normalizePath(file.path('./ajuste_v0.2/', paste(rv.imagenes.0.2()$a)))
    
    # Return a list containing the filename
    list(src = filename)
    
  }, deleteFile = FALSE)  
  
  output$data_algor_4 <- renderImage({
    #out.imagenes <- rv.imagenes()
    filename <- normalizePath(file.path('./ajuste_v0.2/', paste(rv.imagenes.0.2()$b)))
    
    # Return a list containing the filename
    list(src = filename)
    
  }, deleteFile = FALSE)
  # -----------------------------------------------------------------------------
  
  
  rv.imagenes.hidro <- reactive({
    listado.imagenes.1 <- list.files(path = "./app_hidrologicas/", 
                                     pattern = paste0(format(input$DatesMerge, "%Y-%m-%d"), "_GARRU.png"))
    listado.imagenes.2 <- list.files(path = "./app_hidrologicas/", 
                                     pattern = paste0(format(input$DatesMerge, "%Y-%m-%d"), "_PASOL.png"))
    listado.imagenes <- list(a = listado.imagenes.1, b = listado.imagenes.2)
    listado.imagenes
  })
  
  output$data_algor_5 <- renderImage({
    filename <- normalizePath(file.path('./app_hidrologicas/', paste(rv.imagenes.hidro()$a)))
    # Return a list containing the filename
    list(src = c(filename), width = 800, height = 600)
  }, deleteFile = FALSE)
  
  output$data_algor_6 <- renderImage({
    filename <- normalizePath(file.path('./app_hidrologicas/', paste(rv.imagenes.hidro()$b)))
    # Return a list containing the filename
    list(src = c(filename), width = 800, height = 600)
  }, deleteFile = FALSE)
  
  
}

shinyApp(ui = ui, server = server)

I move everything to a R version 3.6.3 and now the code, before deploy it, doesn´t show me the output. I have all the front end visible but not the back end.

Thank you!

I was able to solve it. The problem was that I was running a RStudio Server from where I was running the app. So the back end wasn't resolve. I connect to the computer where the RStudio Server were installed and I was able to run the app without problem. Do you know what it could be the problem? I would like to see the app from another IP running the code in that RStudio Server. I hope to be clear in what I am trying to say.