Closed karchjd closed 5 months ago
hi,
i cant run your app because I dont have {lavaan},
hard for me to debug
Thanks for your help @VincentGuyader. lavaan is available on CRAN.
Can you try deploying the app to shinyapps.io programmatically, instead of using the button in the RStudio IDE?
The dev/03_deploy.R
script that comes out-of-the-box when you launch a {golem} project should have a snippet that looks something like this:
rsconnect::deployApp(
appName = desc::desc_get_field("Package"),
appTitle = desc::desc_get_field("Package"),
appFiles = c(
# Add any additional files unique to your app here.
"R/",
"inst/",
"data/",
"NAMESPACE",
"DESCRIPTION",
"app.R"
),
appId = rsconnect::deployments(".")$appID,
lint = FALSE,
forceUpdate = TRUE
)
You may need to edit some of the arguments to include the files you need, set a specific app name/title, etc.
Thanks for your suggestion @mthomas-ketchbrook. I did that. see https://github.com/karchjd/lavaangui/blob/main/dev/deploy.R. Unfortunately, I get the same error. Details are below:
> rsconnect::deployApp(
+ appName = desc::desc_get_field("Package"),
+ appTitle = desc::desc_get_field("Package"),
+ appFiles = c(
+ # Add any additional files unique to your app here.
+ "R/",
+ "inst/",
+ "NAMESPACE",
+ "DESCRIPTION",
+ "app.R"
+ ),
+ appId = rsconnect::deployments(".")$appID,
+ lint = FALSE,
+ forceUpdate = TRUE,
+ account = "solo-fsw"
+ )
Preparing to deploy application...DONE
Uploading bundle for application: 10373658...DONE
Deploying bundle: 7874769 for application: 10373658 ...
Waiting for task: 1351218787
building: Parsing manifest
building: Building image: 9421333
building: Installing system dependencies
building: Fetching packages
building: Building package: lavaan
building: Building package: kutils
building: Building package: rpf
building: Building package: OpenMx
building: Building package: pkgload
building: Building package: testthat
building: Building package: haven
building: Building package: nloptr
building: Building package: vtable
building: Building package: qgraph
building: Building package: lme4
building: Building package: sem
building: Installing files
building: Pushing image: 9421333
deploying: Starting instances
rollforward: Activating new instances
success: Stopping old instances
Application successfully deployed to https://solo-fsw.shinyapps.io/lavaangui/
Warning messages:
1: invalid uid value replaced by that for user 'nobody'
2: invalid gid value replaced by that for user 'nobody'
https://solo-fsw.shinyapps.io/lavaangui/ shows An error has occurred Unable to connect to worker after 60.00 seconds; startup took too long. Contact the author for more information.
Logs are:
2023-10-30T18:55:17.510306+00:00 shinyapps[9501099]: Content will use current R environment
2023-10-30T18:55:17.515242+00:00 shinyapps[9501099]: R_LIBS: (unset)
2023-10-30T18:55:17.519731+00:00 shinyapps[9501099]: .libPaths(): /opt/R/4.2.2/lib/R/library
2023-10-30T18:55:17.524031+00:00 shinyapps[9501099]: shiny version: 1.7.4
2023-10-30T18:55:17.528408+00:00 shinyapps[9501099]: httpuv version: 1.6.9
2023-10-30T18:55:17.533014+00:00 shinyapps[9501099]: rmarkdown version: 2.20
2023-10-30T18:55:17.538496+00:00 shinyapps[9501099]: knitr version: 1.42
2023-10-30T18:55:17.543011+00:00 shinyapps[9501099]: jsonlite version: 1.8.4
2023-10-30T18:55:17.547410+00:00 shinyapps[9501099]: RJSONIO version: (none)
2023-10-30T18:55:17.551746+00:00 shinyapps[9501099]: htmltools version: 0.5.4
2023-10-30T18:55:17.556150+00:00 shinyapps[9501099]: reticulate version: (none)
2023-10-30T18:55:17.560471+00:00 shinyapps[9501099]: Using pandoc: /opt/connect/ext/pandoc/2.16
2023-10-30T18:55:17.564838+00:00 shinyapps[9501099]:
2023-10-30T18:55:17.569366+00:00 shinyapps[9501099]: Starting R with process ID: '36'
2023-10-30T18:55:17.574011+00:00 shinyapps[9501099]: Shiny application starting ...
2023-10-30T18:55:17.578588+00:00 shinyapps[9501099]: Warning in loadSupport(appDir, renv = sharedEnv, globalrenv = NULL) :
2023-10-30T18:55:17.582913+00:00 shinyapps[9501099]: Loading R/ subdirectory for Shiny application, but this directory appears to contain an R package. Sourcing files in R/ may cause unexpected behavior.
2023-10-30T18:55:17.587287+00:00 shinyapps[9501099]: ℹ Loading lavaangui
2023-10-30T18:55:17.591420+00:00 shinyapps[9501099]:
2023-10-30T18:55:17.595640+00:00 shinyapps[9501099]: Listening on http://127.0.0.1:3012
2023-10-30T18:55:17.600485+00:00 shinyapps[9501099]: Cannot visit http://127.0.0.1:3012 because the browseURL function is disabled.
2023-10-31T18:30:17.560138+00:00 shinyapps[9501099]: Container event from container-8795110: start
2023-10-31T18:30:22.479404+00:00 shinyapps[9501099]: Running on host: 5f9157753dfa
2023-10-31T18:30:22.484447+00:00 shinyapps[9501099]: Running as user: uid=10001(shiny) gid=10001(shiny) groups=10001(shiny)
2023-10-31T18:30:22.490719+00:00 shinyapps[9501099]: Connect version: 2023.09.0
2023-10-31T18:30:22.496495+00:00 shinyapps[9501099]: LANG: C.UTF-8
2023-10-31T18:30:22.502129+00:00 shinyapps[9501099]: Working directory: /srv/connect/apps/semgui
2023-10-31T18:30:22.507334+00:00 shinyapps[9501099]: Using R 4.2.2
2023-10-31T18:30:22.515443+00:00 shinyapps[9501099]: R.home(): /opt/R/4.2.2/lib/R
2023-10-31T18:30:22.522047+00:00 shinyapps[9501099]: Content will use current R environment
2023-10-31T18:30:22.527468+00:00 shinyapps[9501099]: R_LIBS: (unset)
2023-10-31T18:30:22.532576+00:00 shinyapps[9501099]: .libPaths(): /opt/R/4.2.2/lib/R/library
2023-10-31T18:30:22.537635+00:00 shinyapps[9501099]: shiny version: 1.7.4
2023-10-31T18:30:22.543533+00:00 shinyapps[9501099]: httpuv version: 1.6.9
2023-10-31T18:30:22.548538+00:00 shinyapps[9501099]: rmarkdown version: 2.20
2023-10-31T18:30:22.553695+00:00 shinyapps[9501099]: knitr version: 1.42
2023-10-31T18:30:22.559876+00:00 shinyapps[9501099]: jsonlite version: 1.8.4
2023-10-31T18:30:22.566069+00:00 shinyapps[9501099]: RJSONIO version: (none)
2023-10-31T18:30:22.572355+00:00 shinyapps[9501099]: htmltools version: 0.5.4
2023-10-31T18:30:22.577358+00:00 shinyapps[9501099]: reticulate version: (none)
2023-10-31T18:30:22.583382+00:00 shinyapps[9501099]: Using pandoc: /opt/connect/ext/pandoc/2.16
2023-10-31T18:30:22.589170+00:00 shinyapps[9501099]:
2023-10-31T18:30:22.595467+00:00 shinyapps[9501099]: Starting R with process ID: '36'
2023-10-31T18:30:22.600539+00:00 shinyapps[9501099]: Shiny application starting ...
2023-10-31T18:30:22.606006+00:00 shinyapps[9501099]: Warning in loadSupport(appDir, renv = sharedEnv, globalrenv = NULL) :
2023-10-31T18:30:22.611224+00:00 shinyapps[9501099]: Loading R/ subdirectory for Shiny application, but this directory appears to contain an R package. Sourcing files in R/ may cause unexpected behavior.
2023-10-31T18:30:22.617006+00:00 shinyapps[9501099]: ℹ Loading lavaangui
2023-10-31T18:30:22.622018+00:00 shinyapps[9501099]:
2023-10-31T18:30:22.627864+00:00 shinyapps[9501099]: Listening on http://127.0.0.1:5853
2023-10-31T18:30:22.632711+00:00 shinyapps[9501099]: Cannot visit http://127.0.0.1:5853 because the browseURL function is disabled.
The app as downloaded from shinyapps.io is here.zip. Sourcing app.R from this downloaded app works perfectly, that is, starts the app without any problems.
Hey,
I'd be happy to help. Can you confirm that this app has not been developped using golem?
Great! I used some golem function to setup things and followed a lot of recommendations. You will see that whole folder structure is as you recommend. But I don't use any golem functions for building deploying etc.
This can be closed. I solved the problem by now and it had nothing to do with golem.
Describe the bug My app runs perfectly locally and in Docker containers but fails to run on shinyapps.io. Before I translated it into a package as per the instructions of your great book, it used to work on shinyapps.io. I have to admit that I do not use golem fully as intended and have made some modifications. So, this is probably more of a request for help than a bug report. I've already approached the shinyapps.io support team, but based on my recent experience with them, I doubt they will be able to help. If this is out of scope, please feel free to ignore. Thanks a lot for this great package!
To Reproduce Steps to reproduce the behavior:
Expected behavior A working shiny app
Actual behavior
see https://solo-fsw.shinyapps.io/semgui/. Note that starting the app locally or in a docker image is essentially instantaneous.
Logs from shinyapps.io are below but I didn't see an immediate problem. It seems the loadSupport warning is always thrown despite having a
_disable_autoload.R
in/R
. I could not find out what thebrowseURL function is disabled.
message signals and whether this is a problem.session info
Additional context App as downloaded from shinyapps.io: d29337f595094a009d10802326a43534.zip Logs: