Electron-builder: powershell Get-AuthenticodeSignature fails intermittently

Created on 16 Feb 2018  路  7Comments  路  Source: electron-userland/electron-builder


  • Version: 19.55.2


2.20.1

  • Target: Win32 (x64)


Hi friends, firstly thanks for all the work you guys put into this library. It's great.

We have an app in production which uses the electron-updater & electron-builder libraries. The builds and uploads to servers are flawless, and everything is code-signed with a cert from Digicert. 99% of our users are able to update without issues, but ~1-3% send an error like the one below,

Command failed: powershell.exe -NoProfile -NonInteractive -Command Get-AuthenticodeSignature 'C:\Users\wmser\AppData\Local\Temp\up-uLClKA\Blitz Web Setup 0.4.8.exe' | ConvertTo-Json -Compress

in the file

at verifySignature (C:\Program Files\Blitz\resources\app.asar\node_modules\electron-updater\src\windowsExecutableCodeSignatureVerifier.ts:11:3)
at C:\Program Files\Blitz\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:88:18

We've reached out and talked to users who ran into this issue, and it normally results in an inability to update the application (sometimes until the next boot, sometimes permanently without a re-install). We tried doing some debugging around the command, but since the bug isn't 100% repro, didn't get any luck.

Both the updating version, and the new version are code-signed with the exact same certificate.

Thanks,
Jonathan

bug electron-updater

Most helpful comment

same here.

Any update on this issue?

All 7 comments

Hi,
First of all; Great tool and documentation, however I have experienced the same issue. Updates run fine on some machines but fails on others.

[2018-02-22 16:16:14.411] [info] Error in auto-updater. Error: Command failed: powershell.exe -NoProfile -NonInteractive -Command Get-AuthenticodeSignature 'C:\Users\PROFILE_NAME\AppData\Local\Temp\up-hzh14h\MyAPP-11.exe' | ConvertTo-Json -Compress

Diagnosis
Tried running the powershell.exe directly on a failed machine and it verified the exe was code-signed correctly. (i didnt try the convertTo-Json cmlet)

On the third time of opening the app and downloading the update and attempting to upgrade it worked! The machine was not rebooted or restarted

i'm having the exact same issue, and i've figured out that the problem comes from the cmdlet ConvertTo-Json which doesnt exist on some pcs (probably an issue with a powershell version too low?) ill do some more digging around and let you guys know

As this fails, the signature validation is skipped but an autoupdater error event is raised and I had wired some behaviour as if the update failed on that event handler, but in this specific case the update is not failing, it's continuing but still raised the error. So for my case I need to ignore this specific error. Don't know yet how i'll manage to do that

same here.

Any update on this issue?

Seeing the same issue. As far as we know only on the Windows build, both Mac and Linux seem fine (maybe its a coincidence).

Any ideas?

Same problem for some of our users. Any news?

Getting the same error on v19.53.6.

Getting the same error on `v19.53.6`.

[2018-05-25 02:42:00:0697] [error] Error: Error: Command failed: powershell.exe Get-AuthenticodeSignature 'C:\Users\username\AppData\Local\Temp\up-UN2ofR\test-web-setup-2.3.1.exe' | ConvertTo-Json -Compress

    at ChildProcess.exithandler (child_process.js:282:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:921:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
From previous event:
    at verifySignature (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\windowsExecutableCodeSignatureVerifier.ts:11:3)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:88:18
From previous event:
    at NsisUpdater.verifySignature (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\NsisUpdater.js:148:11)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:43:54
    at Generator.next (<anonymous>)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\NsisUpdater.js:118:33
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\BaseUpdater.ts:46:13
    at Generator.next (<anonymous>)
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at NsisUpdater.executeDownload (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\BaseUpdater.js:98:11)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:37:16
From previous event:
    at NsisUpdater.doDownloadUpdate (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\NsisUpdater.js:125:11)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:331:25
    at Generator.next (<anonymous>)
From previous event:
    at NsisUpdater.downloadUpdate (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:366:11)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:307:49
From previous event:
    at NsisUpdater.doCheckForUpdates (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:337:11)
    at C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:255:25
    at Generator.next (<anonymous>)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
    at NsisUpdater._checkForUpdates (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:291:11)
    at NsisUpdater.checkForUpdates (C:\Program Files\test\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:204:35)
    at appUpdater (C:\Program Files\test\resources\app.asar\main\autoupdater.js:54:14)
    at WebContents.page.once (C:\Program Files\test\resources\app.asar\main\index.js:164:3)
    at Object.onceWrapper (events.js:318:30)
    at emitTwo (events.js:125:13)
    at WebContents.emit (events.js:213:7)

Ouch, missed this issue. Thanks to @akashnimare who pings me often using slack.

Was this page helpful?
0 / 5 - 0 ratings