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.63k stars 1.74k forks source link

Auto update on Mac doesn't download complete file #1492

Closed akorchev closed 7 years ago

akorchev commented 7 years ago

I am using Nuts server for downloads and auto update. For some reason the *-mac.zip never downloads completely. When I download the same URL with curl I get the complete file every time. For example three consequent updates finish at three different file sizes:

77.97 MB (81,753,893 bytes) 77.97 MB (81,753,881 bytes) 77.97 MB (81,754,139 bytes)

The actual size is 78.2 MB (82,028,100 bytes). Sometimes update downloads complete earlier - say at 11MB. The autoUpdater log is always ditto: Couldn't read PKZip signature which is expected because the ZIP file is incomplete. Has anybody hit a similar issue before? I suspected Nuts but download with curl works every time.

develar commented 7 years ago

We use Squirrel.Mac under the hood. So, unlikely it is electron-updater issue.

develar commented 7 years ago

Sorry, I have to close. You can file issue to Squirrel.Mac, but it seems s more dead, then alive. Sorry, I cannot help you for now.

develar commented 7 years ago

Try to upload file to S3 or GitHub to test.

akorchev commented 7 years ago

I just managed to get an older version of my app to auto update to latest. It probably means there is a new bug in either Squirrel.Mac or electron.

akorchev commented 7 years ago

I narrowed it down to electron-updater. When I use the built-in autoUpdater and setFeedURL everything works as expected on MAC. When I use electron-updater (with or without setFeedURL) the update never downloads completely. The difference is probably latest.yml and latest-mac.json. Probably the latter is wrong for some reason.

develar commented 7 years ago

Please enable debug logging (https://github.com/electron-userland/electron-builder/wiki/Auto-Update#debugging) and attach log.

akorchev commented 7 years ago

This is the log (nothing suspicious)

[2017-04-22 14:37:29:0324] [info] Checking for update
[2017-04-22 14:37:30:0370] [info] Found version 1.0.2 (url: http://download.radzen.com/download/Radzen-1.0.2-mac.zip)
[2017-04-22 14:37:30:0371] [info] Downloading update from http://download.radzen.com/download/Radzen-1.0.2-mac.zip
[2017-04-22 14:38:22:0305] [warn] Error: ditto: Couldn't read PKZip signature

[2017-04-22 14:38:22:0305] [error] Error: Error: ditto: Couldn't read PKZip signature

The default autoUpdater retrieves a different URL though.

develar commented 7 years ago

The default autoUpdater retrieves a different URL though.

What URL? Do you use nuts?

akorchev commented 7 years ago

Yes, I use nuts.

akorchev commented 7 years ago

The url that works with autoUpdater is http://download.radzen.com/download/version/1.0.3/osx_64?filetype=zip