[Windows] fdatasyncSync on read-only fd throws EPERM, blocks node credential snapshot (canonicalIdentityLock.js)
@scui73414-bot is already working on this.
Since Sep 22, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, nodejs
- Domain
- backend
Research direction
Start in src/canonicalIdentityLock.js at prepareOwnerFile() and inspect the descriptor mode used before fs.fdatasyncSync(). Reproduce with node index.js or --loop on Windows; done means the canonical node-credential snapshot and node registration/hello handshake persist credentials without the EPERM error.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 9.1k
- Forks
- 848
- Avg merge
- 14h 39m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EvoMap/evolver
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Similar issues
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Possibly taken @goranai claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
NL-BioImaging/OMERO.biomero#92 ·
Maintainers usually reply within 1 day
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LinkNacional/woo-rede#367 ·
-
Docs: 1 broken linkOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug Next.js
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-wizard#1397 · 1 comment ·
Maintainers usually reply within 1 day