microsoft / microsoft/VFSForGit

Windows: HooksInstaller.InstallHooks sometimes fails during mount verb

Open
#955 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects: polish affects: reliability platform: windows type: bug
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

We've had a three reports of this issue since the release of version 1.0.18297.1:

Two reports of "Failed to flush buffers":

Error installing hooks: Failed to copy C:\Program Files\GVFS\GVFS.ReadObjectHook.exe
System.ComponentModel.Win32Exception (0x80004005): Failed to flush buffers for 'F:\<repo name>\src\.git\hooks\read-object.exe.temp'
   at GVFS.Common.NativeMethods.ThrowLastWin32Exception(String message)
   at GVFS.Common.NativeMethods.FlushFileBuffers(String path)
   at GVFS.Common.FileSystem.PhysicalFileSystem.TryCopyToTempFileAndRename(String sourcePath, String destinationPath, Exception& handledException)

One report of "Failed to move":

e:\git\os\src>gvfs mount
Error installing hooks: Failed to copy GitHooksLoader.exe to E:\git\<repo name>\src\.git\hooks\pre-command.exe
System.ComponentModel.Win32Exception (0x80004005): Failed to move 'E:\git\os\src\.git\hooks\pre-command.exe.temp' to 'E:\git\os\src\.git\hooks\pre-command.exe'
   at GVFS.Common.NativeMethods.ThrowLastWin32Exception(String message)
   at GVFS.Common.NativeMethods.MoveFile(String existingFileName, String newFileName, MoveFileFlags flags)
   at GVFS.Common.FileSystem.PhysicalFileSystem.TryCopyToTempFileAndRename(String sourcePath, String destinationPath, Exception& handledException)

Ideally we can root cause and fix this, but at a minimum, we should update VFS4G to provide the user with a more actionable message.

Related issue: #168

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at HooksInstaller.InstallHooks and the PhysicalFileSystem.TryCopyToTempFileAndRename stack traces, then inspect the Windows mount verb path that installs Git hooks. Reproduce the flush or move failure if possible; done means identifying and fixing the failure or, at minimum, presenting a more actionable VFS4G error message.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.