Deploying Shiny app to shinyapps.io stops at: "Starting to perform package snapshot"

I am trying to deploy a Shiny app to shinyapps.io from R Studio IDE. The app runs locally without a problem. The shinyapps account is a personal account and I've linked it to R Studio using a token.

The deployment starts normally, but simply stops at the point: "Starting to perform packrat snapshot". I get no error message, but R Studio just stops executing the deployment. The app is viewable on shinyapps. as undeployed.

Here is the session information.

Session information: 
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Norwegian Bokmål_Norway.utf8 
[2] LC_CTYPE=Norwegian Bokmål_Norway.utf8   
[3] LC_MONETARY=Norwegian Bokmål_Norway.utf8
[4] LC_NUMERIC=C                            
[5] LC_TIME=Norwegian Bokmål_Norway.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.1   rsconnect_0.8.27
Cookies: 
[1] "None"
GET /v1/applications/?filter=account_id:427053&filter=name:pico-outreach&count=100&offset=0 530ms
----- Bundle upload started at  2022-08-24 14:39:38  -----
[2022-08-24 14:39:38] Inferring App mode and parameters 
[2022-08-24 14:39:38] Bundling app dir 
[2022-08-24 14:39:38] Generate manifest.json 
[2022-08-24 14:39:38] Starting to perform packrat snapshot 

I've tried deploying the app from 2 different computers, one running Win 10 and one running Win 11, but stops at the same point. I've tried reconnecting to shinyapps with a new token, but still doesn't work. I've tried updating all packages and R to the newest version, but still no luck.

Any help is appreciated.

2 Likes

Hi,
for what it's worth, I have the exact (!) same problem and session information.
Same r-version, same packages, even same locale, and the process stops at the same place.

NB: Deployment to Shinyapps.io from RStudio used to work a few months back but not anymore.

1 Like

Hi,

Good to know that this is not an isolated problem. I did not have more time to spend looking for a solution and just ended up using a machine running Linux (Ubuntu, if that matters) and it worked immediately with no change to the code. So the problem was either with the specific Windows installations that I had or the computer. Win 11 was on my private computer and the Win 10 on a managed work computer. Given that the package versions and app code was identical across machines suggests they were not part of the problem.

Hi. I am not sure what caused this error but when using renv on the project, it works. renv::init() adds all the libraries to the project up front, and when the later deployment initiates packrat, the process is fast and does not halt at this stage.

Same error here, with the same locale (Norwegian, Bokmål). Have not found a solution to it. Cannot change to Linux and I tried to install renv and use renv::init(), but it did not work.

I was able to confirm that the error is related to the locale, and found a solution that works.

It requires that one changes the locale on one's computer, which is probaly not ideal. If anyone knows where one should report this error to have it fixed permanently, please reply with such information.

A solution that works for now:
One cannot just change the locale in R/RStudio as Shiny or rsconnect use the your computer locale when publishing the app.

So one must change the language on the computer. In Windows go to Control panel -> system -> format -> area, and change format there. I changed to English (Great Britain). English (United States) did not work for me as it caused other problems reading some csv files. Afterwards you must reset R inside RStudio (ctrl+shift+F10), and you can confirm that the locale has changed by running sessionInfo. Here is the first few lines of my result now:

> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8 


You will also see that the locale has changed in the deployment window of RStudio when you try to deploy the app using the rsconnect publish button in RStudio.

This error may not be related to Norwegian locale specifically. But since all of us three who have reported the problem here, had Norwegian locale, that seems like a valid hypthesis.

1 Like