Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-Updater may fail for signed electron apps #116

Closed
jfaltermeier opened this issue Jun 30, 2021 · 9 comments · Fixed by #158
Closed

Auto-Updater may fail for signed electron apps #116

jfaltermeier opened this issue Jun 30, 2021 · 9 comments · Fixed by #158
Assignees
Milestone

Comments

@jfaltermeier
Copy link
Contributor

jfaltermeier commented Jun 30, 2021

Bug Description:

When testing updating from Theia-Blueprint 1.13.0 (https://download.eclipse.org/theia/1.13.0/windows/) to the latest version, it fails with this log message:
[error] Error: Error: sha512 checksum mismatch, expected YYK4Rj/MMIRE/MeFSfVuQOeShXxrwdM5TMgjgPc5uvNxLkQpqUMqTX7MoqYeLpW2gvcgaeVDYPfFROu8LIhtSw==, got EwV8hwXMsQ+5qIjZ1HFGcdPJyBqdkXyCZCSopvhPzhRzwltCZRWvthszWrVUGb/ranElMKAH38YFLo8Y0IfRSw==

This is probably caused because we sign the installers after this checksum was computed. So we will have to update the metadata file https://download.eclipse.org/theia/latest/windows/latest.yml with the checksum after signing

Auto-Update works for the unsigned Linux AppImage

Steps to Reproduce:

  1. Download 1.13.0 and attempt an update
  2. Check logs at C:\Users\<username>\AppData\Roaming\Theia Blueprint\logs\main.log
@jfaltermeier jfaltermeier added this to the Beta 2 milestone Jun 30, 2021
@jfaltermeier jfaltermeier self-assigned this Jun 30, 2021
@jfaltermeier
Copy link
Contributor Author

@brianking Could you please check this for Mac by updating the 1.13 version: https://download.eclipse.org/theia/1.13.0/macos/
As this is signed as well, I would expect the same issue as for windows.

@brianking
Copy link

It's failing on macOS, but with a different error.

[2021-06-30 10:54:08.685] [info]  Checking for update
[2021-06-30 10:54:09.385] [info]  Found version 1.14.0 (url: TheiaBlueprint.dmg)
[2021-06-30 10:54:37.295] [info]  Downloading update from TheiaBlueprint.dmg
[2021-06-30 10:54:37.299] [error] Error: Error: ZIP file not provided: [
  {
    "url": "https://download.eclipse.org/theia/latest/macos/TheiaBlueprint.dmg",
    "info": {
      "url": "TheiaBlueprint.dmg",
      "sha512": "...",
      "size": 341751733
    }
  }
]

I have omitted the sha512 value on purpose, not sure if it is sensitive info.

@jfaltermeier
Copy link
Contributor Author

It's failing on macOS, but with a different error.

[2021-06-30 10:54:08.685] [info]  Checking for update
[2021-06-30 10:54:09.385] [info]  Found version 1.14.0 (url: TheiaBlueprint.dmg)
[2021-06-30 10:54:37.295] [info]  Downloading update from TheiaBlueprint.dmg
[2021-06-30 10:54:37.299] [error] Error: Error: ZIP file not provided: [
  {
    "url": "https://download.eclipse.org/theia/latest/macos/TheiaBlueprint.dmg",
    "info": {
      "url": "TheiaBlueprint.dmg",
      "sha512": "...",
      "size": 341751733
    }
  }
]

I have omitted the sha512 value on purpose, not sure if it is sensitive info.

Thanks! Seems like electron-userland/electron-builder#2199
I'll have a look at this as well

jfaltermeier added a commit that referenced this issue Jul 26, 2021
* Update metadata with info for signed windows build
jfaltermeier added a commit that referenced this issue Jul 27, 2021
* Update metadata with info for signed windows build
jfaltermeier added a commit that referenced this issue Jul 27, 2021
* Update metadata with info for signed windows build
@jfaltermeier
Copy link
Contributor Author

Short update on the windows situation. Updating file size and hash in the metadata file is possible and then leads to the installer being downloaded and invoked. However we then hit a further bug: electron-userland/electron-builder#4711

jfaltermeier added a commit that referenced this issue Jul 27, 2021
* Update metadata with info for signed windows build
jfaltermeier added a commit that referenced this issue Jul 27, 2021
* Update metadata with info for signed windows build
jfaltermeier added a commit that referenced this issue Jul 27, 2021
* Update metadata with info for signed windows build
@brianking
Copy link

@jfaltermeier Any updates about macOS?

For Windows, do you see any possible workarounds?

I presume we don't want to get out of beta (1.0?) without having updates fixed, right?

@jfaltermeier
Copy link
Contributor Author

For Windows I have applied a manual fix at the moment, which then leads to a working update: https://download.eclipse.org/theia/latest/windows/
In PR #129 I am working on integrating this into the build process, so that no manual fixes are required. This already fixes the issue mentioned in #116 (comment)

Once this is done, I will continue with Mac, as this is a blocker for getting out of beta.

jfaltermeier added a commit that referenced this issue Aug 25, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
jfaltermeier added a commit that referenced this issue Aug 25, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
jfaltermeier added a commit that referenced this issue Aug 25, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
jfaltermeier added a commit that referenced this issue Aug 25, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
jfaltermeier added a commit that referenced this issue Aug 25, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Aug 26, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Aug 26, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Aug 27, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Aug 31, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Sep 1, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Sep 2, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Sep 2, 2021
* add typescript script to update the checksum metadata for an installer
and also include the version number in the installer filename path
* change build process so that the windows installer gets a fixed
checksum after signing and create a link to the installer including the
version number
* also build zip for mac because required for updates
jfaltermeier added a commit that referenced this issue Sep 2, 2021
* Copy windows installer with version instead of soft linking
@jfaltermeier
Copy link
Contributor Author

@brianking I've set up a small testing environment and I think updating from e.g 1.16.0 (https://download.eclipse.org/theia/1.16.0/) to 1.17.1 on mac os should work now.
It does not work when the dmg is launched from the Downloads directory directly, as this is then mounted as read-only (for this we should probably open a ticket to improve error reporting, because this was only visible in the logs).
But when I copy blueprint to the Applications directory, the update worked for me. Could you please test this as well?

jfaltermeier added a commit that referenced this issue Sep 2, 2021
* Copy windows installer with version instead of soft linking
@brianking
Copy link

@brianking I've set up a small testing environment and I think updating from e.g 1.16.0 (https://download.eclipse.org/theia/1.16.0/) to 1.17.1 on mac os should work now.
It does not work when the dmg is launched from the Downloads directory directly, as this is then mounted as read-only (for this we should probably open a ticket to improve error reporting, because this was only visible in the logs).
But when I copy blueprint to the Applications directory, the update worked for me. Could you please test this as well?

This update worked successfully for me @jfaltermeier. The only thing missing for me is a progress indicator for the download. It appeared for a while that nothing was happening, until the notification came up prompting me to apply the update.

@jfaltermeier
Copy link
Contributor Author

@brianking I've set up a small testing environment and I think updating from e.g 1.16.0 (https://download.eclipse.org/theia/1.16.0/) to 1.17.1 on mac os should work now.
It does not work when the dmg is launched from the Downloads directory directly, as this is then mounted as read-only (for this we should probably open a ticket to improve error reporting, because this was only visible in the logs).
But when I copy blueprint to the Applications directory, the update worked for me. Could you please test this as well?

This update worked successfully for me @jfaltermeier. The only thing missing for me is a progress indicator for the download. It appeared for a while that nothing was happening, until the notification came up prompting me to apply the update.

Thanks! I've opened #160 and #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants