electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN

Open Kyusung4698 opened this issue 3 years ago • 5 comments

  • Electron-Builder Version: 22.14.5
  • Node Version: 16.9.1
  • Electron Version: 16.0.4
  • Electron Type (current, beta, nightly): current
  • Target: win > nsis

Tried to search for this error but couldn't find any open issue. Some users are still running an old version of our app because the updater fails to verify the signature. Checking into Sentry I found the following error:

download range: bytes=121616364-121769447
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:412:11)
    at spawn (node:child_process:707:9)
    at Object.execFile (node:child_process:334:17)
    at Object.t.<computed> [as execFile] (node:electron/js2c/asar_bundle:5:2196)
    at C:\Users\user\AppData\Local\Programs\...\resources\app.asar\node_modules\electron-updater\out\windowsExecutableCodeSignatureVerifier.js:34:25
    at new Promise (<anonymous>)
    at Object.verifySignature (C:\Users\user\AppData\Local\Programs\...\resources\app.asar\node_modules\electron-updater\out\windowsExecutableCodeSignatureVerifier.js:11:12)
    at NsisUpdater.verifySignature (C:\Users\user\AppData\Local\Programs\...\resources\app.asar\node_modules\electron-updater\out\NsisUpdater.js:82:63)
    at async Object.task (C:\Users\user\AppData\Local\Programs\...\resources\app.asar\node_modules\electron-updater\out\NsisUpdater.js:35:53)
    at async NsisUpdater.executeDownload (C:\Users\user\AppData\Local\Programs\...\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:516:13)

Please let me know if there is anything missing to investigate this further. Thanks!

Kyusung4698 avatar Dec 13 '21 12:12 Kyusung4698

I've got the same issue running with :

OS : Windows 10 pro electron-builder: 22.14.5 electron: 16.0.6

Client doesn't succeed to upgrade to lastest version and has the same error :

Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:412:11) at spawn (node:child_process:707:9) at execFile (node:child_process:334:17) at t. (node:electron/js2c/asar_bundle:5:2196) at new Promise () at t.verifySignature at m.verifySignature at processTicksAndRejections (node:internal/process/task_queues:96:5) at Object.task at m.executeDownload Error: spawn UNKNOWN

Pandakls avatar Mar 03 '22 14:03 Pandakls

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar May 02 '22 15:05 stale[bot]

The same issue on Windows 11

electron-builder: 22.14.5,
electron-updater: 4.6.1,
electron: 15.3.3

The issue happend while doing 'Differential download'

SuperKirik avatar May 30 '22 13:05 SuperKirik

Some of our users also seem to be having this issue, here's a more detailed stacktrace;

UnhandledRejection Error: spawn UNKNOWN
  File "node:internal/child_process", line 412, col 11, in ChildProcess.spawn
  File "node:child_process", line 707, col 9, in spawn
  File "node:child_process", line 334, col 17, in Object.execFile
  File "node:electron/js2c/asar_bundle", line 5, col 2208, in Object.t.<computed> [as execFile]
  File "app:///node_modules/electron-updater/out/windowsExecutableCodeSignatureVerifier.js", line 33, col 25, in <anonymous>
  File "node:internal/child_process", in new Promise
  File "app:///node_modules/electron-updater/out/windowsExecutableCodeSignatureVerifier.js", line 11, col 12, in Object.verifySignature
  File "app:///node_modules/electron-updater/out/NsisUpdater.js", line 88, col 63, in NsisUpdater.verifySignature
  File "node:internal/process/task_queues", line 96, col 5, in processTicksAndRejections
  File "app:///node_modules/electron-updater/out/NsisUpdater.js", line 41, col 53, in Object.task

So it seems that this execFile method returns spawn UNKNOWN. Unfortunately can't reproduce this yet.

SpaceK33z avatar Jun 06 '22 10:06 SpaceK33z

Same issue has been coming up Screenshot 2022-07-05 at 2 19 18 PM

leena-prabhat avatar Jul 05 '22 08:07 leena-prabhat

same issue with my application, do you have any solution?

HiptJo avatar Oct 09 '22 15:10 HiptJo

Same issue on my side, Does anyone have solution?

netflt avatar Oct 14 '22 03:10 netflt

same issue on my side

eltonchan avatar Oct 14 '22 08:10 eltonchan

has Any progress?

eltonchan avatar Oct 18 '22 09:10 eltonchan

we find root cause is: Disable PowerShell in Windows 10 using Local Security Policy

eltonchan avatar Oct 20 '22 06:10 eltonchan

How can disabling PS help to resolve this issue?

HiptJo avatar Oct 20 '22 06:10 HiptJo

How can disabling PS help to resolve this issue?

I mean when user 'Disable PowerShell in Windows 10 using Local Security Policy' will throw this error

eltonchan avatar Oct 20 '22 07:10 eltonchan

https://www.itechtics.com/disable-powershell/

eltonchan avatar Oct 20 '22 07:10 eltonchan

I also see this sort of logging in our Sentry environment. Is it something we should just ignore?

ismoil793 avatar Mar 30 '23 21:03 ismoil793

If you don't want to use powershell for signature verification (or PS is just disabled), there's a new hook in v24 that allows for alternative methods to be leveraged/injected https://www.electron.build/configuration/win#how-do-use-a-custom-verify-function-to-enable-nsis-signature-verification-alternatives-instead-of-powershell The example leverages native module https://github.com/beyondkmp/win-verify-signature

mmaietta avatar Apr 14 '23 20:04 mmaietta