My shiny app (hosted by shiny.io) failed to start.

I had published an app on shiny.io, but failed to start. I have no error messages.

image


This is the log:

2022-07-04T18:26:17.528730+00:00 shinyapps[6591595]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-04T18:31:44.277102+00:00 shinyapps[6591595]: Container event from container-6931873: start
2022-07-04T18:31:47.527823+00:00 shinyapps[6591595]: Container event from container-6931705: stop
2022-07-04T18:31:50.276831+00:00 shinyapps[6591595]: Warning: namespace ‘ggplot2’ is not available and has been replaced
2022-07-04T18:31:50.276878+00:00 shinyapps[6591595]: by .GlobalEnv when processing object ‘a’
2022-07-04T18:31:50.276924+00:00 shinyapps[6591595]: Running on host: fccdf9c6269d
2022-07-04T18:31:50.276976+00:00 shinyapps[6591595]: Server version: 2022.03.1
2022-07-04T18:31:50.277030+00:00 shinyapps[6591595]: LANG: C.UTF-8
2022-07-04T18:31:50.277072+00:00 shinyapps[6591595]: Working directory: /srv/connect/apps/Prueba_Benceno
2022-07-04T18:31:50.277112+00:00 shinyapps[6591595]: R version: 4.1.1
2022-07-04T18:31:50.277150+00:00 shinyapps[6591595]: shiny version: 1.6.0
2022-07-04T18:31:50.277179+00:00 shinyapps[6591595]: httpuv version: 1.6.1
2022-07-04T18:31:50.277273+00:00 shinyapps[6591595]: knitr version: (none)
2022-07-04T18:31:50.277229+00:00 shinyapps[6591595]: rmarkdown version: (none)
2022-07-04T18:31:50.277310+00:00 shinyapps[6591595]: jsonlite version: 1.7.2
2022-07-04T18:31:50.277342+00:00 shinyapps[6591595]: RJSONIO version: (none)
2022-07-04T18:31:50.277391+00:00 shinyapps[6591595]: htmltools version: 0.5.1.1
2022-07-04T18:31:50.277471+00:00 shinyapps[6591595]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-04T18:31:50.277431+00:00 shinyapps[6591595]: reticulate version: (none)
2022-07-04T18:31:50.277545+00:00 shinyapps[6591595]: Using jsonlite for JSON processing
2022-07-04T18:31:50.277584+00:00 shinyapps[6591595]: 
2022-07-04T18:31:50.277662+00:00 shinyapps[6591595]: Shiny application starting ...
2022-07-04T18:31:50.277624+00:00 shinyapps[6591595]: Starting R with process ID: '24'
2022-07-04T18:31:50.277693+00:00 shinyapps[6591595]: Error in value[[3L]](cond) : there is no package called ‘maptools’
2022-07-04T18:31:50.277731+00:00 shinyapps[6591595]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-04T18:31:50.277760+00:00 shinyapps[6591595]: Execution halted
2022-07-04T18:31:50.277818+00:00 shinyapps[6591595]: Shiny application exiting ...
2022-07-04T18:32:00.276841+00:00 shinyapps[6591595]: Warning: namespace ‘ggplot2’ is not available and has been replaced
2022-07-04T18:32:00.276901+00:00 shinyapps[6591595]: by .GlobalEnv when processing object ‘a’
2022-07-04T18:32:00.277053+00:00 shinyapps[6591595]: LANG: C.UTF-8
2022-07-04T18:32:00.276952+00:00 shinyapps[6591595]: Running on host: fccdf9c6269d
2022-07-04T18:32:00.277004+00:00 shinyapps[6591595]: Server version: 2022.03.1
2022-07-04T18:32:00.277435+00:00 shinyapps[6591595]: htmltools version: 0.5.1.1
2022-07-04T18:32:00.277097+00:00 shinyapps[6591595]: Working directory: /srv/connect/apps/Prueba_Benceno
2022-07-04T18:32:00.277138+00:00 shinyapps[6591595]: R version: 4.1.1
2022-07-04T18:32:00.277294+00:00 shinyapps[6591595]: knitr version: (none)
2022-07-04T18:32:00.277263+00:00 shinyapps[6591595]: rmarkdown version: (none)
2022-07-04T18:32:00.277478+00:00 shinyapps[6591595]: reticulate version: (none)
2022-07-04T18:32:00.277664+00:00 shinyapps[6591595]: Starting R with process ID: '42'
2022-07-04T18:32:00.277843+00:00 shinyapps[6591595]: Execution halted
2022-07-04T18:32:00.277182+00:00 shinyapps[6591595]: shiny version: 1.6.0
2022-07-04T18:32:00.277391+00:00 shinyapps[6591595]: RJSONIO version: (none)
2022-07-04T18:32:00.277597+00:00 shinyapps[6591595]: Using jsonlite for JSON processing
2022-07-04T18:32:00.277799+00:00 shinyapps[6591595]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-04T18:32:00.277523+00:00 shinyapps[6591595]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-04T18:32:00.277755+00:00 shinyapps[6591595]: Error in value[[3L]](cond) : there is no package called ‘maptools’
2022-07-04T18:32:00.277887+00:00 shinyapps[6591595]: Shiny application exiting ...
2022-07-04T18:32:00.277227+00:00 shinyapps[6591595]: httpuv version: 1.6.1
2022-07-04T18:32:00.277348+00:00 shinyapps[6591595]: jsonlite version: 1.7.2
2022-07-04T18:32:00.277632+00:00 shinyapps[6591595]: 
2022-07-04T18:32:00.277707+00:00 shinyapps[6591595]: Shiny application starting ...

Thank you.

You can search the text for the word Error, you will find that you have them.

Thanks, I realised afterwards that it was there, however I can't figure out how to fix the problem of it not finding packages (now it showed the 'maptools' package, but other times it happens with other packages).

I think that's my problem, because other apps I've been able to publish without problems.

Some random thoughts, may be wrong:

  • Maybe the issue is how the packages are loaded? Try moving all the library() calls from outside your server function to the top of your file (into global scope).
  • For this warning:
Warning: namespace ‘ggplot2’ is not available and has been replaced
by .GlobalEnv when processing object ‘a’

I found this stackoverflow answer that has a proposed solution. Try:

rm(.a)

or if your environment is supposed to be empty when app is deployed:

rm(list = ls())

Then save your workspace. Restart R and redeploy your app. Although, it's not an error, but it's good practice to avoid warnings.

Thank you, but the error still there. I've tried put the library calls at the top of my file and into the server function, but nothing work. Now I don't have any warning.

This is the error now:

2022-07-06T17:39:11.069235+00:00 shinyapps[6602154]: Error in value[3L] : could not find function "read_excel"

This is the complete log:

2022-07-06T17:36:04.306270+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:36:04.306332+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:36:04.306388+00:00 shinyapps[6602154]: Shiny application exiting ...
2022-07-06T17:39:11.068439+00:00 shinyapps[6602154]: Running on host: 7b16ad5ee748
2022-07-06T17:39:11.068496+00:00 shinyapps[6602154]: LANG: C.UTF-8
2022-07-06T17:39:11.068466+00:00 shinyapps[6602154]: Server version: 2022.05.0
2022-07-06T17:39:11.068541+00:00 shinyapps[6602154]: Working directory: /srv/connect/apps/Shiny_informe
2022-07-06T17:39:11.068595+00:00 shinyapps[6602154]: Running content using the current R environment
2022-07-06T17:39:11.068641+00:00 shinyapps[6602154]: R version: 4.1.1
2022-07-06T17:39:11.068737+00:00 shinyapps[6602154]: httpuv version: 1.6.1
2022-07-06T17:39:11.068851+00:00 shinyapps[6602154]: jsonlite version: 1.7.2
2022-07-06T17:39:11.068888+00:00 shinyapps[6602154]: RJSONIO version: (none)
2022-07-06T17:39:11.068691+00:00 shinyapps[6602154]: shiny version: 1.6.0
2022-07-06T17:39:11.069015+00:00 shinyapps[6602154]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-06T17:39:11.068776+00:00 shinyapps[6602154]: rmarkdown version: (none)
2022-07-06T17:39:11.068810+00:00 shinyapps[6602154]: knitr version: (none)
2022-07-06T17:39:11.069235+00:00 shinyapps[6602154]: Error in value[[3L]](cond) : could not find function "read_excel"
2022-07-06T17:39:11.069162+00:00 shinyapps[6602154]: Starting R with process ID: '28'
2022-07-06T17:39:11.068967+00:00 shinyapps[6602154]: reticulate version: (none)
2022-07-06T17:39:11.069200+00:00 shinyapps[6602154]: Shiny application starting ...
2022-07-06T17:39:11.069119+00:00 shinyapps[6602154]: 
2022-07-06T17:39:11.069056+00:00 shinyapps[6602154]: Using jsonlite for JSON processing
2022-07-06T17:39:11.069293+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:39:11.068919+00:00 shinyapps[6602154]: htmltools version: 0.5.1.1
2022-07-06T17:39:11.069376+00:00 shinyapps[6602154]: Shiny application exiting ...
2022-07-06T17:39:11.069332+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:39:14.339900+00:00 shinyapps[6602154]: Container event from container-6939179: stop
2022-07-06T17:39:16.135628+00:00 shinyapps[6602154]: Container event from container-6939187: start
2022-07-06T17:39:19.068310+00:00 shinyapps[6602154]: Running on host: 7b16ad5ee748
2022-07-06T17:39:19.068378+00:00 shinyapps[6602154]: Server version: 2022.05.0
2022-07-06T17:39:19.068479+00:00 shinyapps[6602154]: Working directory: /srv/connect/apps/Shiny_informe
2022-07-06T17:39:19.068422+00:00 shinyapps[6602154]: LANG: C.UTF-8
2022-07-06T17:39:19.068613+00:00 shinyapps[6602154]: shiny version: 1.6.0
2022-07-06T17:39:19.068696+00:00 shinyapps[6602154]: rmarkdown version: (none)
2022-07-06T17:39:19.068522+00:00 shinyapps[6602154]: Running content using the current R environment
2022-07-06T17:39:19.068569+00:00 shinyapps[6602154]: R version: 4.1.1
2022-07-06T17:39:19.068765+00:00 shinyapps[6602154]: jsonlite version: 1.7.2
2022-07-06T17:39:19.068815+00:00 shinyapps[6602154]: RJSONIO version: (none)
2022-07-06T17:39:19.068654+00:00 shinyapps[6602154]: httpuv version: 1.6.1
2022-07-06T17:39:19.068734+00:00 shinyapps[6602154]: knitr version: (none)
2022-07-06T17:39:19.068904+00:00 shinyapps[6602154]: reticulate version: (none)
2022-07-06T17:39:19.068862+00:00 shinyapps[6602154]: htmltools version: 0.5.1.1
2022-07-06T17:39:19.068946+00:00 shinyapps[6602154]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-06T17:39:19.069105+00:00 shinyapps[6602154]: Starting R with process ID: '44'
2022-07-06T17:39:19.068988+00:00 shinyapps[6602154]: Using jsonlite for JSON processing
2022-07-06T17:39:19.069058+00:00 shinyapps[6602154]: 
2022-07-06T17:39:19.069147+00:00 shinyapps[6602154]: Shiny application starting ...
2022-07-06T17:39:19.069271+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:39:19.069191+00:00 shinyapps[6602154]: Error in value[[3L]](cond) : could not find function "read_excel"
2022-07-06T17:39:19.069234+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:39:19.069307+00:00 shinyapps[6602154]: Shiny application exiting ...

Are you missing library(readxl) or its equivalent on your code ?

Some more ideas:

  • Did you specify/edit your .libPaths at any point? Check by running .libPaths() command in R Studio console.

  • When using functions from the libraries explicitly state their scope. For example:
    readxl::read_excel(path = "yourPath")
    instead of
    read_excel(path = "yourPath").
    This tells it that the function read_excel is in the readxl package.

  • Make sure the excel file is also being deployed to shinyapps.io. You can place it in a 'data' subfolder of your project.

  • It would help if we could see your project code, even if not reprex, if possible.

EDIT: Also found this post with same issue, and potentially root cause is indeed the encoding as I see you use Spanish (has non-standard English characters?). Search for how to save your excel file with UTF-8 encoding. Then can also specify encoding in your read_excel function call:
data <- xlsx::read.xlsx("file.xlsx", sheetIndex = 1, encoding="UTF-8")
If there's any non-standard characters in your R code also, do RStudio: File -> Save with encoding ->UTF-8

1 Like

Thank you very much for your time and help.

I finally published my app. I did it from another computer and when publishing it installed/updated "rsconnect" (I don't remember if it installed or updated it), which created a subfolder of rsconnect in my app folder, which wasn't there before.

During the installation all the packages needed to run my app were loaded.

image

1 Like

To complement, the above happened when I was outside my work network, inside it was impossible for me to load the same app.

1 Like

Thanks for the update! Glad you got it working!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.