-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
qcif/data-curator
#563Labels
Description
- 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