electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

Error no valid update available, can't quite and install / EExist file already exist

Open zaden1 opened this issue 1 year ago • 3 comments

  • Electron-Builder Version: 4.2.0
  • Node Version: v12.13.0
  • Electron Version:4.2.9
  • Electron Type (current, beta, nightly):current
  • Target: windows

I hope that someone can help in finding if they is any efficient way to resolve this issue.

My electron updater pipeline is broken. We have an app that is already distributed to customers. I have been able to have them auto update fine up until now. Our last release was 1.3.2 about a year ago. I just tried to release our latest version 2.0.0 but found none of our customers devices updated. I did some digging d found the following errors

"Error no valid update available, can't quite and install"

"EExist file already exist" <- the mentioned path is to the pending directory.

This error only happens with my 1.3.2 release. all other version will update to 2.0.0 fine.

I found another person having a similar issue but I cant decipher how they fixed the issue I have linked to the page below

https://bytemeta.vip/repo/electron-userland/electron-builder/issues/6269

The fix is in this specific line

" Temporary resolved the issue by downgrading to version 4.2.0 of electron updater. Seems to be an issue with fs-extra 10.0. The function emptyDir does not work as intended. "

I had come to the same conclusion based off this block of code from the basedupdater.js file in the electron-updater

"const downloadedUpdateHelper = this.downloadedUpdateHelper;

const installerPath = downloadedUpdateHelper == null ? null : downloadedUpdateHelper.file;

const downloadedFileInfo = downloadedUpdateHelper == null ? null : downloadedUpdateHelper.downloadedFileInfo;

if (installerPath == null || downloadedFileInfo == null) {

this.dispatchError(new Error("No valid update available, can't quit and install"));

return false;

} // prevent calling several times

"

The only problem is that I am unsure how changing my electron builder type will fix the hundreds of devices I have that currently already have an broken update. I already downgrade electron updater but it had no effect. What preforms the update the currently installed version or the pending version? I don't see how I can affect any change since nothing will every be downloaded as it will always say the file already exist and thru refuse to downloads the update. Then the update fails because it was never downloaded.

It feels like we are kind of stuck. It seems the only option I have is the disasters task of remoting into over 1000 client machines and personally deleting the pending folder in every single one to get the updates started again. Also if I do it is there a way to prevent such error in the future? Our electron app replaced our flash app so we already had to have every customer send in there device or allow us remote access to install the electron app and we told them they would not need to do it again. And even if I do do it since I have no idea why the error happened the first time I have no idea if a future update will just break the updater again. Just looking for any ideas about how to move forward.

zaden1 avatar Aug 16 '22 18:08 zaden1

What preforms the update the currently installed version or the pending version?

The currently-installed version is the one that performs the update. Unfortunately, I don't see any other way to fix the updater issue without manually installing the newer (working) app version. We can update electron-updater to use fs-extra ^10.1, but I don't see how that would resolve your current update issue.

mmaietta avatar Aug 18 '22 20:08 mmaietta

I thought that might be the case. Thank you for the information. I just wanted to make sure I didn't miss any available options. The most important change we needed to the app was pointing it to our new sever so I just rerouted traffic which has worked. We will just offer the update to those interested and other will have to go without some of the QoL features added in the new app version. Thanks again for the feedback. I at least have something to go with now.

zaden1 avatar Aug 18 '22 21:08 zaden1

Electron-Builder Version: 23.3.3 Node Version: v17.3.0 Electron Version:20.0.3 Electron Type (current, beta, nightly):current Target: windows


Hi !

I have the same problem with versio 5.2.1 going back to 4.2.0 didn't change anything.

What I could see is that the file is uploaded to the pending folder, renamed and then deleted directly which implies that it is impossible to update the application, does anyone have a solution for this?

Thomasfds avatar Aug 20 '22 16:08 Thomasfds