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

scalar upgrade fails with "Could not find Git installer in the latest release" #351

Closed
rainersigwald opened this issue Mar 10, 2020 · 2 comments · Fixed by #381
Closed

Comments

@rainersigwald
Copy link
Member

scalar upgrade --confirm
Checking for Scalar upgrades...Succeeded
New Scalar version 20.3.167.1 available in ring Fast.
Launching upgrade tool...

Installer launched in a new window. Do not run any git or scalar commands until the installer has completed.

from the other window

Downloading...Failed

ERROR: Could not find Git installer in the latest release.

Upgrade logs can be found at: C:\ProgramData\Scalar\Scalar.Upgrade\UpgraderLogs with file names that end with the installation ID: 20200310_110822.

Press Enter to exit.

from that log

[2020-03-10 11:09:25.5691 -05:00] TryRunPreUpgradeChecks (Start)
[2020-03-10 11:09:30.9643 -05:00] Information {"Message":"Successfully finished pre upgrade checks. Okay to run `scalar upgrade`."}
[2020-03-10 11:09:30.9663 -05:00] TryRunPreUpgradeChecks (Stop) {"DurationMs":5396}
[2020-03-10 11:09:30.9667 -05:00] TryCheckIfUpgradeAvailable (Start)
[2020-03-10 11:10:21.9613 -05:00] Information {"Message":"New release found - latest available version: 20.3.167.1"}
[2020-03-10 11:10:21.9614 -05:00] TryCheckIfUpgradeAvailable (Stop) {"DurationMs":50994}
[2020-03-10 11:10:22.0200 -05:00] Installed Version {"installedScalarVersion":"20.01.165.7","installedGitVersion":"2.25.0.vfs.1.1"}
[2020-03-10 11:10:22.0203 -05:00] TryDownloadUpgrade (Start) {"Upgrade Step":"TryDownloadUpgrade","Version":"20.3.167.1"}
[2020-03-10 11:15:51.8990 -05:00] Error {"Upgrade Step":"TryDownloadUpgrade","Version":"20.3.167.1","ErrorMessage":"TryDownloadNewestVersion failed. Could not find Git installer in the latest release."}
[2020-03-10 11:15:51.8991 -05:00] TryDownloadUpgrade (Stop) {"DurationMs":329878}

(that was under the debugger, the duration is bogus)

In the debugger, I can see:

this.newestRelease.Assets
Count = 2
    [0]: {Scalar.Common.GitHubUpgrader.Asset}
    [1]: {Scalar.Common.GitHubUpgrader.Asset}

this.newestRelease.Assets[0]
{Scalar.Common.GitHubUpgrader.Asset}
    DownloadURL: {https://github.com/microsoft/scalar/releases/download/v20.03.167.1/Installers_macOS_Release.tar.gz}
    LocalPath: null
    Name: "Installers_macOS_Release.tar.gz"
    Size: 120880351

this.newestRelease.Assets[1]
{Scalar.Common.GitHubUpgrader.Asset}
    DownloadURL: {System.Uri}
    LocalPath: null
    Name: "Installers_Windows_Release.zip"
    Size: 86376247

And indeed that seems to match the release assets. But isn't git packed into the .zip?

@derrickstolee
Copy link
Contributor

Hi @rainersigwald. We are working on an improved upgrade story, and plan to remove the scalar upgrade command. Sorry for the inconvenience here.

Cc: @mjcheetham

@derrickstolee
Copy link
Contributor

I realized what the problem is and will work on a fix tomorrow. The problem is the difference here:

On VFS for Git, we only support Windows so all assets are available separately:

image

But on Scalar, we support Windows and Mac, so our installers look completely different:

image

The command scalar upgrade came along for the ride with the VFS for Git conversion, but we never made the appropriate changes to make it work with our install story in Scalar.

derrickstolee added a commit that referenced this issue May 28, 2020
…r Git

Scalar was created by forking the VFS for Git codebase, deleting a bunch of code, then renaming a bunch of files. It has since diverged significantly through many refactors.

One thing that has _never worked_ is the `scalar upgrade` verb when using GitHub as the source. The reason is that we package our releases differently than VFS for Git does, so the upgrader fails to find the Git installer and Scalar installer (instead, we have two `.zip` files, one for each platform). Since we are moving to another system for the typical upgrade pattern, we should just delete the GitHub upgrader. The `scalar upgrade` verb will remain for the NuGet feed, when configured. This resolves #351.

An issue was found in VFS for Git where the service would restart constantly when checking for an upgrade. The root cause was a problematic `Environment.Exit()` call. See microsoft/VFSForGit#1668 for an equivalent change.

Another annoying thing is the verbose output during `scalar clone` that repeats the given options. In the case of a non-GVFS protocol clone, some of these just don't make sense. Delete this output for clarity.

Finally, `scalar clone` failed miserably when using a non-standard URL such as `file://`. Fix that by doing some URL scanning in advance. If the URL does not start with `http://` or `https://`, we will not even try the GVFS protocol and will move on to a native Git clone. We also avoid any protocol prefix (`X://`) that is not `http://`, `https://` or `ssh://`. For SSH, the protocol prefix is not required, so we do not require a protocol prefix. Resolves #378.

Since this is a grab-bag of things, please review commit-by-commit. For the GitHub upgrader removal, consider ignoring whitespace changes.
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