You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue with deploying an R shiny app to RStudio Connect. I am using renv for managing the packages, which include a mix of sources like CRAN, public Github repos and a self-hosted GitLab repo. The latter is where problems arise.
I can install these packages in R without issues – either by downloading a local tar.gz and installing from source or by generating a PAT in GitLab and following the answer here: https://stackoverflow.com/questions/62772833/use-renv-for-private-gitlab-package. If I install from source, it is easy for my colleagues to update their local renv as well.
However, when I want to deploy the package, I run into a series of issues. With local sourced packages, I cannot write the manifest:
Error in `createAppManifest()` at rsconnect/R/deployApp.R:648:2:
! All packages must be installed from a reproducible location.
✖ Can't re-install packages installed from source: <package>.
With packages from our in-house GitLab, I get the following messages during install:
Installing <package> (<version>) ...
curl: HTTP 404 <address_of_repo>//api/v4/projects/<package1>%2F<package2>/repository/archive?sha=<sha>
curl: (22) The requested URL returned error: 404
…
FAILED
Error in value[[3L]](cond): Failed to download package from URL:
- <address_of_repo>//api/v4/projects/<package1>%2F<package2>/repository/archive?sha=<sha>'
- Reason: Error in doTryCatch(return(expr), name, parentenv, handler): Download failure.
I am using R 4.2.0, rsconnect 1.3.4 and renv 1.0.11.
In your development environment, you'll want to use remotes::install_gitlab() rather than remotes::install_git() (or the devtools equivalent). This makes sure that the installed package is annotated as coming from GitLab in a way that rsconnect can consume. Neither .tar.gz installation or remotes::install_git() provide the right breadcrumbs.
Posit Connect uses Git credentials managed by the server configuration. Folks often have a "service account" that they use for this type of programmatic access. Unfortunately, you'll need the folks who manage your Connect server to add this configuration.
The 404 error you're seeing probably indicates that an authenticated request is not happening.
Typically, the Connect configuration to enable this ends up looking like:
[GitCredential]Host = "gitlab.com"Username = "serviceAccountName"Password = "encryptedServiceAccountCredential"Protocol = "https";; The R.RestoreUsesGitCredentials is enabled by default in Connect 2024.09; earlier releases ;; need to enable the feature.[R]RestoreUsesGitCredentials = true
If you aren't going to be able to have your Connect configuration modified, the other option is to "release" your package and host it on some R package repository that is visible to Connect. Many of our customers use the Posit Package Manager for this, but any CRAN-like R package repository is suitable.
Please reach out to our support team if your Connect administrator needs help making changes to the Connect configuration.
Hi rsconnect team,
I am having an issue with deploying an R shiny app to RStudio Connect. I am using renv for managing the packages, which include a mix of sources like CRAN, public Github repos and a self-hosted GitLab repo. The latter is where problems arise.
I can install these packages in R without issues – either by downloading a local tar.gz and installing from source or by generating a PAT in GitLab and following the answer here: https://stackoverflow.com/questions/62772833/use-renv-for-private-gitlab-package. If I install from source, it is easy for my colleagues to update their local renv as well.
However, when I want to deploy the package, I run into a series of issues. With local sourced packages, I cannot write the manifest:
With packages from our in-house GitLab, I get the following messages during install:
I am using R 4.2.0, rsconnect 1.3.4 and renv 1.0.11.
I came across the issue Packrat unable to restore package from private Gitlab · Issue #625 · rstudio/packrat, but that seems to have been related to a required update to allow gitlab as a source. I have also been reading on R Package Management – Posit Connect Documentation Version 2024.12.0, but I didn’t find any solutions that worked – and I don’t have the rights to modify the
/etc/rstudio-connect/rstudio-connect.gcfg
file.Any help would be greatly appreciated.
Thanks,
Christina
The text was updated successfully, but these errors were encountered: