Electron-builder: Auto-update fails with ENOENT: no such file or directory, rename

Created on 22 Jan 2019  路  7Comments  路  Source: electron-userland/electron-builder


We're seeing an error after the update is downloaded. This error is different from others open issues because it's on rename, not chmod.

Error: ENOENT: no such file or directory, rename '/Users/username/Library/Application Support/Caches/tesla-updater/pending/temp-Command E-1.2.22-mac.zip' -> '/Users/username/Library/Application Support/Caches/tesla-updater/pending/Command E-1.2.22-mac.zip'

Our flow: The user hits a keyboard shortcut, we run autoUpdater.checkForUpdates();. Note: the user may hit they keyboard shortcut a lot of times (triggering parallel downloads?) The download starts. The download finishes, and we call autoUpdater.quitAndInstall();:

  autoUpdater.on('update-downloaded', (updateInfo) => {
    log.info(`autoUpdater - Version ${updateInfo.version} downloaded, notify, quitting, installing, and relaunching`);

    const notification = new Notification({
      title: `Restarting Command E`,
      body: `Updating to version ${updateInfo.version}`,
    });
    notification.show();

    setTimeout(() => {
      log.info(`autoUpdater - Quitting and installing now`);
      autoUpdater.quitAndInstall();
    }, 3000);
  });

Here's the full error:

image

Any ideas? Thanks for the work you put into this amazing library.

backlog

Most helpful comment

when you use both autoUpdater.autoDownload = true; and

autoUpdater.on("update-available", info => {
 autoUpdater.downloadUpdate();
});

in same code, both code tries to dowload the updates. Hence, a conflict arises when trying to install and quit the app.

so, set autoUpdater.autoDownload = false; and everything will work as it's supposed to.

All 7 comments

After reading https://github.com/tutao/tutanota/issues/1032, I'm curious: Is it okay to call autoUpdater.checkForUpdates(); multiple times? How does electron-updater avoid race conditions? We're currently calling autoUpdater.checkForUpdates(); every time a user hits a keyboard shortcut. Normally this will be infrequent, but the user may hit the shortcut many times in a row, triggering many autoUpdater.checkForUpdates();.

Sometimes this error is intermittent (i.e. autoupdate fails the first few tries, then eventually works), but other times it seems to block our users persistently (i.e. several tries of running autoUpdater.checkForUpdates(); continue to fail with this error).

I am having this same issue in my application on both Windows and Linux as well.

Error: ENOENT: no such file or directory, chmod '/home/thefeeltrain/.cache/soonlauncher-updater/pending/temp-soonlauncher-4.4.1.AppImage'

This is also a copy of #3526

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.

I am still having this issue in 21.2.0 on Mac when building for MAS

same issue here

when you use both autoUpdater.autoDownload = true; and

autoUpdater.on("update-available", info => {
 autoUpdater.downloadUpdate();
});

in same code, both code tries to dowload the updates. Hence, a conflict arises when trying to install and quit the app.

so, set autoUpdater.autoDownload = false; and everything will work as it's supposed to.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NPellet picture NPellet  路  3Comments

antonycourtney picture antonycourtney  路  3Comments

omarkilani picture omarkilani  路  3Comments

talarari picture talarari  路  3Comments

jhg picture jhg  路  3Comments