question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Checksum mismatch on autoUpdater (if artifact name does not contain version)

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

11reactions
richard457commented, May 30, 2020

how was it closed when I see no answer?

0reactions
drivroncommented, Apr 25, 2022

Can you reopen this issue? It would be great if differential downloading was independent of the naming of artifacts and the presence of the version number in the name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checksum mismatch after code sign Electron Builder / Updater
I have tested it and it works fine, Electron was able to update the app to the version with the manually generated checksum....
Read more >
Auto Update - electron-builder
Emitted when there is an error while updating. Event: checking-for-update ¶. Emitted when checking if an update has started. Event: update-available ...
Read more >
Delta updates checksum mismatch - General Discussions
When trying to apply a delta update on this device, it fails. ... some of the internal header data which is not available...
Read more >
Using Custom Artifact Sources - Harness.io Docs
Enter a name to identify this custom artifact source. You will use this name when picking the artifact builds and versions during ...
Read more >
pre-commit
(optional) override the name of the hook - shown during hook execution. ... For example: If the machine does not have node installed,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found