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

ProductUpgrader: be extra careful about a copy loop #1672

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

derrickstolee
Copy link
Contributor

@derrickstolee derrickstolee commented Jun 2, 2020

The ProductUpgrader makes a backup of the C:\Program Files\GVFS folder before running the install, as a mechanism for backing out a failed upgrade. However, it copies that data into C:\Program Files\GVFS\ProgramData\GVFS.Upgrade\Tools, which can create a copy loop! This affected an actual user.

I'm not sure why this affects that one user but not another. In addition to adding more defensive programming (adding the target of the copy to the list of exclusions), I also added some extra tracing so we can see how these strings differ on this machine.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee marked this pull request as ready for review June 2, 2020 19:17
@derrickstolee
Copy link
Contributor Author

The log message said this on the user's machine:

Copying contents of 'C:\\Program Files\\GVFS' to 'C:\\Program Files\\GVFS\\ProgramData\\GVFS.Upgrade\\Tools',excluding 'C:\\Program Files\\GVFS\\ProgramData\\GVFS.Upgrade\\Tools' and 'C:\\Program Files\\GVFS\\ProgramData'

So, not a case issue. I have no idea why this works for most users.

However, this situation did fix the issue for the user with the problem!

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caveat: I'm not an expert in this area, but from what I gather via the commit messages, the PR description and the diffs, this looks correct.

@derrickstolee
Copy link
Contributor Author

The log message said this on the user's machine:

Copying contents of 'C:\\Program Files\\GVFS' to 'C:\\Program Files\\GVFS\\ProgramData\\GVFS.Upgrade\\Tools',excluding 'C:\\Program Files\\GVFS\\ProgramData\\GVFS.Upgrade\\Tools' and 'C:\\Program Files\\GVFS\\ProgramData'

So, not a case issue. I have no idea why this works for most users.

Because IT DOESN'T WORK. This means gvfs upgrade is completely broken for 1.0.20112.1 and later. :(

derrickstolee added a commit that referenced this pull request Jun 2, 2020
…opy loop

The `ProductUpgrader` makes a backup of the `C:\Program Files\GVFS` folder before running the install, as a mechanism for backing out a failed upgrade. However, it copies that data into `C:\Program Files\GVFS\ProgramData\GVFS.Upgrade\Tools`, which can create a copy loop! This affected an actual user.

I'm not sure why this affects that one user but not another. In addition to adding more defensive programming (adding the target of the copy to the list of exclusions), I also added some extra tracing so we can see how these strings differ on this machine.

See #1672 for the master PR.
@derrickstolee
Copy link
Contributor Author

I'm going to add documentation into the troubleshooting.md doc before I merge this into master, but I'll wait for a new version number before pushing those changes. The HOTFIX is merged so I am moving forward with the release process.

…...-
Checking for GVFS upgrades...\
Checking for GVFS upgrades...\
Checking for GVFS upgrades...|
Checking for GVFS upgrades...|
Checking for GVFS upgrades...Succeeded

New version 1.0.19346.2 is available.

Upgrade will unmount and remount gvfs repos, ensure you are at a stopping point.
When ready, run `gvfs upgrade --confirm` from an elevated command prompt. bug

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee merged commit a35b592 into microsoft:master Jun 3, 2020
derrickstolee added a commit that referenced this pull request Jul 28, 2020
Major Updates
-----------------

* Comes with Git for Windows 2.28.0
* Previous builds were not including fully-signed DLLs. This is now fixed.

Pull Requests
---------------

* #1672: ProductUpgrader: be extra careful about a copy loop
* #1674: Config: disable status.submoduleSummary
* #1675: PreCommandHook: don't lock pack-objects 
* #1676: Update Git to v2.27.0.vfs.1.0 
*  #1679: BuildGVFSForWindows.bat: use nuget on PATH
* #1683: GVFS.SignFiles.csproj: include more DLLs for signing
* #1685: minor path comparison fixup in ProductUpgrader
*  #1682: Update Git to v2.28.0
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 this pull request may close these issues.

2 participants