Version:
Builder 20.36.2
Updater 4.0.4
Target:
Default "mac"
After recent updates we have troubles with auto-updates on Mac. Some users are getting the following error that I wasn鈥檛 able to reproduce on any of our development machines.
The error happens at the time of checking for updates, for us that means on application launch and when user manually clicks "check for updates" in application menu.
Any advice greatly appreciated!
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
```
Unhandled Promise Rejection
Error: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
at Object.done (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/MacUpdater.ts:56:11)
at /Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:583:25
at Generator.next (
From previous event:
at done (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:581:15)
at /Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:624:18
at Generator.next (
From previous event:
at MacUpdater.executeDownload (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:545:68)
at MacUpdater.doDownloadUpdate (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/MacUpdater.ts:49:17)
at MacUpdater.downloadUpdate (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:420:19)
at /Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:383:49
at Generator.next (
From previous event:
at MacUpdater.doCheckForUpdates (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:360:34)
at MacUpdater.checkForUpdates (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:220:35)
at MacUpdater.checkForUpdatesAndNotify (/Applications/IDAGIO.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:249:41)
at Object.
at Object.
```
We that App Transport Security policy error too sometimes. And sometimes, intermittently, users (including me testing prod build updates) see the download from S3 failing even when I know my computer has internet connectivity and the file is on S3.
[2018-12-08 16:33:50.115] [info] /1544315630078-7713.zip requested
[2018-12-08 16:33:50.116] [info] /1544315630078-7713.zip requested by Squirrel.Mac, pipe /Users/ben/Library/Application Support/Caches/tesla-updater/pending/Command E-1.2.20-mac.zip
[2018-12-08 16:33:55.277] [info] Proxy server for native Squirrel.Mac is closed (was started to download https://commande-releases.s3.amazonaws.com/Command%20E-1.2.20-mac.zip)
[2018-12-08 16:33:55.282] [warn] Error: The network connection was lost.
[2018-12-08 16:33:55.283] [error] Error: Error: The network connection was lost.

[email protected]
[email protected]
@gryzzly Do you see that Squirrel.Mac error? I think you have to tweak the logger a bit...
// Production - Run autoUpdater
autoUpdater.logger = log; // log from electron-log
autoUpdater.logger.transports.file.level = 'info';
@aguynamedben we have these lines already in the source
I did get the output like yours at some point, when testing our releases on my own machine.
```
[2018-12-08 16:33:55.282] [warn] Error: The network connection was lost.
[2018-12-08 16:33:55.283] [error] Error: Error: The network connection was lost.
We're also seeing the reported App Transport Security idea with only some users:

It's a very painful error because a certain subset of our users are just "stuck" on an old version of our app. They can't upgrade past a specific version. We'd have to ask them to download and install the new version manually.
Any ideas @develar? I'm happy to spend some time investigating, I just don't know where to start given the intermittent behavior.
@gryzzly Did you find any workaround? i.e. using an old version or doing auto-updates a different way?
UPDATE: Version info for the version of our app this is happening with:
[email protected]
[email protected]
[email protected]
User's macOS version: Mac OS X 10.11.6, El Capitan (pretty old)
Donated toward this issue 馃檹 https://www.electron.build/donate
We don't have a ton of users, but the user this is happening to with our app is on macOS 10.11.6 (El Capitan, which is pretty old now). I noticed here that there are checks for 10.12.x and 10.13.x. Is El Capitan supported?
@gryzzly Are you able to determine what the macOS version is for users seeing this with your app?
Auto-update were previously working for this El Capitan user, so I think it's unlikely to be the cause, but would like to rule out this theory if possible.
I'm reviewing the Apple ATS guidelines and noticed that macOS 10.12 and before have slightly different behavior for ATS.
I'm reviewing the recent changes to ATS usage (this user also pointed it out) to understand if electron-updates sets "NSAllowsArbitraryLoads": true. It should be setting that to support macOS 10.12 and before.
Duplicates #3377
Most helpful comment
Donated toward this issue 馃檹 https://www.electron.build/donate