Project render fails with "Directory not empty (os error 39)" removing execute-results when the project is on NFS
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, linux, r
- Lĩnh vực
- operating-systems, tooling
Hướng nghiên cứu
Start in src/command/render/render-files.ts at renderExecute(), where removeFreezeResults() deletes the execute-results directory right after the freeze copy, and follow the call into safeRemoveSync(). The failure is an ENOTEMPTY race on NFS that cannot be reproduced on local disk, so first decide between a retry with backoff, a warning instead of a fatal error, or skipping the write when freeze is off. Done means a project render on NFS no longer aborts, with an existing test or a new one covering the removal path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug description
Rendering a knitr document inside a Quarto project that lives on an NFS mount fails intermittently, after all code has executed and before pandoc runs:
processing file: analysis.qmd
output file: analysis.knit.md
ERROR: Directory not empty (os error 39): remove '/nfs/project/analyses/analysis_files/execute-results'
Stack trace:
at Object.removeSync (ext:deno_fs/30_fs.js:250:3)
at safeRemoveSync (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:3228:10)
at removeIfExists (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:7970:5)
at removeFreezeResults (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:136700:3)
at renderExecute (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:136863:5)
at async renderFileInternal (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:137094:35)
at async renderFiles (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:136884:9)
at async renderProject (file:///usr/lib/rstudio-server/bin/quarto/bin/quarto.js:137468:23)
Immediately afterwards, ls -la analysis_files/execute-results/ shows the directory is empty.
What seems to happen
In a project render, renderExecute() (src/command/render/render-files.ts) writes the freeze result <doc>_files/execute-results/html.json, copies it to the freezer, and then calls removeFreezeResults(), which removes execute-results right away (the project does not use freeze). On NFS, unlinking a file whose handle has not fully closed triggers the client's "silly rename": the file becomes a hidden .nfsXXXX placeholder until the last handle closes. The directory is therefore briefly non-empty, removeSync fails with ENOTEMPTY, and the render aborts. By the time a user inspects the directory, the placeholder is gone.
This fits the observations:
- It happens after all code has run, so every chunk's side effects (saved files, figures) exist, but no HTML is written.
- It is intermittent. The same document sometimes renders cleanly, and long documents with large output seem more affected.
- It never happens with the same files on local disk.
- It never happens outside a project (single-file renders take a different path that skips the freeze write).
Reproduction
- A Quarto project (
_quarto.ymlwithproject: type: default) on an NFS-mounted directory. - A knitr
.qmdwith substantial printed output and a figure. quarto render path/to/doc.qmdrepeatedly; some runs fail as above.
We cannot share our documents (clinical data), and the failure depends on NFS timing, so a minimal example on local disk will not reproduce it.
Workaround
Make execute-results a symlink to a directory on local disk before rendering:
files_dir="doc_files"
local_dir="$(mktemp -d)"
rm -rf "$files_dir" && mkdir -p "$files_dir"
ln -s "$local_dir" "$files_dir/execute-results"
quarto render doc.qmd
Quarto writes html.json through the link and, on cleanup, removes the link itself, so nothing is unlinked on NFS. The render then succeeds, with project mode and pre/post-render scripts intact. (Symlinking the whole _files directory instead does not work: the final cleanup refuses to remove a directory that resolves outside the project.)
Possible fixes
- Retry the removal of
execute-resultson ENOTEMPTY/EBUSY with a short backoff, as many tools do for NFS. - Treat failure to remove
execute-resultsas a warning rather than a fatal error, since the freeze result has already been copied to the freezer. - When freeze is not enabled, skip writing
execute-results/html.jsonbeside the document at all.
Environment
- Quarto 1.10.18 (bundled with Posit Workbench)
- R 4.6.1, knitr 1.51, rmarkdown 2.31
- RHEL 8.10, project directory on an NFS mount
Related
#2380 also concerns projects on network storage, but it is a Windows UNC path-resolution failure (os error 3); this is a Linux NFS delete race (os error 39).
- Ngôn ngữ chính
- JavaScript
- Star
- 6.1k
- Fork
- 478
- Merge trung bình
- 17 giờ 26 phút
- Pull request đã merge (30 ngày)
- 126
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto-cli
-
enhancement localization
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
quarto-dev/quarto-cli#15268 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
html maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto-cli#15261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement websites
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto-cli#15255 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quarto.json.decode does not raise on invalid JSON, so pcall cannot catch itCó thể đã có người làm @sogav21 đã nhận 3 ngày trước. Đang mởbug lua
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto-cli#15226 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
arrow-dark gives region markers a light band that fails contrastCó thể đã có người làm @vav7 đã nhận 2 ngày trước. Đang mởaccessibility bug themes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
quarto-dev/quarto-cli#15222 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/quarto-cli
Issue tương tự
-
[vika] console keeps a stale "in progress" turn after a daemon restart mid-runCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
volcengine/OpenViking#7011 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Issue: ready for confirmation Reported on 2.4.9 Triage: Dev.Experience
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
magento/magento2#41773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Upgrade listener stays on a custom server after close when `preClose` is setCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fastify/fastify-websocket#388 ·
-
[推荐] 影夕视频Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
Perl - Readme DriftCó thể đã có người làm @Omnideth đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CommunityToolkit/Aspire#2375 ·
Maintainer thường phản hồi trong vòng 2 ngày