electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.65k stars 1.74k forks source link

UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN #6495

Open Kyusung4698 opened 2 years ago

Kyusung4698 commented 2 years ago

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!

Pandakls commented 2 years ago

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

stale[bot] commented 2 years ago

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.

SuperKirik commented 2 years ago

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'

SpaceK33z commented 2 years ago

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.

leena-prabhat commented 2 years ago

Same issue has been coming up

Screenshot 2022-07-05 at 2 19 18 PM
HiptJo commented 2 years ago

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

netflt commented 2 years ago

Same issue on my side, Does anyone have solution?

eltonchan commented 2 years ago

same issue on my side

eltonchan commented 2 years ago

has Any progress?

eltonchan commented 2 years ago

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

HiptJo commented 2 years ago

How can disabling PS help to resolve this issue?

eltonchan commented 2 years ago

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 commented 2 years ago

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

ismoil793 commented 1 year ago

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

mmaietta commented 1 year ago

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