[Windows] fdatasyncSync on read-only fd throws EPERM, blocks node credential snapshot (canonicalIdentityLock.js)
@scui73414-bot đang làm issue này rồi.
Từ ngày 22/9/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu tại src/canonicalIdentityLock.js ở prepareOwnerFile() và kiểm tra chế độ descriptor được sử dụng trước fs.fdatasyncSync(). Tái hiện bằng node index.js hoặc --loop trên Windows; được xem là hoàn tất khi canonical node-credential snapshot và node registration/hello handshake lưu credentials mà không có lỗi EPERM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On Windows, src/canonicalIdentityLock.js opens the owner file in read-only mode and then calls fs.fdatasyncSync() on that descriptor. Windows' fdatasync (backed by FlushFileBuffers) requires a writable handle, so a read-only fd throws EPERM: operation not permitted, fdatasync. This breaks the canonical node-credential snapshot, so node registration / hello handshake cannot persist credentials.
Steps to reproduce
- On Windows, clone and
npm install. - Run
node index.js(or--loop). - Observe the non-fatal errors:
[a2aProtocol] Failed to snapshot canonical node credentials: EPERM
[TaskReceiver] Fetch/claim failed (non-fatal): EPERM: operation not permitted, fdatasync
Minimal repro:
const fs = require('fs');
fs.writeFileSync('x', 'hello');
const fd = fs.openSync('x', 'r'); // read-only
fs.fdatasyncSync(fd); // throws EPERM on Windows
Root cause
src/canonicalIdentityLock.js, prepareOwnerFile():
descriptor = fs.openSync(preparedOwnerFile, 'r'); // read-only
fs.fdatasyncSync(descriptor); // EPERM on win32
fdatasync on a read-only fd is tolerated on Linux/macOS but fails on Windows (FlushFileBuffers -> ERROR_ACCESS_DENIED -> EPERM).
Suggested fix
Open read+write so fdatasync has a writable handle:
descriptor = fs.openSync(preparedOwnerFile, 'r+');
fs.fdatasyncSync(descriptor);
Environment
- OS: Windows (win32)
- Node.js: v22.22.2
- Evolver version: 1.94.0
- Ngôn ngữ chính
- JavaScript
- Star
- 9.1k
- Fork
- 848
- Merge trung bình
- 14 giờ 39 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 EvoMap/evolver
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Tất cả issue của EvoMap/evolver
Issue tương tự
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Có thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
NL-BioImaging/OMERO.biomero#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
LinkNacional/woo-rede#367 ·
-
Docs: 1 broken linkĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Next.js
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
getsentry/sentry-wizard#1397 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày