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

ProjFSFilter: Be more robust to missing PowerShell #1658

Merged
merged 2 commits into from
May 12, 2020

Conversation

derrickstolee
Copy link
Contributor

A user had issues and we started a support line. Their diagnose log
had thousands of service logs. These were all failing with this call
stack pointing to the method changed here:

System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
 at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at GVFS.Common.ProcessHelper.StartProcess(Process executingProcess)
    at GVFS.Common.ProcessHelper.Run(ProcessStartInfo processInfo, String errorMsgDelimeter, Object executionLock)
     at GVFS.Platform.Windows.ProjFSFilter.IsGVFSUpgradeSupported() in E:\\A\\_work\\822\\s\\GVFS\\GVFS.Platform.Windows\\ProjFSFilter.cs:line 371 
       at GVFS.Upgrader.InstallerPreRunChecker.IsGVFSUpgradeAllowed(String& consoleError) 
        at GVFS.Upgrader.InstallerPreRunChecker.TryRunPreUpgradeChecks(String& consoleError) 
          at GVFS.Service.ProductUpgradeTimer.TimerCallback(Object unusedState) in E:\\A\\_work\\822\\s\\GVFS\\GVFS.Service\\ProductUpgradeTimer.cs:line 168

The only explanation I can think of is that PowerShell is not
available on their system!

A user had issues and we started a support line. Their diagnose log
had _thousands_ of service logs. These were all failing with a call
stack pointing to the method changed here.

The only explanation I can think of is that PowerShell is not
available on their system!

Signed-off-by: Derrick Stolee <[email protected]>
This will throw a new PowershellNotFoundException if not found, but
this is a private static method. One caller catches this exception
explicitly, and then returns an "invalid" mode. The only other
caller only happens if the first returns "disabled" instead.

Signed-off-by: Derrick Stolee <[email protected]>
Copy link
Member

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

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

LGTM

@derrickstolee derrickstolee merged commit 154686f into microsoft:master May 12, 2020
derrickstolee added a commit that referenced this pull request May 28, 2020
…vironment.Exit()

A user reported an issue via the Teams channel. Looking at the diagnose logs I saw that the user's `GVFS.Service` was restarting in a loop with an exception tracking down to this `Environment.Exit()` call.

It's completely unacceptable to exit here, as it kills the service and then it restarts. Better to have no upgrades than to let this continue.

The cause of this exception was a missing executable when checking `ProjFS.IsGVFSUpgradeSupported()`, which seems to call PowerShell. The only reason the stack would have a `Win32Exception` with "The system cannot find the file specified" is that `powershell.exe` is not on the `PATH`, which was fixed in #1658.
derrickstolee added a commit that referenced this pull request Jun 2, 2020
Includes the following pull requests:

* #1663: Update Git to v2.27.0
* #1669: Docs: more troubleshooting and FAQs
* #1668: ProductUPgradeTimer: remove unacceptable Environment.Exit()
* #1664: Update USN journal entries for projected folders
* #1666: Docs: start basic template
* #1658: ProjFSFilter: Be more robust to missing PowerShell
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.

3 participants