Controlling/ debugging RStudio Connect app bundles

July 3, 2019 @nstrayer Nick Strayer

@nstrayer wrote:

For some reason an app that I regularly update (add new data and publish changes) stopped working recently. Everytime I go to publish a new version everything goes well until the end when it spits out the error:

2019/07/03 19:24:10.328726187 Collecting cloud-init==18.4 (from -r requirements.txt (line 10))
2019/07/03 19:24:10.331058250   ERROR: Could not find a version that satisfies the requirement cloud-init==18.4 (from -r requirements.txt (line 10)) (from versions: none)
2019/07/03 19:24:10.391276831 ERROR: No matching distribution found for cloud-init==18.4 (from -r requirements.txt (line 10))
2019/07/03 19:24:10.428967159 Error during installation: pip install failed with exit code 1; removing environment from cache: /opt/rstudio-connect/mnt/python-environments/pip/3.5.2/FksHjyEMz0iHobEq5mAYpg
2019/07/03 19:24:10.444992294 pip install failed with exit code 1
Build error: exit status 1

I have a working python install on this connect server and it is enabled (following the instructions in the connect admin guide) but more importantly I don't use any python calling packages in this app at all (and I haven't changed the packages since previous installs). I looked into what has changed between the last successful deployment and now by downloading the manifest.json from the deployments from the connect interface and then looked at what packages had changed with

library(tidyverse)
good_manifest <- jsonlite::read_json('~/Downloads/bundle-147/manifest.json')
bad_manifest <- jsonlite::read_json('~/Downloads/bundle-165/manifest.json')

get_pkgs <- . %>% 
  pluck("packages") %>% 
  names()

good_pkgs <- get_pkgs(good_manifest)
bad_pkgs <- get_pkgs(bad_manifest)

bad_pkgs[!(bad_pkgs %in% good_pkgs)]
# [1] "reticulate" "vctrs" "zeallot"

So reticulate was added as a dependency somehow.

In addition, there was a new top-level field called 'Python' in the manifest that wasn't there in the working version of the deployment.

Attempt to fix

I attempted to see what was going on by running the command rsconnect:::performPackratSnapshot(".") as is suggested in the Connect Admin Guide and the generated snapshot doesn't have reticulate in it. However when I attempted to deploy again from the app with the packrat.lock file it seemed to ignore it and I got the same error.

Main Question

My main question is: is there anyway to customize what gets added to the 'needed libraries' section of deployment?

Thanks so much for any help you can provide! I've been banging my head against a desk for a whole day on this!

Posts: 4

Participants: 2

Read full topic

Previous Article
RStudio Connect - schedule multiple parameterized reports
RStudio Connect - schedule multiple parameterized reports

@gmarquez wrote: Hello I am in need of generating scheduled reports in RStudio C...

Next Article
RStudio Connect in docker
RStudio Connect in docker

@garyamorris wrote: Hello, Is it possible to trial RStudio Connect in a docker i...