pandoc --pdf-engine fails with "openFile: resource busy (file is locked)" on deployed Containers — the tutorial's PDF flow cannot work in production
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- docker
- Lĩnh vực
- infrastructure
Hướng nghiên cứu
Bắt đầu với bản tái hiện examples/container đã triển khai tại commit 76d9e75 và Dockerfile của nó, sau đó chạy các probe /c/repro1/exec và file-sync được liệt kê để so sánh wrangler dev với một Container đã triển khai. Xác minh xem luồng pandoc --pdf-engine của tutorial còn bị lỗi hay không và liệu workaround pandoc-to-typst qua stdout đã được ghi lại có hoạt động hay không; được xem là hoàn tất khi đường dẫn PDF production hoạt động hoặc tutorial ghi rõ limitation và workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The PDF-conversion flow the tutorial documents (pandoc card.md -o card.pdf --pdf-engine=typst) fails on real, deployed Cloudflare Containers with:
pandoc: openFile: resource busy (file is locked)
HasCallStack backtrace:
bracket, called at ./System/IO/Temp.hs:114:3 in temporary-1.3-…:System.IO.Temp
The same command works under wrangler dev (local Docker), so the failure is invisible until first deploy. The trigger is narrow: it is specifically the --pdf-engine path's temp-file staging (System.IO.Temp / the temporary package, i.e. GHC's file locking on the temp file). Plain pandoc output files and ordinary shell writes to the same filesystem are fine.
Reproduction
examples/container from this repo at 76d9e75, deployed unmodified except for two Dockerfile changes: computerd tag bumped to 0.1.1 (to match the published @cloudflare/[email protected] the example was installed with), and pandoc 3.10.1 + typst 0.15.1 added to the image (same tools the tutorial uses). wrangler 4.119, instance type standard-2.
All probes are plain curl against the deployed example's own HTTP surface:
Control — the filesystem accepts writes (shell):
POST /c/repro1/exec {"command":"sh -c 'echo ctrl > /tmp/ctrl.txt && cat /tmp/ctrl.txt'"}
→ {"status":"completed","exitCode":0,"stdout":"ctrl\n"}
Control — plain pandoc output file works (no engine involved):
POST /c/repro1/exec {"command":"printf \"# hi\\n\" | pandoc -f markdown -t docx -o /tmp/out.docx -"}
→ {"status":"completed","exitCode":0}
Failure — any --pdf-engine invocation, container-local /tmp:
POST /c/repro1/exec {"command":"printf \"# hi\\n\" | pandoc -f markdown -o /tmp/out.pdf --pdf-engine=typst -"}
→ {"status":"failed","exitCode":1,"stderr":"pandoc: openFile: resource busy (file is locked)\nHasCallStack backtrace:\n bracket, called at ./System/IO/Temp.hs:114:3 …"}
Failure — the tutorial's exact flow (input written host-side, synced to the mount — note pushed: 2, sync itself works fine):
PUT /c/repro1/file/workspace/card.md ("# Karta…")
POST /c/repro1/exec {"command":"pandoc /workspace/card.md -o /workspace/card.pdf --pdf-engine=typst"}
→ {"status":"failed","exitCode":1,"stderr":"pandoc: openFile: resource busy (file is locked)…","pushed":2,"sync":{"status":"complete","applied":3}}
Analysis
GHC takes an fcntl lock when System.IO.Temp opens the temp file that the --pdf-engine path stages the intermediate document into, and the deployed Container filesystem refuses that lock (EBUSY-shaped failure surfaced as "resource busy (file is locked)"). Local Docker's filesystem grants the lock, hence the dev/prod split. Ordinary openFile for pandoc's --output does not trip it (the docx control above), so the blast radius is exactly "anything that goes through pandoc's PDF-engine temp staging".
Working workaround (verified on the same deployment)
Skip --pdf-engine entirely: have pandoc emit standalone typst markup to stdout (shell owns the file), then compile with typst (Rust — no GHC locking):
POST /c/repro1/exec {"command":"printf \"# hi\\n\" | pandoc -f markdown -t typst -s - > /tmp/x.typ && typst compile /tmp/x.typ /tmp/x.pdf && ls -la /tmp/x.pdf"}
→ {"status":"completed","exitCode":0,"stdout":"-rw-r--r-- 1 root root 7004 … /tmp/x.pdf\n"}
Possibly worth a note in the tutorial until the underlying lock behavior is addressed on the Containers filesystem — as-is, the tutorial's flagship command works in every local run and fails on the first production deploy, which is an expensive way to find out.
Happy to provide the deployed-example wrangler config or run further probes if useful.
- Ngôn ngữ chính
- TypeScript
- Star
- 9.5k
- Fork
- 552
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 49
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 cloudflare/computer
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
cloudflare/computer#224 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Always run the "next" computerd workflow on push to the `release` branchCó thể đã có người làm @aron-cf đã nhận 1 ngày trước. Đang mởbug
cloudflare/computer#222 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs themĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cloudflare/computer#220 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workspace namespaces: more than one Workspace per Durable Object storageCó thể đã có người làm @aron-cf đã nhận 2 ngày trước. Đang mởenhancement
cloudflare/computer#219 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git: host-held credentials for model-driven clone, fetch, pull and pushCó thể đã có người làm @aron-cf đã nhận 2 ngày trước. Đang mởenhancement
cloudflare/computer#218 · 3 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudflare/computer
Issue tương tự
-
area: desktop area: website priority: P2 type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
appandflow/stim#3411 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
lingdojo/kana-dojo#32090 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
friction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
kentcdodds/kody#3265 ·
Maintainer thường phản hồi trong vòng 1 ngày