Skip to content

Plugin archive installation stalls during extraction #11227

Closed

Description

@JustinPriday

What happened

Installing a valid .dntr archive through Plugin Manager can remain in progress indefinitely during archive extraction. The existing plugin version remains installed, but the temporary installation directory and installer lock remain active until Daintree is fully quit.

The UI does not surface an error, timeout, current archive entry, byte progress, or cancellation control.

Steps to reproduce

  1. Run packaged Daintree 0.27.0 on macOS.
  2. Create a valid .dntr archive containing an approximately 70,000-byte incompressible file entry. The resulting compressed entry is approximately 70,025 bytes.
  3. Open Plugin Manager.
  4. Select Install from file and choose the archive.
  5. Observe that installation does not complete.

A synthetic three-entry archive containing plugin.json, dist/index.js, and dist/payload.bin reproduces the behavior without any third-party plugin code.

Expected behavior

The valid archive finishes extracting and the plugin installation completes, or the installation terminates with an actionable error while releasing its temporary state and installer lock.

Actual behavior

Extraction stops during dist/payload.bin after 65,516 bytes. No further bytes are written and no completion or error is reported.

The installation indicator remains active, .install-tmp-* remains present, and install.lock.lock remains held. If this is an upgrade, the previously installed plugin version remains installed.

A renderer reload does not recover the operation. Fully quitting and reopening Daintree terminates the operation and permits startup cleanup of the stale temporary state.

Environment

  • Daintree: 0.27.0
  • Previously reproduced in Daintree: 0.26.0
  • OS: macOS 26.5.1 on Apple silicon
  • Electron: 42.4.0
  • Embedded Node: 24.16.0
  • Archive reader: yauzl 2.10.0 with fd-slicer 1.1.0

Additional context

The generated fixture produced these results:

Runtime Largest compressed entry Result
Electron 42 embedded Node 24.16.0 60,020 bytes Passed
Electron 42 embedded Node 24.16.0 70,025 bytes Timed out at 65,516 output bytes
Standalone Node 22.13.1 70,025 bytes Passed

The same 70,025-byte fixture also stalls in ELECTRON_RUN_AS_NODE=1 mode, so no renderer, Electron application lifecycle, plugin activation, existing installation, or third-party plugin code is required.

The original packaged-plugin occurrence stopped during a 111,005-byte compressed entry. ZIP integrity validation and extraction with the macOS archive utility both passed.

Activity

  1. gregpriday commented on Jul 17, 2026

    @gregpriday
    Collaborator

    Confirmed, and splitting the repro out to ELECTRON_RUN_AS_NODE=1 is what makes this one cheap to pin down. It's an upstream Node regression, not our install logic.

    Node 24.16.0 landed nodejs/node#62557, which made Readable.pause() and resume() no-op once a stream's internal destroyed flag is set. fd-slicer 1.1.0, which is yauzl 2.x's read-stream layer, ends a slice the old way by setting the flag directly instead of calling destroy():

    // node_modules/fd-slicer/index.js
    self.destroyed = true;
    self.push(null);

    If the write side is applying backpressure at that exact moment, the resume() that pipe's drain handler would normally fire does nothing, and the final chunk plus the EOF are stranded. No finish, no error, no exit. That's why it's byte-exact at the default 64KiB highWaterMark, and why it's reliable rather than intermittent on macOS (no io_uring there, so the fs completion always lands in the wrong window). Your 65,516 of 70,025 is exactly that boundary.

    Tracked upstream as nodejs/node#63487, reverted for 24.x in #63834, shipped in Node 24.18.0. Electron picked it up in 42.6.0 (electron/electron#52105). We resolve 42.4.0 in the lockfile, which is Node 24.16.0, so we're sitting right on it. Our ^42.4.0 range already permits the fix, it just needs the lockfile moved. Current 42.x is 42.7.0.

    The plan:

    1. Bump Electron to 42.7.0 for Node 24.18.0.
    2. Bump yauzl and @types/yauzl to ^3.4.0. 3.3.1 fixed the same fd-slicer pattern independently (thejoshwolfe/yauzl#169) and 3.x drops the fd-slicer dependency outright. The callback API we use (yauzl.open with lazyEntries, openReadStream, readEntry, validateFileName) is unchanged, so it should be a drop-in major bump.
    3. The part that's ours regardless of upstream: extractPluginArchive() in electron/services/PluginArchive.ts uses a raw stream.pipe(out) and only advances on out.on("finish"), with no timeout, no stall detection, and no abort. Moving it to stream.pipeline with an AbortSignal inactivity guard turns a future silent stall into a catchable error, which is what the installer needs to reach its rollback path at all.

    On the stuck lock: installPlugin awaits extractPluginArchive at PluginInstaller.ts:308 with no timeout, so when extraction never settles, the finally that removes .install-tmp-* and releases the lock never runs. The stale: 20_000 on the proper-lockfile call doesn't rescue it either. updateLock re-arms every 10s and utimes the lockfile, so a hung-but-alive process keeps refreshing its own mtime indefinitely. Stale reclamation only helps when the holder is dead, not when it's wedged. Hence the full quit, and hence sweepStalePluginTempDirs() only ever catching the leftovers at next launch.

    Worth noting the other two openReadStream() sites in that file, readArchiveManifest() and verifyPluginArchive(), buffer through data/end with no pipe, so there's no backpressure and no drain-resume to strand. Extraction is the only exposed path.

    The missing progress and cancel affordances are a real gap but a separate one (usePluginManager.ts only tracks a boolean isInstalling), so I'd rather file that on its own than fold it in here.

    Leaving this open until the bumps and the pipeline guard land.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions