Electron-builder: Checksum mismatch on autoUpdater (if artifact name does not contain version)

Created on 25 May 2019  路  4Comments  路  Source: electron-userland/electron-builder


  • Version: 20.40.2

  • Updater Version: 4.0.6

  • Target: NSIS


Differential updates aren't at all working for me. It seems to be related to cases where the artifact name does not contain the version.

Specifically, I'm using a GitLab artifact directory as my generic server feed. It always points to the latest build, but the artifacts themselves do not contain a version number, and the artifact directory only contains the latest build.

Electron-updater then tries to download the old and new blockmaps by replacing the version numbers in the URLs. In this case however, this resolves to the same URL.

The differential update fails, falling back to a full download, saying:

Cannot download differentially, fallback to full download: Error: sha512 checksum mismatch, 
expected sKofBndXUi6JKAbYOGerGN2EL+le7hb9wHgEwpo0NWpIwMoYp6kTTbQ5aEPWNtTsL65Inu1IXnZbwLowOh+Cog==, 
got lkJtZoIGphlqdx4bICAHC+NIVozaBc/jVoSANjnMtQZOQ9dikDcM64hHzBnPp1vPrUvQlTaR9iEYpAhDfoFkEw==

It seems like this would be solved if electron-builder included a copy of the blockmap in the application, like it does with the update info YAML file. This way, updater could download the latest blockmap and wouldn't need to re-download the old one to compare the two.

I realise this seems a bit niche, but I feel like quite a few people might be in the same situation,

Any thoughts on this would be great.

Full log

Checking for update...
Found version 0.0.4 (url: openflexure-ev-025-testing-win.exe)
Update available.
Downloading update from openflexure-ev-025-testing-win.exe
updater cache dir: C:\Users\jtc92\AppData\Local\openflexure-ev-025-testing-updater
Cached update sha512 checksum doesn't match the latest available update. New update must be downloaded. Cached: lkJtZoIGphlqdx4bICAHC+NIVozaBc/jVoSANjnMtQZOQ9dikDcM64hHzBnPp1vPrUvQlTaR9iEYpAhDfoFkEw==, expected: sKofBndXUi6JKAbYOGerGN2EL+le7hb9wHgEwpo0NWpIwMoYp6kTTbQ5aEPWNtTsL65Inu1IXnZbwLowOh+Cog==. Directory for cached update will be cleaned
Download block maps (old: "https://gitlab.com/jtc42/openflexure-microscope-jsclient/-/jobs/artifacts/master/raw/openflexure-ev-025-testing-win.exe.blockmap?job=package", new: https://gitlab.com/jtc42/openflexure-microscope-jsclient/-/jobs/artifacts/master/raw/openflexure-ev-025-testing-win.exe.blockmap?job=package)
[
  {
    "kind": 0,
    "start": 0,
    "end": 48392803
  }
]
Full: 47,258.6 KB, To download: 0 KB (0%)
Cannot download differentially, fallback to full download: Error: sha512 checksum mismatch, expected sKofBndXUi6JKAbYOGerGN2EL+le7hb9wHgEwpo0NWpIwMoYp6kTTbQ5aEPWNtTsL65Inu1IXnZbwLowOh+Cog==, got lkJtZoIGphlqdx4bICAHC+NIVozaBc/jVoSANjnMtQZOQ9dikDcM64hHzBnPp1vPrUvQlTaR9iEYpAhDfoFkEw==
    at newError (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\node_modules\builder-util-runtime\src\index.ts:29:17)
    at DigestTransform.validate (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\node_modules\builder-util-runtime\src\httpExecutor.ts:378:13)
    at WriteStream.fileOut.close (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\differentialDownloader\DifferentialDownloader.ts:134:29)
    at WriteStream.emit (events.js:182:13)
    at lazyFs.close (internal/fs/streams.js:208:14)
    at C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\graceful-fs\graceful-fs.js:45:10
From previous event:
    at C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\graceful-fs\graceful-fs.js:258:16
    at FSReqWrap.oncomplete (fs.js:141:20)
From previous event:
    at GenericDifferentialDownloader.doDownloadFile (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\differentialDownloader\DifferentialDownloader.ts:115:82)
    at GenericDifferentialDownloader.downloadFile (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\differentialDownloader\DifferentialDownloader.ts:89:17)
    at GenericDifferentialDownloader.doDownload (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\differentialDownloader\DifferentialDownloader.ts:76:17)
    at GenericDifferentialDownloader.download (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\differentialDownloader\GenericDifferentialDownloader.ts:6:17)
    at C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:175:10
    at Generator.next (<anonymous>)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
From previous event:
    at NsisUpdater.differentialDownloadInstaller (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:134:173)
    at Object.<anonymous> (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:34:42)
    at Generator.next (<anonymous>)
From previous event:
    at Object.task (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:31:11)
    at C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:610:25
From previous event:
    at NsisUpdater.executeDownload (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:545:68)
    at NsisUpdater.executeDownload (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\BaseUpdater.ts:27:18)
    at NsisUpdater.doDownloadUpdate (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:27:17)
    at NsisUpdater.downloadUpdate (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:420:19)
    at C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:383:49
    at Generator.next (<anonymous>)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
From previous event:
    at NsisUpdater.doCheckForUpdates (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:360:34)
    at NsisUpdater.checkForUpdates (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\node_modules\electron-updater\src\AppUpdater.ts:220:35)
    at click (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\app.asar\app\menu.js:56:23)
    at MenuItem.click (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\electron.asar\browser\api\menu-item.js:56:9)
    at Function.executeCommand (C:\Users\jtc92\AppData\Local\Programs\openflexure-ev-025-testing\resources\electron.asar\browser\api\menu.js:31:13)
Download speed: 1879965 - Downloaded 3% (1883725/48392803)
Download speed: 2599639 - Downloaded 10% (5209677/48392803)
Download speed: 2817729 - Downloaded 17% (8470093/48392803)
Download speed: 2939771 - Downloaded 24% (11779661/48392803)
Download speed: 3011822 - Downloaded 31% (15089229/48392803)
Download speed: 3055912 - Downloaded 37% (18366029/48392803)
Download speed: 2991400 - Downloaded 44% (21298765/48392803)
Download speed: 3096787 - Downloaded 51% (25149005/48392803)
Download speed: 3119431 - Downloaded 58% (28458573/48392803)
Download speed: 3142759 - Downloaded 65% (31817293/48392803)
Download speed: 3147785 - Downloaded 72% (35028557/48392803)
Download speed: 3159514 - Downloaded 79% (38321741/48392803)
Download speed: 3171708 - Downloaded 86% (41647693/48392803)
Download speed: 3185425 - Downloaded 93% (45022797/48392803)
Download speed: 3195371 - Downloaded 99% (48365133/48392803)
Download speed: 3195932 - Downloaded 100% (48392803/48392803)
New version 0.0.4 has been downloaded to C:\Users\jtc92\AppData\Local\openflexure-ev-025-testing-updater\pending\openflexure-ev-025-testing-win.exe
Update downloaded; will install in 1 seconds
Install on explicit quitAndInstall
Install: isSilent: false, isForceRunAfter: true
Update installer has already been triggered. Quitting application.
backlog

Most helpful comment

how was it closed when I see no answer?

All 4 comments

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

how was it closed when I see no answer?

facing same issue, any solution for this ?

Me, too. Also Google was not that friendly so far :/

Was this page helpful?
0 / 5 - 0 ratings