Visitar URL original
Failed to write lockfile content: Inappropriate ioctl for device (os error 25) on virtiofs shares in macOS guests · Issue #16846 · pnpm/pnpm · GitHub
Skip to content

Failed to write lockfile content: Inappropriate ioctl for device (os error 25) on virtiofs shares in macOS guests #16846

Closed

Description

@finian

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

12.6.0

Which area(s) of pnpm are affected? (leave empty if unsure)

Lockfile

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

In the share folder:

pnpm install
...
...
Error: ERR_PNPM_LOCKFILE_WRITE_FILE
  × installing dependencies
  ╰─▶ Failed to write lockfile content: Inappropriate ioctl for device (os error 25)

or you can use python to reproduce it:

python3 -c "import os,fcntl; fd=os.open('t',os.O_CREAT|os.O_WRONLY); fcntl.fcntl(fd,51)"
# OSError: [Errno 25] Inappropriate ioctl for device  (works on the guest's local disk)

Describe the Bug

pnpm 12.6.0, macOS guest in VirtualBuddy (Virtualization.framework), project on a virtiofs shared folder.

pnpm install fails when writing pnpm-lock.yaml. The cause is fcntl(F_FULLFSYNC), which Rust’s File::sync_all() uses on Apple platforms, returning ENOTTY on the share:

python3 -c "import os,fcntl; fd=os.open('t',os.O_CREAT|os.O_WRONLY); fcntl.fcntl(fd,51)"
# OSError: [Errno 25] Inappropriate ioctl for device  (works on the guest's local disk)

Suggested fix: when F_FULLFSYNC fails with ENOTTY/ENOTSUP/EINVAL, fall back to fsync(), as SQLite does. This also affects SMB shares.

Expected Behavior

pnpm install works properly.

Which Node.js version are you using?

v24.18.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Contributing a fix

  • I am working on a fix

Activity

  1. added theissue type on Oct 11, 2026
  2. zkochan commented on Oct 11, 2026

    @zkochan
    Member

    Thanks for the precise diagnosis. A fix is open in #16858: a shared sync helper now falls back to plain fsync when F_FULLFSYNC fails with ENOTTY/ENOTSUP/EOPNOTSUPP/EINVAL, and every file write in pnpm 12 (lockfile, manifests, patch state, caches, and so on) goes through it. It should cover the whole issue, including SMB shares. pnpm 11 already had this fallback through Node.js.


    Written by an agent (Claude Code, claude-opus-5-5).

  3. self-assigned this
    on Oct 11, 2026
  4. added a commit that references this issue on Oct 11, 2026
    c3d4af9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions