Skip to content

fetchPnpmDeps: pnpm 11 build spams logs on darwin and gets SIGKILL on GHA runners #525627

Closed

Description

@gepbird

Nixpkgs version

  • Unstable (26.11)

Describe the bug

When building a pnpm 11 package's pnpmDeps attribute, the log is spammed with:

qui-web-pnpm-deps> (node:7511) Warning: File descriptor 46 opened in unmanaged mode twice
qui-web-pnpm-deps> (node:7511) Warning: File descriptor 46 closed but not opened in unmanaged mode
qui-web-pnpm-deps> (node:7511) Warning: File descriptor 46 opened in unmanaged mode twice
qui-web-pnpm-deps> (node:7511) Warning: File descriptor 46 closed but not opened in unmanaged mode

When building multiple pnpm 11 packages on an aarch64-darwin GHA runner, after the same log messages the build will fail with:

2026-05-29T09:59:09.4366700Z qui-web-pnpm-deps> /nix/store/0y3vzjqz42dmyasywgr6ipcfb0nwdzvy-stdenv-darwin/setup: line 1831:  7511 Killed: 9                  pnpm install --force --ignore-scripts --registry="$NIX_NPM_REGISTRY" --frozen-lockfile

Steps to reproduce

This should give you the problematic logs on an aarch64-darwin machine:

nix build github:NixOS/nixpkgs/64c08a7ca051951c8eae34e3e3cb1e202fe36786#autobrr.passthru.autobrr-web.pnpmDeps --rebuild

Reviewing pnpm 11 PRs with nixpkgs-review-gha will emit the aforementioned logs and likely fail, previous instances:

Expected behaviour

No log spam, no SIGKILL

Screenshots

No response

Relevant log output

Partial logs shown above.
Full logs for a failed GHA runner build: https://github.com/hesiod/nixpkgs-review-gha/actions/runs/26630712578/job/78478560785

Additional context

No response

System metadata

N/A

Notify maintainers

@Scrumplex @gepbird


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    6.topic: darwin
    on May 29, 2026
  2. changed the title [-]fetchPnpmDeps: pnpm 11 build spams logs and gets SIGKILL on GHA runners[/-] [+]fetchPnpmDeps: pnpm 11 build spams logs on darwin and gets SIGKILL on GHA runners[/+] on May 29, 2026
  3. LukeCarrier commented on Jun 5, 2026

    @LukeCarrier

    I don't yet understand the root cause, but this appears to work around the issue for me:

    let
      pnpm = pkgs.pnpm_11.overrideAttrs (_: {
        version = "11.5.2";
        src = pkgs.fetchurl {
          url = "https://registry.npmjs.org/pnpm/-/pnpm-11.5.2.tgz";
          hash = "sha256-dJ3FT709zenkFLquMsF3yoR3DT/NaciBbVea3D5qLJk=";
        };
        # On macOS arm64, Worker threads default to trackUnmanagedFds: true.
        # pnpm's graceful-fs EAGAIN retry loop causes fd churn; fd numbers get
        # recycled by libuv for internal pipes. When Workers exit, Node.js cleanup
        # closes all tracked-but-unclosed fds — which now belong to libuv internals
        # — causing a crash that presents as SIGKILL.
        # Fix: disable trackUnmanagedFds on the WorkerPool constructor.
        # See https://github.com/nodejs/node/commit/7603c7e50c
        postPatch = ''
          substituteInPlace dist/pnpm.mjs \
            --replace-fail \
              'resourceLimits: this._workerResourceLimits' \
              'resourceLimits: this._workerResourceLimits, trackUnmanagedFds: false'
        '';
      });
    in
    stdenv.mkDerivation (finalAttrs: {
      # snip
      pnpmDeps = fetchPnpmDeps {
        # snip
        inherit pnpm;
        # snip
      };
      # snip
    }

    Working hypothesis is that it's a combination of isaacs/node-graceful-fs#248 and isaacs/node-graceful-fs#258, and the associated pnpm workaround, but I haven't quite figured it out yet.

  4. Boelensman1 commented on Jun 9, 2026

    @Boelensman1

    I'm seeing the same warnings, but am running just a regular pnpm i.

    nix 2.34.7+1
    pnpm 11.5.2
    node v24.15.0

  5. Congee commented on Jun 10, 2026

    @Congee
    Contributor

    Root cause is the nixpkgs build of nodejs_24 24.15.0 on aarch64-darwin, not pnpm: fd tracking in worker_threads is broken, so any worker doing fs work spams these warnings. A bare worker importing 800 ESM modules triggers 1601 warnings; yarn 4 triggers it too. Official nodejs.org 24.15.0, nixpkgs nodejs_22/nodejs_26, and nixpkgs nodejs_24 24.16.0 (nixos-25.11) are all clean.

    #522655 (24.15.0 → 24.16.0, in staging) fixes it once it reaches master. Meanwhile, a simpler workaround than patching trackUnmanagedFds:

    pnpm = pkgs.pnpm_11.override { nodejs-slim = pkgs.nodejs-slim_latest; };
  6. ryand56 commented on Jun 10, 2026

    @ryand56
    Member

    I'm also experiencing this with wrangler, and also getting:

    2026-06-09T14:52:49.5324740Z wrangler> AggregateError: EBADF: bad file descriptor, read
    2026-06-09T14:52:49.5345900Z wrangler>     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:52:21)
  7. ibizaman commented on Jun 29, 2026

    @ibizaman
    Contributor

    The switch to nodejs 24.16.0 didn't help on my side. I still get the error running a simple pnpm install.

    I tried 0474123 and 10dd8aa which seem to include the aforementioned PR since node is on version 24.16.0:

    $ type pnpm
    pnpm is /nix/store/smxi4h44j1hj557lr4wjvdi5rdlarxw3-pnpm-11.9.0/bin/pnpm
    $ type node
    node is /nix/store/1zm1xb652wk1kscxbcvbryq8y45b0gy5-nodejs-24.16.0/bin/node
    $ type npm
    npm is /nix/store/1zm1xb652wk1kscxbcvbryq8y45b0gy5-nodejs-24.16.0/bin/npm
    

    I have this overlay:

    {
      nodejs = final.nodejs_24;
      pnpm = final.pnpm_11;
    }

    The patch above made the warning go away. But I also don't know what that entails. I also tried the patch on pnpm 11.9.0 with success.

  8. mortyccp commented on Jun 30, 2026

    @mortyccp

    The root cause is a V8 std::hash ODR violation in Node.js 24, not pnpm itself. See the detailed analysis here: #536039 (comment)

  9. aduh95 commented on Aug 13, 2026

    @aduh95
    Contributor

    Fixed by #536043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: darwin

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions