Failing to publish/deploy a shiny app to an RStudio connect server because it cannot find BiocParallel

Hi,

I have a shiny app the I've been publishing to a RStudio connect from my RStudio server running on an Ubuntu cluster. It used to publish and deploy fine, but after a few months that I haven't touched it I'm now getting a deploy error that's related to BiocParallel:

[Connect] 2021/03/04 10:45:41.106349394 Installing BiocParallel (1.20.1) ... 
[Connect] 2021/03/04 10:45:41.596560257 curl: HTTP 200 https://cloud.r-project.org/src/contrib/PACKAGES.rds
[Connect] 2021/03/04 10:45:42.556100678 curl: HTTP 404 https://cloud.r-project.org/src/contrib/Archive/BiocParallel/BiocParallel_1.20.1.tar.gz
[Connect] 2021/03/04 10:45:42.556135767 curl: (22) The requested URL returned error: 404 
[Connect] 2021/03/04 10:45:43.602938480 curl: HTTP 404 https://cloud.r-project.org/src/contrib/Archive/BiocParallel/BiocParallel_1.20.1.tar.gz
[Connect] 2021/03/04 10:45:43.602974487 curl: (22) The requested URL returned error: 404 
[Connect] 2021/03/04 10:45:44.646867963 curl: HTTP 404 https://cloud.r-project.org/src/contrib/Archive/BiocParallel/BiocParallel_1.20.1.tar.gz
[Connect] 2021/03/04 10:45:44.646885747 curl: (22) The requested URL returned error: 404 
[Connect] 2021/03/04 10:45:45.688564592 curl: HTTP 404 https://cloud.r-project.org/src/contrib/Archive/BiocParallel/BiocParallel_1.20.1.tar.gz
[Connect] 2021/03/04 10:45:45.688579341 curl: (22) The requested URL returned error: 404 
[Connect] 2021/03/04 10:45:46.730116001 curl: HTTP 404 https://cloud.r-project.org/src/contrib/Archive/BiocParallel/BiocParallel_1.20.1.tar.gz
[Connect] 2021/03/04 10:45:46.730132948 curl: (22) The requested URL returned error: 404 
[Connect] 2021/03/04 10:45:47.734071155 FAILED
[Connect] 2021/03/04 10:45:47.735026657 Error in getSourceForPkgRecord(pkgRecord, srcDir(project), availablePackagesSource(repos = repos), : Failed to retrieve package sources for BiocParallel 1.20.1 from CRAN (internet connectivity issue?)
[Connect] 2021/03/04 10:45:47.735059243 
[Connect] 2021/03/04 10:45:47.735097612 Unable to fully restore the R packages associated with this deployment.
[Connect] 2021/03/04 10:45:47.735100076 Please review the preceding messages to determine which package
[Connect] 2021/03/04 10:45:47.735115128 encountered installation difficulty and the cause of the failure.
[Connect] 2021/03/04 10:45:47.744998318 Warning message:
[Connect] 2021/03/04 10:45:47.745196090 In packrat::restore(overwrite.dirty = TRUE, prompt = FALSE, restart = FALSE) :
[Connect] 2021/03/04 10:45:47.745203097   The most recent snapshot was generated using R version 3.6.0
[Connect] 2021/03/04 10:45:47.735281004 Error code: r-package-not-available

[Connect] An R package required by the content cannot be found in the package repository.

[Connect] Possible causes:
[Connect] * The R package being installed is not available for the version of R configured at Connect.
[Connect] * The R package being installed is not available for linux.
[Connect] * The client computer that published the content is using a different package repository from the Connect server, and the R package being installed is not available in the repository configured at the Connect server.
[Connect] * The package repository moved to a new URL after the content was published, and Connect is now attempting to rebuild the environment using the old package repository URL.
[Connect] 
[Connect] Possible solutions:
[Connect] * Install a version of R on the Connect server that matches the one being used by the client computer. You can identify the required R version from the deployment logs, which will contain an entry similar to this:
  > Bundle requested R version 3.5.0; using /usr/lib/R/bin/R which has version 3.4.4
  In this example, the client computer has R 3.5.0 and the Connect server has R version 3.4.4. The recommended solution would be to install R version 3.5.0 on the Connect server alonside the existing 3.4.4 installation.
[Connect] * Replace usage of Windows-specific R packages with ones available for linux.
[Connect] * Configure the client with a package repository that is accessible via http(s) from the Connect server, such as CRAN or RStudio Package Manager. Reinstall the affected packages from the new repository and publish the content again.
[Connect] 
[Connect] References:
[Connect] * https://docs.rstudio.com/connect/admin/getting-started/#installation
[Connect] * https://support.rstudio.com/hc/en-us/articles/360004067074-Managing-Packages-with-RStudio
[Connect] 
[Connect] 2021/03/04 10:45:47.735281004 Additional data:
[Connect] Repository: 'CRAN'
[Connect] Package: 'BiocParallel'
[Connect] PackageVersion: '1.20.1'
[Connect] Found in the following log entry:
[Connect] 2021/03/04 10:45:47.735026657 Error in getSourceForPkgRecord(pkgRecord, srcDir(project), availablePackagesSource(repos = repos), : Failed to retrieve package sources for BiocParallel 1.20.1 from CRAN (internet connectivity issue?)
[Connect] Build error: An R package required by the content cannot be found in the package repository. (r-package-not-available)
Application deployment failed with error: An R package required by the content cannot be found in the package repository. (r-package-not-available)

The folder from which I'm trying to publish has this .Rprofile file in it:

local({
  r <- getOption("repos")
  r["CRAN"] <- "https://cran.rstudio.com"
  r["BioCsoft"] <- "https://bioconductor.org/packages/3.11/bioc"
  r["BioCann"] <- "https://bioconductor.org/packages/3.11/data/annotation"
  r["BioCexp"] <- "https://bioconductor.org/packages/3.11/data/experiment"
  r["BioCworkflows"] <- "https://bioconductor.org/packages/3.11/workflows"
  options(repos = r)
})

Which I thought takes care bioconductor packages that I'n using in my app code, so I'm surprised that I'm getting this issue with BiocParallel.

Any idea?

I was able to duplicate the issue on a machine with R 3.6.0 on it - but then I was able to publish from a different machine that had R 3.6.2. Any chance you could upgrade your R version?

2 Likes

I just managed to solve that with your solution

1 Like

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.