Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment error when repo name contains a comma #397

Closed
jmcphers opened this issue Jan 6, 2020 · 4 comments
Closed

Deployment error when repo name contains a comma #397

jmcphers opened this issue Jan 6, 2020 · 4 comments
Labels
bug an unexpected problem or unintended behavior dependencies 🐀

Comments

@jmcphers
Copy link
Member

jmcphers commented Jan 6, 2020

Repro

  1. Create a new application
  2. Set the following repo option:
options(repos = c(
  `CRAN` = "https://cran.rstudio.com/",
  `Oregon State University` = "https://ftp.osuosl.org/pub/cran/",
  `University of California, Berkeley` = "https://cran.cnr.berkeley.edu/"
))
  1. Deploy the application using deployApp in the R console

Observe

Error. Traceback:

9.
lapply(X = X, FUN = FUN, ...) 
8.
sapply(repos, "[[", 2) at dependencies.R#71
7.
setNames(sapply(repos, "[[", 2), sapply(repos, "[[", 1)) at dependencies.R#71
6.
snapshotDependencies(appDir, inferDependencies(appMode, hasParameters, 
    python, hasPythonRmd)) at bundle.R#547
5.
createAppManifest(appDir = bundleDir, appMode = appMode, contentCategory = contentCategory, 
    hasParameters = hasParameters, appPrimaryDoc = appPrimaryDoc, 
    assetTypeName = assetTypeName, users = users, python = python, 
    hasPythonRmd = hasPythonRmd) at bundle.R#211
4.
bundleApp(target$appName, appDir, appFiles, appPrimaryDoc, assetTypeName, 
    contentCategory, verbose, python) at deployApp.R#356
3.
force(code) at utils.R#53
2.
withStatus(paste0("Uploading bundle for ", assetTypeName, ": ", 
    application$id), {
    python <- getPythonForTarget(python, accountDetails)
    bundlePath <- bundleApp(target$appName, appDir, appFiles,  ... at deployApp.R#351
1.
rsconnect::deployApp(appName = "shiiiiny", account = "jonathan") 

Expect

App deploys successfully

Details

Probably happens because we use commas to delimit repos in the lockfile.

# get repos defined in the lockfile
repos <- gsub("[\r\n]", " ", df[1, 'Repos'])
repos <- strsplit(unlist(strsplit(repos, "\\s*,\\s*", perl = TRUE)), "=", fixed = TRUE)
repos <- setNames(
sapply(repos, "[[", 2),
sapply(repos, "[[", 1)
)

@jmcphers
Copy link
Member Author

jmcphers commented Jan 6, 2020

Caused upstream by rstudio/packrat#587 -- because of the way Packrat writes out repos, the comma is ambiguous (could be a record separator or a repo name). We could "fix" this here by making some assumptions (e.g. presume that a repro with no = was generated from a comma and try to stitch it back together) but would be better to fix upstream.

@kevinushey
Copy link
Contributor

Is this high priority? The workaround at least would be simple (don't include commas in your repository names).

Also worth saying that renv handles this since the lockfile format is just JSON.

@jmcphers
Copy link
Member Author

jmcphers commented Jan 6, 2020

We should have an issue open to consider moving to renv for this package (and Connect).

@hadley hadley added dependencies 🐀 bug an unexpected problem or unintended behavior and removed packrat 🐀 labels Feb 21, 2023
@hadley
Copy link
Member

hadley commented Feb 21, 2023

Closing, since we're tracking in packrat.

@hadley hadley closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior dependencies 🐀
Projects
None yet
Development

No branches or pull requests

3 participants