(This is a follow up on https://github.com/electron-userland/electron-builder/issues/2006#issuecomment-346104571)
Unfortunately I am still seeing this issue with electron-builder 19.45.5 and electron 1.7.9.
I'm not sure if the underlying cause is the same, but on the surface, here's what happens:
update-downloaded
event.Result:
update-downloaded
is received again. Repeat steps 1-3, same results.After repeating many times, it will eventually update.
Any ideas as what could be causing this? Does user have to wait X seconds after quitting app before re-opening?
My index.js: https://github.com/standardnotes/desktop/blob/master/app/index.js#L29
You can test this issue for yourself by downloading an older version of Standard Notes and waiting for the update message to appear in the lower right corner of the app: https://github.com/standardnotes/desktop/releases
Got exactly the same issue. Not sure about several updates, but my app is not updating itself after successfully downloading from server and restarting on quitAndInstall()
Thank God this issue, I thought I'm going insane đ I have the exact same issue. My goal was to get to learn how to do publishing by forking one of the example projects and following the documentation. You can see my releases from yesterday on github, I got that part working. However, my ultimate goal is to get auto update staged rollouts integrated as part of my production aws codepipeline, which is going to be publishing to S3.
So this is my setup
electron-builder --x64 --linux
from (this youtube video)[https://www.youtube.com/watch?v=_Hnzuko2eAc]. I'm unable to get the build
object in package.json
right for linux :\ it always gives me errors, despite my best effort of following and re-reading the documentation.I noticed 2 things while getting publishing to work. The first is to do with the publishing process itself. As you can see in the log below I have permission denied error. Even though this error, I get a successfully published artifacts. This is something that always happens and I don't know what is trying to do and how to fix it.
[fedora@localhost electron-updater-example]$ yarn pub
yarn run v1.3.2
$ electron-builder --x64 --linux -p always
electron-builder 19.46.4
No native production dependencies
Packaging for linux x64 using electron 1.7.9 to dist/linux-unpacked
Building AppImage for arch x64
â ď¸ Application icon is not set, default Electron icon will be used
â ď¸ Application category is not set for Linux (linux.category).
Please see https://electron.build/configuration/configuration#LinuxBuildOptions-category
Publishing to Github (owner: sProject, project: electron-updater-example, version: 0.9.72)
Release with tag v0.9.72 doesn't exist, creating one
[====================] 100% 0.0s | app-0.9.72-x86_64.AppImage to GitHub
Cannot delete temporary "/tmp": Error: EACCES: permission denied, rmdir '/tmp'
at default.each.then (/home/fedora/intouch/electron-updater-example/node_modules/temp-file/src/main.ts:63:19)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
at callback (/home/fedora/intouch/electron-updater-example/node_modules/temp-file/src/main.ts:63:8)
at runHook (/home/fedora/intouch/electron-updater-example/node_modules/async-exit-hook/index.js:48:11)
at Array.map (<anonymous>)
at exit (/home/fedora/intouch/electron-updater-example/node_modules/async-exit-hook/index.js:71:8)
at process.events.(anonymous function) (/home/fedora/intouch/electron-updater-example/node_modules/async-exit-hook/index.js:116:3)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at process.emit (/home/fedora/intouch/electron-updater-example/node_modules/source-map-support/source-map-support.js:439:21)
Done in 39.79s.
[fedora@localhost electron-updater-example]$
The second observation I had is that some of the events for auto update may not be triggering. Case in point is autoUpdater.on('download-progress', (progressObj) => {}). You can see what I mean if you download v0.9.7. The app is going to correctly pick up that there is an update (displaying a message "Update available"). Then download-progress
is not fired and if you wait a few moments you'll see update-downloaded
firing and I've configured it to setTimeout(() => autoUpdater.quitAndInstall(), 5000)
. At that point the app is not restarted - it simply quits. If you start it again it does the exact same thing all over again. Also I tried to figure out where the new release file is supposed to be downloaded - no luck and I don't see it in the docs.
On a side note: I love electron and I believe that it is the future of developing desktop software. I'm new-ish to electron, I've been using it for the past 4 months, and now I want to become more proficient and use electron-builder in production. However, I felt the last few days a bit under supported even with the great efforts you guys have put in the documentation. So I think I can help you by documenting my experience and passing it on to you as a detailed tutorial, for people that have the same setup as me. Let me know if you are interested.
I might have a hint on what might happen, I believe it might be a race condition, but I don't have enough experience with nodejs to proof that.
AppImageUpdater#doInstall
uses fs-extra-p
to move()
and chmod()
the downloaded file. Now, I tracked the calls to a point where move()
is called, but the returned Promise
is never even resolved.
This might be due to BaseUpdater#quitAndInstall()
immediately (synchronously) quitting the application.
When I comment out https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/BaseUpdater.ts#L21, it works (almost)
Then I found another (clear) bug: When we run files with a version number in their name (e.g. app-v1.0.AppImage
), doInstall
sets APPIMAGE_DELETE_OLD_FILE
and moves the file to app-v1.1.AppImage
. Later it tries to execute the file in tmp
, though (it's not there anymore!)
Changing that argument to destination
should work, but I could not get this to re-execute correctly.
@siebertm Vielen Dank. Du hast absolut recht.
This issue about macOS, not about Linux.
@mobitar Sorry, I haven't yet investigated the issue. It works for me, but yeach, maybe something strange in the Squirrel.Mac. To be investigated later or will be obsolete when DMG update will be implemented.
This was working for me before but suddenly seems to have stopped working. The autoupdater downloads the update file and even opens the installer but then everything shuts down almost as if the quit() command quits ALL windows related to my app including the installer. I see a console flash up and then it disappears and the installer quits. Not sure why this happens. Any help would be much appreciated.
* Just noticed that the console that flashes is **taskkill.exe. Any idea why this would be the case? Is it a permissions issue? Am completely at a loss...
I am using the following:
"devDependencies": {
"electron": "^1.8.3",
"electron-builder": "^19.56.2",
"electron-installer-windows": "^0.2.0",
"electron-packager": "^8.5.2",
"electron-winstaller": "^2.5.2",
"grunt-electron-installer": "^2.1.0"
},
"dependencies": {
"auto-launch": "^5.0.1",
"cron": "^1.2.1",
"electron-config": "^0.2.1",
"electron-positioner": "^3.0.0",
"electron-push-receiver": "^1.2.4",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^2.19.0",
"electron-window": "^0.8.1",
"graceful-fs": "^4.1.11",
"homedir": "^0.6.0",
"https": "^1.0.0",
"https-proxy-agent": "^1.0.0",
"line-by-line": "^0.1.5",
"mousetrap": "^1.6.1",
"pac-proxy-agent": "^1.0.0",
"url": "^0.11.0",
"winreg": "^1.2.3",
"xml2js": "^0.4.17"
}
I found the reason for this error and it has nothing to do with the autoupdater. I introduced code where I had a .on('close') function for a window. This was causing the issue. Removing this piece of code enabled the updater to work as before.
Hope this helps anyone else having similar issues.
What I see in your code:
win.on('close', (e) => {
if (willQuitApp) {
/* the user tried to quit the app */
win = null;
} else if(darwin) {
/* the user only tried to close the window */
e.preventDefault();
win.hide();
}
})
But problem is that Note: If application quit was initiated by autoUpdater.quitAndInstall() then before-quit is emitted after emitting close event on all windows and closing them.
So, willQuitApp
will be false
and window is not closed (e.preventDefault()
).
Please try to rework this code. I guess you should listen window-all-closed
if you want to restore app windows on user close (https://github.com/develar/onshape-desktop-shell/blob/85563de4e12e706d3d1983a3892ba3d678a97292/src/WindowManager.ts#L16).
Does this still apply if I'm not using quitAndInstall? I'm seeing this issue on Mac when I quit the app completely via the dock, by right clicking the icon, then clicking Quit.
The docs say:
Note: If the application is quit without calling this API after the update-downloaded event has been emitted, the application will still be replaced by the updated one on the next run.
quitAndInstall
in my understanding is optional? In the case of quitting the app manually, will it still be the same problem?
Please try to add some logging to trace events.
Thanks, doing that now. But still unclear on what I should be looking for. Basically, you're sayinge.preventDefault();
is causing the problem? So, I want to make sure this is not being called when I force quit the app?
You can also comment out your close handler to test â if issue still actual :)
Sorry, still a little confused here. On Mac, when the user hits X or Cmd + W, I need the window to hide, but not be destroyed, so that when they re-click the icon in the dock, the same window reappears with the same state. Is this behavior inconsistent with how autoUpdater works?
The only way to do that as far as I know is e.preventDefault() in the close
event. I guess it would help to know, when does autoupdater apply the update? Does it hook into any event? If I were to terminate the app completely via Activity Monitor, would autoupdate work on next launch?
Ok, looks like it might indeed have something to do with window closing. I'm testing a new install of my app version 2.1.26 with an upgrade pending of 2.1.27. "Quit" means right click icon on Mac and click Quit. If I launch the app and:
Investigating..
I noticed in my case that after running quitAndInstall(), the app quits and ShipIt process starts in the background that actually copies the update file. Depending on the size of your app, some of them can be pretty big, and it can take at least 30 seconds to finish. If you try running app right away before that process is over, you get the old version, if you run after ShipIt is done, you'll get the new version. I'm not sure how it's supposed to work đ¤ˇââď¸
Edit: I'm running this on a Mac.
same issue here: https://github.com/electron-userland/electron-builder/issues/3067
is it enough to have autoUpdater.checkForUpdatesAndNotify()
on app init and then:
autoUpdater.on('update-downloaded',() => {
win.webContents.send('updateReady')
})
?
I asked because according to the documentation autoInstallOnAppQuit = true
Any update on this? I getting exactly this issue with the latest Electron Builder version - 20.35.x
"electron": "3.0.9",
"electron-builder": "20.35.0",
"electron-updater": "4.0.0",
Testing with simple node http-server to serve the request
[Tue Nov 13 2018 18:38:07 GMT+0700 (Indochina Time)] "GET /latest-mac.yml?noCache=1cs6dqhdu" "electron-builder"
[Tue Nov 13 2018 18:38:07 GMT+0700 (Indochina Time)] "GET /xxx-mac-1.0.2.zip" "electron-builder"
The ZIP downloaded, .updaterId
and __update__
generated without any issue. Calling "appUpdater.quitAndInstall()" can quit and restart the app but no update. The restart log has one more argument
[2018-11-13 18:57:14.105] [warn] { _: [], p: 'sn_0_7976859' }
I was having this issue and fixed it by running sudo chown root /Applications/<MY-APP>
on the installed electron app.
It's not a full solution because I don't know how to ensure this is done for all users in general without running the app as root, but it might point towards what the problem is.
Is there any other solution? Since normal users wont have access to sudo as @jknoxville's one.
Using electron 1.8.8, electron-updater: 3.0.1, electron-builder: 20.22.0.
With this scenario I found out that some task it's still not finished, even after the 'update-downloaded' has been fired. If forcing quit and install right away the error will occur, if some delay occur I can successfully update the application.
After server is closed I can finally update without problems ('Proxy server for native Squirrel.Mac is closed'.)
i got a same problem before, than i find some of my file can't be executed, so i just run the
chmod -R +x my_file
every time after compiling, than it works.
it seems during the install process , our build file need to be executed, need to make sure our build file can be writed, executed.
I confirmed @netweng's solution working. This issue happening if there are some files that in READONLY mode in the application.
Same issue here, but the above did not fix it
@develar do you have any more suggestions? Changing the permissions on the app does indeed do the trick, but this is not a solution for our end user of course.
Exact same issue here (also on MacOS). @jknoxville's solution works, but as @thomasvsundert said it's not something end users will know how to do (and should not have to do). Has anyone found a trouble-free solution for the client using the apps?
NOTE: @jknoxville's solution for me only works if the app (.app) is copied in the Applications folder first. Running the command on the application file somewhere else (e.g. Downloads) doesn't fix it
Getting the same -
[2019-01-31 19:28:45.716] [info] Checking for update [2019-01-31 19:28:45.838] [info] Generated new staging user ID: 79aa6fb2-2931-515a-9878-ab67ad5a5d2d [2019-01-31 19:28:48.914] [info] Found version 2.4.0 (url: Zulipelectron-2.4.0.zip, Zulipelectron-2.4.0.dmg) [2019-01-31 19:28:48.915] [info] Downloading update from Zulipelectron-2.4.0.zip, Zulipelectron-2.4.0.dmg [2019-01-31 19:28:48.932] [info] No cached update info available [2019-01-31 19:30:42.387] [info] New version 2.4.0 has been downloaded to /Users/akka/Library/Application Support/Zulipelectron/__update__/Zulipelectron-2.4.0.zip [2019-01-31 19:30:47.884] [info] / requested [2019-01-31 19:30:47.894] [info] /app.zip requested [2019-01-31 19:30:47.895] [info] app.zip requested by Squirrel.Mac, pipe /Users/akka/Library/Application Support/Zulipelectron/__update__/Zulipelectron-2.4.0.zip [2019-01-31 19:30:48.925] [warn] Error: No update available, can't quit and install at Timeout.setTimeout (/Applications/Zulipelectron.app/Contents/Resources/app.asar/main/autoupdater.js:101:10) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5) [2019-01-31 19:30:48.926] [error] Error: Error: No update available, can't quit and install at Timeout.setTimeout (/Applications/Zulipelectron.app/Contents/Resources/app.asar/main/autoupdater.js:101:10) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5)
I am also suffering because of the same problem. Will there be any fixes for this nowadays?
electron-builder: 20.34.0
electron-updater: 3.2.3
I suffering from the same issue, apparently the same one as @dsabanin
On Mac machines on which the update succeeds I see that ShipIt runs in the background after quitAndInstall, whereas on Mac machines on which the update fails and the app doesn't restart, I don't see the ShipIt process running at all after quitAndInstall runs
@dsabanin - Did you find a workaround for this?
@develar - Is this expected to be resolved in the near future or already is on the new releases of electron-builder and electron-updater?
It consistently stopped happening to us anymore after I've implemented 2 things:
I'm not sure if that is a universal solution, but it worked great for us.
Friends, I found the problem.
In my electron-builder configuration, I did not have "appId" when I was facing the same problem.
Let's say my app name is: XApp. It was creating a "com.electron.XApp.shipIt" folder on mac (inside "~/Library/Caches" for the updater. It was downloading, it was closing the app, but it was not re-opening. After some research, I notice that I need to check logs of the folder I wrote above.
Then I checked it, and I notice that it is com.electron.blabla. After adding "appId" to my build configuration, rebuilding and creating the next release, I noticed that it started working.
I hope this information will be useful for people who are facing the same problem.
Hello everyone.
After spending many hours trying to debug the issue I went through the autoUpdate error logs (at ~/Library/Caches/com.electron.[appName].ShipIt/ShipIt_stderr.log
and saw the issue was coming from a permission denied error when the updater was trying to write back to the target location where the app is found (should be under targetBundleURL
in the ShipItState.plist
).
The error was 13 Permission Denied
, and after following this thread https://github.com/electron/electron/issues/9752, trying to set the whole app bundle to write
permissions, that still failed. Turns out there was a file in the node_modules
cache from the uglifyjs
plugin (I use webpack to bundle the app) that could not be overridden, and that stopped the autoUpdater from writing back to the target location, hence the app stayed at the previous version.
It was just a matter of disabling the plugin cache option to stop that file from being created, and now the update works flawlessly, no strange hacks required.
In conclusion if you're also stuck trying to get the autoupdate to work I suggest you first check that log file to see if it is due to a permission error, in which case it's easy to debug because you should have the exact location of the problematic file in the logs. Get rid of those files and it should work!
I'm facing precisely the same behavior but on Windows (if user opens the application too quickly - which is quite common as the silent install takes some seconds to finish and doesn't show any feedback - it just gets in this loop of saying it has a new version 'ready to install upon quit')..
I used @dsabanin solution and it worked perfectly.
the wait interval wasn't needed though, only the code added as @dsabanin suggested
2019-06-05 02:25:11.142 ShipIt[86158:15251279] Beginning installation
2019-06-05 02:25:23.310 ShipIt[86158:15251279] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.KREdjnRO/Unomi.app
2019-06-05 02:25:23.310 ShipIt[86158:15251279] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.ziwDs0ab/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 02:25:23.494 ShipIt[86158:15251279] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.ziwDs0ab/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.ziwDs0ab/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 02:25:24.429 ShipIt[86158:15251279] Installation completed successfully
2019-06-05 02:25:24.534 ShipIt[86158:15251565] Application launched at file:///Applications/Unomi.app/
2019-06-05 02:25:24.535 ShipIt[86158:15251565] ShipIt quitting
2019-06-05 02:30:10.312 ShipIt[86189:15255077] Beginning installation
2019-06-05 02:30:22.732 ShipIt[86189:15255256] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.1MOa6ADp/Unomi.app
2019-06-05 02:30:22.732 ShipIt[86189:15255256] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.1MBp2iOA/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 02:30:22.871 ShipIt[86189:15255256] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.1MBp2iOA/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.1MBp2iOA/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 02:30:22.984 ShipIt[86189:15255256] Installation completed successfully
2019-06-05 02:30:22.998 ShipIt[86189:15255077] Application launched at file:///Applications/Unomi.app/
2019-06-05 02:30:22.998 ShipIt[86189:15255077] ShipIt quitting
2019-06-05 02:46:23.903 ShipIt[86363:15266795] Beginning installation
2019-06-05 02:46:34.181 ShipIt[86363:15267122] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.MRrvc3Gn/Unomi.app
2019-06-05 02:46:34.181 ShipIt[86363:15267122] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.rjR6GklM/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 02:46:34.353 ShipIt[86363:15267122] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.rjR6GklM/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.rjR6GklM/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 02:46:34.750 ShipIt[86363:15267122] Installation completed successfully
2019-06-05 02:46:34.750 ShipIt[86363:15267122] ShipIt quitting
2019-06-05 02:51:56.893 ShipIt[86383:15270351] Beginning installation
2019-06-05 02:52:10.594 ShipIt[86383:15270351] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.gHt7407R/Unomi.app
2019-06-05 02:52:10.595 ShipIt[86383:15270351] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.VltnIpHw/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 02:52:10.862 ShipIt[86383:15270351] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.VltnIpHw/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.VltnIpHw/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 02:52:11.061 ShipIt[86383:15270351] Installation completed successfully
2019-06-05 02:52:11.075 ShipIt[86383:15270568] Application launched at file:///Applications/Unomi.app/
2019-06-05 02:52:11.076 ShipIt[86383:15270568] ShipIt quitting
2019-06-05 03:01:31.651 ShipIt[86423:15275891] Beginning installation
2019-06-05 03:01:41.880 ShipIt[86423:15278301] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.EHegXM6I/Unomi.app
2019-06-05 03:01:41.882 ShipIt[86423:15278301] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.xtWSeCkl/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 03:01:41.961 ShipIt[86423:15278301] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.xtWSeCkl/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.xtWSeCkl/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 03:01:42.019 ShipIt[86423:15278301] Installation completed successfully
2019-06-05 03:01:42.020 ShipIt[86423:15278301] ShipIt quitting
2019-06-05 03:26:06.782 ShipIt[87080:15301198] Beginning installation
2019-06-05 03:26:29.956 ShipIt[87080:15301515] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.IHOptsT8/Unomi.app
2019-06-05 03:26:29.957 ShipIt[87080:15301515] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.A7bOfF88/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 03:26:30.102 ShipIt[87080:15301515] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.A7bOfF88/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.A7bOfF88/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 03:26:30.202 ShipIt[87080:15301515] Installation completed successfully
2019-06-05 03:26:30.325 ShipIt[87080:15301198] Application launched at file:///Applications/Unomi.app/
2019-06-05 03:26:30.325 ShipIt[87080:15301198] ShipIt quitting
2019-06-05 03:31:29.324 ShipIt[87174:15309426] Beginning installation
2019-06-05 03:31:46.170 ShipIt[87174:15309891] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.QAfHofQD/Unomi.app
2019-06-05 03:31:46.172 ShipIt[87174:15309891] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.3gZOIZ5J/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 03:31:46.347 ShipIt[87174:15309891] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.3gZOIZ5J/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.3gZOIZ5J/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 03:31:46.474 ShipIt[87174:15309891] Installation completed successfully
2019-06-05 03:31:46.532 ShipIt[87174:15309898] Application launched at file:///Applications/Unomi.app/
2019-06-05 03:31:46.533 ShipIt[87174:15309898] ShipIt quitting
2019-06-05 04:02:14.096 ShipIt[87331:15331522] Beginning installation
2019-06-05 04:02:29.563 ShipIt[87331:15335025] Moved bundle from file:///Applications/Unomi.app/ to file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.un4XcwIz/Unomi.app
2019-06-05 04:02:29.563 ShipIt[87331:15335025] Moved bundle from file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.qC91qiKs/Unomi.app to file:///Applications/Unomi.app/
2019-06-05 04:02:29.658 ShipIt[87331:15335025] Couldn't remove owned bundle at location file:///var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.qC91qiKs/Unomi.app, error NSError { domain: NSCocoaErrorDomain, code: 4, description: "âUnomi.appâ couldnât be removed.", failureReason: "The file doesnât exist.", underlying error: NSError { domain: NSPOSIXErrorDomain, code: 2, description: "The operation couldnât be completed. No such file or directory" }, userInfo: {
NSFilePath = "/var/folders/ph/gbqpvh454d18mjswphbgb53r0000gn/T/com.electron.unomi.ShipIt.qC91qiKs/Unomi.app";
NSUserStringVariant = (
Remove
);
} }
2019-06-05 04:02:30.035 ShipIt[87331:15335025] Installation completed successfully
2019-06-05 04:02:30.153 ShipIt[87331:15335480] Application launched at file:///Applications/Unomi.app/
2019-06-05 04:02:30.153 ShipIt[87331:15335480] ShipIt quitting
Well at first I thought It wasn't working, but it turns out I'm manually opening the application after it closes but before it automatically re-starts after calling quitAndInstall()
. I guess the auto-restart is being delayed by these shipit errors? Any thoughts @nicmosc? Also thanks for saving me an hour or two with the location of those error logs đ
Hi @Arama2014,
Where do you get those ShipIt logs from? Can you share it with us? It will be very helpful to know why the update process has failed
Hello @avner-hoffmann.
~/Library/Caches/com.electron.[appName].ShipIt/ShipIt_stderr.log
Credit for location of those logs goes to @nicmosc from a few posts up:
Hello everyone.
After spending many hours trying to debug the issue I went through the autoUpdate error logs (at
~/Library/Caches/com.electron.[appName].ShipIt/ShipIt_stderr.log
and saw the issue was coming from a permission denied error when the updater was trying to write back to the target location where the app is found (should be undertargetBundleURL
in theShipItState.plist
).The error was
13 Permission Denied
, and after following this thread electron/electron#9752, trying to set the whole app bundle towrite
permissions, that still failed. Turns out there was a file in thenode_modules
cache from theuglifyjs
plugin (I use webpack to bundle the app) that could not be overridden, and that stopped the autoUpdater from writing back to the target location, hence the app stayed at the previous version.It was just a matter of disabling the plugin cache option to stop that file from being created, and now the update works flawlessly, no strange hacks required.
In conclusion if you're also stuck trying to get the autoupdate to work I suggest you first check that log file to see if it is due to a permission error, in which case it's easy to debug because you should have the exact location of the problematic file in the logs. Get rid of those files and it should work!
Specifically: ~/Library/Caches/com.electron.[appName].ShipIt/ShipIt_stderr.log
MacOS (not sure where the cache location would be on other operating systems.)
@Arama2014 Iâm not sure actually, like I said in my answer I was getting a Permission denied, so not sure what your issue could be. Iâll see if I have those old logs and take a look as well
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If I download my Mac app as a zip, the time it takes to decompress into .app is roughly equivalent to the amount of time I must wait (via setTimeout) before I allow the user to try to install an update. This IO issue could certainly be handled at a lower level...
Hi All - In my case (on a Mac), this issue was caused by the 'update' certificate not matching the previous certificate used to sign my app. For me, the behavior was not intermittent, it would occur during every update attempt:
In my application log, I would see the following message:
Error: Code signature at URL file:///Users/blah/Library/Caches/blah did not pass validation: code failed to satisfy specified code requirement(s)
Proxy server for native Squirrel.Mac is closed (was started to download https://github.blah.com)
I believe this error is thrown if:
In my case, the certificate used to sign the app was owned by another team member and it had expired. I ended up creating a DMG signed with a new certificate, and had my users update manually. Once the new certificate was in place, subsequent app updates worked normally as before.
This obviously isn't ideal if you have a huge install base. I don't know if there is a setting to loosen app signing restrictions i.e. where are the 'code signing requirements' specified in the error log?
Check your logs and certificates! Hope this helps somebody.
How does anyone get these ShipIt_stderr.log
log files? They are nowhere to be found for me.
@stevenroussey-privicy Don't know if you found them or not, but just to clarify for future readers, the ShipIt logs seem to be under ~/Library/Caches/<appId>.ShipIt
Seeing the same problem on windows with nsis installer.
Windows NSIS same issue
Dev Dependencies:
"electron": "^4.2.9",
"electron-builder": "^21.2.0",
"electron-download": "^4.1.1",
"electron-publisher-s3": "^20.15.0",
"electron-reload": "1.4.0",
Any resolutions?
I have the problem on window NSIS too. I'm using electron-builder 21.2.0.
The issue seems to be in this commit: https://github.com/electron-userland/electron-builder/commit/39e6783
I'm not a windows person, so I'm not exactly sure why that commit breaks the auto-update, but I suspect/speculate that it has something to do either with the change to the uninstaller name (removing the '.') or the change to the taskkill invocation (adding the '/t' arg).
In any case, I created a fork of electron-builder (from tag 'v21.2.0') and reverted that particular commit, then built my project with the forked version and auto-update worked again.
@kaitlynbrown @cyphercodes96 Might be better to open new issue as this one is old and was about Mac, not Windows.
@transparentech I am dealing with this since 10 days ago on NSIS, after I had to upgrade electron-builder because of the hardenedRuntime
needed to Catalina.
How can I apply your solution? I didn't understand.
anyone found a solution yet?
@iJosephY for me the problem was that I had closable
set to false
on my window, which prevented the update from being installed. It seems like there may be other things than can cause auto update to fail in this way, however
Thanks for your comment @kaitlynbrown
i opened a new issue here:
https://github.com/electron-userland/electron-builder/issues/4526
and there was some other solutions there .. the issue appear to be with electron 7 and electron-builder 22
downgrading to electron 6 seems to fix it for me.
@damianobarbati My fork is here (branch=sme): https://github.com/transparentech/electron-builder
It works with Electron 7, hand has the commit mentioned about reverted.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
@develar - Did anyone from the electron-builder maintainers had a look on all of the above?
it seems this issue is actually 3 or 4 issues. was something fixed here in the newer versions of electron ?
specifically I'm interested of the issue when a new update is downloaded but the app is opened before ShipIt finish copying the new file to the destination location, hence the old version runs
Most helpful comment
Got exactly the same issue. Not sure about several updates, but my app is not updating itself after successfully downloading from server and restarting on
quitAndInstall()