Problem Building Rstanarm in Shiny

Hi,

This might be an old issue but I’m dealing with the same problem right now.
I also tried to run LPA’s simple shiny app example and came up with the same deployment issue.

If it helps, I think I’ve been able to pin it down to the fact that for some reason whenever you try to load the rstanarm library, the shinyapps server tries to install it from source, including the hundreds of .cpp, .cc, etc. files that come with rstanarm and also its many dependencies.

As a (failed) attempt at a workaround I tried installing rstanarm post-deployment. Which succeeds in deploying the app but fails when the app startup eventually runs out of time and shinyapps shuts it down.

This is the error message as seen in the shinyapps logs:

2022-09-07T17:54:02.431883+00:00 shinyapps[6938047]: g++: fatal error: Killed signal terminated program cc1plus
2022-09-07T17:54:02.431954+00:00 shinyapps[6938047]: compilation terminated.
2022-09-07T17:54:02.442793+00:00 shinyapps[6938047]: Container event from container-7151305: oom (out of memory)
2022-09-07T17:57:56.484026+00:00 shinyapps[6938047]: make: *** [/opt/R/4.2.1/lib/R/etc/Makeconf:175: stan_files/mvmer.o] Error 1
2022-09-07T17:57:56.484074+00:00 shinyapps[6938047]: rm stan_files/lm.cc stan_files/mvmer.cc
2022-09-07T17:57:56.484174+00:00 shinyapps[6938047]: * removing ‘/tmp/RtmpsEHyZ6/rstanarm’
2022-09-07T17:57:56.484127+00:00 shinyapps[6938047]: ERROR: compilation failed for package ‘rstanarm’
2022-09-07T18:11:37.449042+00:00 shinyapps[6938047]: Container event from container-7151305: stop

My app is set to xxl (8GB) and a startup timeout of 300 seconds.

A deployment attempt with library(rstanarm)throws the following error:

deploy_error.txt (61.2 KB)

Any help for a workaround on this would be deeply appreciated.