-
Notifications
You must be signed in to change notification settings - Fork 399
Description
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
When rendering a qmd document using embed-resources: true and a full absolute path that involves a sym-linked directory the render fails when attempting to clean up the *_files/ folder because of confusion between the given and normalized paths.
After the render completes we see an error like the following:
quarto render /home/c/cr173/tmp/quarto-bug/test.qmd
processing file: test.qmd
1/2
2/2 [unnamed-chunk-1]
output file: test.knit.md
pandoc
to: html
output-file: test.html
standalone: true
embed-resources: true
section-divs: true
html-math-method: mathjax
wrap: none
default-image-extension: png
variables: {}
metadata
document-css: false
link-citations: true
date-format: long
lang: en
ERROR: Refusing to remove directory /home/vis/cr173/tmp/quarto-bug/test_files that isn't a subdirectory of /home/c/cr173/tmp/quarto-bug
Stack trace:
at safeRemoveDirSync (file:///opt/quarto-1.8.26/bin/quarto.js:2540:11)
at file:///opt/quarto-1.8.26/bin/quarto.js:114469:9
at Array.forEach (<anonymous>)
at renderCleanup (file:///opt/quarto-1.8.26/bin/quarto.js:114467:23)
at file:///opt/quarto-1.8.26/bin/quarto.js:115409:44
at withTiming (file:///opt/quarto-1.8.26/bin/quarto.js:18977:21)
at Object.complete (file:///opt/quarto-1.8.26/bin/quarto.js:115409:9)
at eventLoopTick (ext:core/01_core.js:178:7)
at async Object.onPostProcess (file:///opt/quarto-1.8.26/bin/quarto.js:123992:28)
at async renderFileInternal (file:///opt/quarto-1.8.26/bin/quarto.js:123976:3)
Note the difference between /home/vis/cr173/tmp/quarto-bug/test_files and /home/c/cr173/tmp/quarto-bug. On our server /home/c/cr173 is a sym-link to /home/vis/cr173.
Myself and @mine-cetinkaya-rundel ran into the issue on our departmental server(s) running Posit Workbench (2026.01.0+392.pro5). It was originally observed when rendering from Positron but we've been able to replicate it with the quarto cli using versions 1.8.25, 1.8.26, and 1.9.16.
Steps to reproduce
Create test.qmd in /data/quarto-bug/:
---
format:
html:
embed-resources: true
---
```{r}
plot(mtcars)
```Create a symlink from quarto-bug/ to quarto-bug-sym/ in data/.
Run the following from /data/quarto-bug/ or /data/quarto-bug-sym:
quarto render /data/quarto-bug-sym/test.qmd- failsquarto render /data/quarto-bug/test.qmd- succeedsquarto render test.qmd- succeeds
Actual behavior
Using a path with a sym-link fails with the above error
Expected behavior
Sym-link path should be normalized to avoid the error
Your environment
- IDE: Posit Workbench 2026.01.0+392.pro5
- OS: Fedora 43
Quarto check output
Quarto 1.8.26
[✓] Checking environment information...
Quarto cache location: /home/c/cr173/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.26
Path: /opt/quarto-1.8.26/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2023
[✓] Checking Chrome Headless....................OK
Chrome: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.14.2
Path: /usr/bin/python3
Jupyter: 5.8.1
Kernels: python3
(/) Checking Jupyter engine render....[IPKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.5.2
Path: /usr/lib64/R
LibPaths:
- /home/vis/cr173/R/x86_64-redhat-linux-gnu-library/4.5
- /usr/local/lib/R/library
- /usr/lib64/R/library
- /usr/share/R/library
knitr: 1.51
rmarkdown: 2.30
[✓] Checking Knitr engine render......OK