When deploying a Shiny application "as a package", the shinyserver fails to launch the application and gives the following error:
*** /var/log/shiny-server//shiny-server-shiny-20240607-152055-44137.log ***
su: ignoring --preserve-environment, it's mutually exclusive with --login
[2024-06-07T15:21:10.364] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
Error in loadNamespace(x) : there is no package called ‘jsonlite’
Calls: local ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
This is despite running renv::restore(), renv::isolate() and jsonlite being present in the lock file.
Also see rstudio/rsconnect#192, rstudio/rsconnect#197 and rstudio/rsconnect#199 - these relate to rsconnect (not shinyserver!) but I suspect it may be related.
When deploying a Shiny application "as a package", the shinyserver fails to launch the application and gives the following error:
This is despite running
renv::restore()
,renv::isolate()
and jsonlite being present in the lock file.App deployment
As per mastering shiny deployment and golem's instructions, a root-level
app.R
controls application launch.The following fails to launch:
But when removing the DESCRIPTION file, and while sourcing without using
pkgload
(this demands a DESCRIPTION file), this runs with success.renv cache
On the development notebook, .libPaths() returns:
On the deployed application:
and
installed.packages()
returns:Also see rstudio/rsconnect#192, rstudio/rsconnect#197 and rstudio/rsconnect#199 - these relate to rsconnect (not shinyserver!) but I suspect it may be related.