Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSIS Updater download failing with google cloud storage #1039

Closed
badams opened this issue Dec 23, 2016 · 1 comment · May be fixed by qcif/data-curator#563
Closed

NSIS Updater download failing with google cloud storage #1039

badams opened this issue Dec 23, 2016 · 1 comment · May be fixed by qcif/data-curator#563
Labels

Comments

@badams
Copy link
Contributor

badams commented Dec 23, 2016

  • Version:
  • electron-builder: 10.8.1
  • electron-auto-updater: 0.8.2
  • Target: NSIS

I am hosting my updates on google cloud storage, but when the NsisUpdater attempts to download a new version of my-app the following error is thrown.

Error: Request aborted
at IncomingMessage.response.on (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\electronHttpExecutor.js:152:30)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:185:7)
at process.nextTick (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\electron.asar\browser\api\net.js:96:22)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
at ElectronHttpExecutor.download (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\electronHttpExecutor.js:87:16)
at download (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\src\util\httpRequest.js:15:80)
at C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:184:79
at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
at C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:173:103
From previous event:
at NsisUpdater.doCheckForUpdates (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:197:11)
at C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:138:36
at next (<anonymous>)
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
at NsisUpdater.checkForUpdates (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\node_modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:143:11)
at WebContents.window.webContents.once (C:\Users\IEUser\AppData\Local\Programs\my-app\resources\app.asar\main.js:108:21)
at WebContents.g (events.js:286:16)
at emitTwo (events.js:106:13)
at WebContents.emit (events.js:191:7)

Removing the following code from electronHttpExecutor

let ended = false;
response.on("end", () => {
    ended = true;
});
response.on("close", () => {
    if (!ended) {
        callback(new Error("Request aborted"));
   }
});

Fixes the issue and the updates start working perfectly.

It seems that some https servers (googles in this case) might not behave as this code expects and cause this abort error to be thrown when the download completes.

The above block of code probably needs to be removed from nodeHttpExecutor too

@develar
Copy link
Member

develar commented Dec 23, 2016

Thanks for investigation and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants