Unable to deploy Quarto document with source

I'm attempting to deploy a Quarto document, using the 'Publish' button in Posit Workbench to Posit Connect with source files so that I can schedule it to re-render. I am able to do this with .Rmd files and am able to deploy Shiny apps as well as rendered Quarto html files.

The main error I can see in the deploy tab is saying there is no package 'rmarkdown' available - however I can see it installing from packrat and I definitely have it installed in Workbench

I've checked that Quarto is enabled in the /etc/rstudio-connect/rstudio-connect.gcfg

Not sure what other details might be useful

R Version:
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"

Platform Versions:
Posit Workbench 2023.09.1+494.pro2, “Desert Sunflower” (80aa7dd2)
Posit Connect v2023.12.0 Build v2023.12.0-0-g305a0a8008

Running on:
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.9"

Deploy tab output:

Set RETICULATE_PYTHON_FALLBACK = "/usr/bin/python3"
[2025-04-07 13:31:43.257286] Deployment log started
Deploy command: 
 rsconnect::deployApp(appDir = "~/deploy_error", appFileManifest = "/tmp/a2cd-2742-0eab-3274",      appPrimaryDoc = "deploy_error.qmd", appSourceDoc = "~/deploy_error/deploy_error.qmd",      account = "xxx", server = "xxx.xxx.xxx:3939",      appName = "deploy_error_new", appTitle = "deploy_error_new",      launch.browser = function(url) {         message("Deployment completed: ", url)     }, lint = FALSE, metadata = list(quarto_version = "1.3.433",          quarto_engines = I(c("knitr")), asMultiple = FALSE, asStatic = FALSE),      logLevel = "verbose") 

Session information: 
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so;  LAPACK version 3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Australia/Sydney
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
[1] compiler_4.3.1    cli_3.6.4         rsconnect_1.3.4   tools_4.3.1      
[5] rstudioapi_0.17.1 lifecycle_1.0.4   rlang_1.1.5      
── Preparing for deployment ────────────────────────────────────────────────────
GET /__api__/applications?filter=account_id:107&filter=name:deploy_error_new&count=100&start=0&cont= 245ms
Cookies: 
[1] path    name    value   secure  expires
<0 rows> (or 0-length row.names)
[2025-04-07 13:31:44.098431] Inferring App mode and parameters
✔ Deploying "deploy_error_new" using "server: xxx.xxx.xxx:3939 / username: xxx"
ℹ Creating application on server...
POST /__api__/applications 44ms
✔ Created application with id 134
[2025-04-07 13:31:44.241166] Bundling app dir
[2025-04-07 13:31:44.242954] Generate manifest.json
ℹ Bundling 2 files: 'deploy_error.qmd' and '_quarto.yml'
ℹ Capturing R dependencies
✔ Found 26 dependencies
[2025-04-07 13:31:45.576131] Compressing the bundle
✔ Created 17,235b bundle
ℹ Uploading bundle...
POST /__api__/applications/134/upload 63ms
✔ Uploaded bundle with id 312
── Deploying to server ─────────────────────────────────────────────────────────
POST /__api__/applications/134/deploy 47ms
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=0&wait=1 1003ms
Building Quarto document...
Bundle created with R version 4.3.1 and Quarto version 1.3.433 is compatible with environment Local with R version 4.3.1 from /opt/R/4.3.1/bin/R and Quarto version 1.3.433 from /usr/lib/rstudio-server/bin/quarto/bin/quarto 
Bundle requested R version 4.3.1; using /opt/R/4.3.1/bin/R which has version 4.3.1
Performing manifest.json to packrat transformation.
[rsc-session] Content GUID: 6f2d98fc-9215-4155-9643-8603056d7bd0
[rsc-session] Content ID: 134
[rsc-session] Bundle ID: 312
[rsc-session] Job Key: Y81f2SIBj5KQxBoR
arguments: /opt/R/4.3.1/bin/R --no-restore --no-save -s -f /opt/rstudio-connect/R/packrat_restore.R

GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=10&wait=1 1003ms
Running on host: xxx.xxx.xxx
Linux distribution: Red Hat Enterprise Linux Server release 7.9 (Maipo)
Running as user: XXXX
Connect version: 2023.12.0
LANG: en_US.UTF-8
Working directory: /opt/rstudio-connect/mnt/app
Using R 4.3.1
R.home(): /opt/R/4.3.1/lib/R
Using user agent string: 'RStudio R (4.3.1 x86_64-pc-linux-gnu x86_64 linux-gnu)' 
# Validating R library read / write permissions --------------------------------
Using R library for packrat bootstrap: /opt/rstudio-connect/mnt/R/4.3.1
# Validating managed packrat installation --------------------------------------
Vendored packrat archive: /opt/rstudio-connect/ext/R/packrat_0.9.2.9000_a71a5feebb4f4a9fe95c6421f30b5e51424b1863.tar.gz
Vendored packrat SHA: a71a5feebb4f4a9fe95c6421f30b5e51424b1863
Managed packrat SHA:  a71a5feebb4f4a9fe95c6421f30b5e51424b1863
Managed packrat version: 0.9.2.9000
Managed packrat is up-to-date.
# Validating packrat cache read / write permissions ----------------------------
Using packrat cache directory: /opt/rstudio-connect/mnt/packrat/4.3.1
# Setting packrat options and preparing lockfile -------------------------------
Audited package hashes with local packrat installation.
# Resolving R package repositories ---------------------------------------------
Received repositories from Connect's configuration:
- CRAN = "https://xxx.xxx:4242/prod-cran/__linux__/centos7/latest"
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=36&wait=1 1003ms
Received repositories from published content:
- CRAN = "https://zvlphdprs01.central.health:4242/prod-cran/latest"
Combining repositories from configuration and content.
Packages will be installed using the following repositories:
- CRAN = "https://zvlphdprs01.central.health:4242/prod-cran/__linux__/centos7/latest"
- CRAN.1 = "https://zvlphdprs01.central.health:4242/prod-cran/latest"
# Installing required R packages with `packrat::restore()` ---------------------
Installing R6 (2.6.1) ... 
Using cached R6.
	OK (symlinked cache)
Installing base64enc (0.1-3) ... 
Using cached base64enc.
	OK (symlinked cache)
Installing cli (3.6.4) ... 
Using cached cli.
	OK (symlinked cache)
Installing digest (0.6.37) ... 
Using cached digest.
	OK (symlinked cache)
Installing evaluate (1.0.3) ... 
Using cached evaluate.
	OK (symlinked cache)
Installing fastmap (1.2.0) ... 
Using cached fastmap.
	OK (symlinked cache)
Installing fs (1.6.5) ... 
Using cached fs.
	OK (symlinked cache)
Installing glue (1.8.0) ... 
Using cached glue.
	OK (symlinked cache)
Installing jsonlite (1.9.1) ... 
Using cached jsonlite.
	OK (symlinked cache)
Installing mime (0.12) ... 
Using cached mime.
	OK (symlinked cache)
Installing rappdirs (0.3.3) ... 
Using cached rappdirs.
	OK (symlinked cache)
Installing rlang (1.1.5) ... 
Using cached rlang.
	OK (symlinked cache)
Installing xfun (0.51) ... 
Using cached xfun.
	OK (symlinked cache)
Installing yaml (2.3.10) ... 
Using cached yaml.
	OK (symlinked cache)
Installing cachem (1.1.0) ... 
Using cached cachem.
	OK (symlinked cache)
Installing htmltools (0.5.8.1) ... 
Using cached htmltools.
	OK (symlinked cache)
Installing lifecycle (1.0.4) ... 
Using cached lifecycle.
	OK (symlinked cache)
Installing highr (0.11) ... 
Using cached highr.
	OK (symlinked cache)
Installing tinytex (0.56) ... 
Using cached tinytex.
	OK (symlinked cache)
Installing memoise (2.0.1) ... 
Using cached memoise.
	OK (symlinked cache)
Installing fontawesome (0.5.3) ... 
Using cached fontawesome.
	OK (symlinked cache)
Installing jquerylib (0.1.4) ... 
Using cached jquerylib.
	OK (symlinked cache)
Installing sass (0.4.9) ... 
Using cached sass.
	OK (symlinked cache)
Installing knitr (1.50) ... 
Using cached knitr.
	OK (symlinked cache)
Installing bslib (0.9.0) ... 
Using cached bslib.
	OK (symlinked cache)
Installing rmarkdown (2.29) ... 
Using cached rmarkdown.
	OK (symlinked cache)
Completed packrat build against R version: '4.3.1'
Bundle requested Quarto version 1.3.433; using /usr/lib/rstudio-server/bin/quarto/bin/quarto which has version 1.3.433
Launching Quarto document...
Using environment Local
Using /usr/lib/rstudio-server/bin/quarto/bin/quarto with version 1.3.433 from Local
Using /opt/R/4.3.1/bin/R with version 4.3.1 from Local
Determining session server location ...
Connecting to session server http://127.0.0.1:33690 ...
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=129&wait=1 1003ms
[rsc-session] Content GUID: 6f2d98fc-9215-4155-9643-8603056d7bd0
[rsc-session] Content ID: 134
[rsc-session] Bundle ID: 312
[rsc-session] Variant ID: 16
[rsc-session] Job Key: Gy8JRZUcSpeC9j8H
arguments: /opt/rstudio-connect/ext/rsc-quarto -cv 2023.12.0 -o /opt/rstudio-connect/mnt/report -q /usr/lib/rstudio-server/bin/quarto/bin/quarto -r /opt/R/4.3.1/bin/R -rv 4.3.1 --r-package-manager packrat

[rsc-quarto] Running on host: xxx.xxx.xxx
[rsc-quarto] Linux distribution: Red Hat Enterprise Linux Server release 7.9 (Maipo)
[rsc-quarto] Running as user: XXXX
[rsc-quarto] Connect version: 2023.12.0
[rsc-quarto] LANG: en_US.utf8
[rsc-quarto] Working directory: /opt/rstudio-connect/mnt/app
[rsc-quarto] Using R binary: /opt/R/4.3.1/bin/R
Connected to session server http://127.0.0.1:33690
[rsc-quarto] Configuring PATH='/opt/R/4.3.1/bin:/usr/local/bin/gdal244/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin'
[rsc-quarto] Configuring R_HOME=/opt/R/4.3.1/lib/R
[rsc-quarto] Running content using its packrat R library
[rsc-quarto] Configuring R_LIBS='/opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/4.3.1'
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=150&wait=1 1001ms
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=150&wait=1 1002ms
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=150&wait=1 1002ms
[rsc-quarto] Running 'quarto render'
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=151&wait=1 1002ms
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=151&wait=1 1003ms
Error in loadNamespace(x) : there is no package called ‘rmarkdown’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
GET /__api__/v1/tasks/wb3sW9jXGwPivL3g?first=154&wait=1 367ms

R installation:
  Version: 4.3.1
  Path: /opt/R/4.3.1/lib/R
  LibPaths:
    - /opt/R/4.3.1/lib/R/library
  knitr: (None)
  rmarkdown: (None)

The rmarkdown package is not available in this R installation.
Install with install.packages("rmarkdown")

Stopped session pings to http://127.0.0.1:33690
An error occurred while running your content.
This link offers advice for this kind of error:
    https://docs.posit.co/connect/user/troubleshooting/#render-r-code-error
Unable to render the deployed content: An error occurred while running your content. (Error code: render-r-code-error)
── Deployment complete ─────────────────────────────────────────────────────────
GET /__api__/applications/134/config 1ms
[2025-04-07 13:31:55.396464] Deployment log finished
✖ Deployment failed with error: An error occurred while running your content. (Error code: render-r-code-error)
Warning messages:
1: invalid uid value replaced by that for user 'nobody' 
2: invalid gid value replaced by that for user 'nobody'