microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.02k stars 399 forks source link

Cannot Install Because PowerShell Repeatedly Stops Working #675

Closed brianstringfellow closed 4 years ago

brianstringfellow commented 5 years ago

Followed the installation steps and ensured prerequisites are in place. Run the PowerShell command 'Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser'. The old SF SDK and cluster have been uninstalled.

Used the Core SDK WebPI link. Always fails.

Unable to get Powershell ExecutionPolicy. ExitCode: -1073741819

image

brianstringfellow commented 5 years ago

Is PowerShell 6.1 required? I was using 5.1 when I saw the error. I just installed 6.1 from https://github.com/PowerShell/PowerShell and the installation succeeded.

When configuring the cluster for 1-node and starting the local cluster, I did still see the old PowerShell window pop up and it also stopped working. Even with that, the cluster still started, though I don't know what failed to execute during those stopped instances.

brianstringfellow commented 5 years ago

Install still fails on 6.4.622. image


DownloadManager Information: 0 : Product Microsoft Visual C++ 2012 SP1 Redistributable Package (x64) done install completed
DownloadManager Information: 0 : Increasing current install to 2
DownloadManager Information: 0 : Starting EXE command for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'. Commandline is: 'C:\WINDOWS\sysnative\cmd.exe /c wmic product where name="Microsoft Azure Service Fabric" call uninstall'. Process Id: 26712
DownloadManager Information: 0 : Install exit code for product 'Microsoft Azure Service Fabric Runtime - 6.4.622' is '0'
DownloadManager Information: 0 : Ignoring exit code '0' for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'
DownloadManager Information: 0 : Starting EXE command for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'. Commandline is: 'C:\WINDOWS\sysnative\cmd.exe /c sc.exe stop KtlLogger'. Process Id: 22892
DownloadManager Information: 0 : Install exit code for product 'Microsoft Azure Service Fabric Runtime - 6.4.622' is '1060'
DownloadManager Information: 0 : Ignoring exit code '1060' for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'
DownloadManager Information: 0 : Starting EXE command for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'. Commandline is: 'C:\WINDOWS\sysnative\cmd.exe /c sc.exe stop LeasLayr'. Process Id: 22524
DownloadManager Information: 0 : Install exit code for product 'Microsoft Azure Service Fabric Runtime - 6.4.622' is '1060'
DownloadManager Information: 0 : Ignoring exit code '1060' for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'
DownloadManager Information: 0 : Starting EXE command for product 'Microsoft Azure Service Fabric Runtime - 6.4.622'. Commandline is: 'C:\Users\212567841\AppData\Local\Microsoft\Web Platform Installer\installers\ServiceFabricRuntime_6_4_CU2\08F6D57CA8CD3E54C96CAE71F23DA3D232CD8F2E\MicrosoftServiceFabric.6.4.622.9590.exe /AcceptEULA'. Process Id: 25616
DownloadManager Information: 0 : Install exit code for product 'Microsoft Azure Service Fabric Runtime - 6.4.622' is '1'
DownloadManager Error: 0 : Install return code for product 'Microsoft Azure Service Fabric Runtime - 6.4.622' is Failure
DownloadManager Information: 0 : Product Microsoft Azure Service Fabric Runtime - 6.4.622 done install completed
DownloadManager Information: 0 : Increasing current install to 3
DownloadManager Warning: 0 : Dependency failed for product 'Microsoft Azure Service Fabric SDK - 3.3.622'. Skipping install
DownloadManager Warning: 0 : Dependency failed for product 'Microsoft Azure Service Fabric SDK - 3.3.622'. Skipping install
DownloadManager Information: 0 : Product Microsoft Azure Service Fabric SDK - 3.3.622 had a dependency fail. Increasing install product to 4
DownloadManager Information: 0 : Product Microsoft Azure Service Fabric SDK - 3.3.622 had a dependency fail. Increasing install product to 5
DownloadManager Information: 0 : Product: VC11Redist_x64, Install Status: InstallCompleted-Success, Install Time: 00:00:02.1241348
DownloadManager Information: 0 : Product: ServiceFabricRuntime_6_4_CU2, Install Status: InstallCompleted-Failure, Install Time: 00:01:34.2588539
DownloadManager Information: 0 : Product: ServiceFabricSDK_3_3_CU2, Install Status: DependencyFailed-None, Install Time: 00:00:00
DownloadManager Information: 0 : Product: MicrosoftAzure-ServiceFabric-CoreSDK, Install Status: DependencyFailed-None, Install Time: 00:00:00
mikkelhegn commented 5 years ago

Based on you rprevious comment install succeeded with PowerShell 6.1. How did you run the new installation?

brianstringfellow commented 5 years ago

I initially tried using the Web Platform Installer. Then I also tried to run with PowerShell 6.1 just now and it still fails as before with the message "Unable to get Powershell ExecutionPolicy. ExitCode: -1073741819". Perhaps it was an odd coincidence that installing PowerShell 6.1 correlated with a successful install. I found that powershell will return the expected policy but also exits with an error code.

image

Checking the event log, I see PowerShell is crashing:


Faulting application name: powershell.exe, version: 10.0.16299.15, time stamp: 0xfdd02487
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000000000177
Faulting process id: 0x2204
Faulting application start time: 0x01d497e99d87fabb
Faulting application path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Faulting module path: unknown
Report Id: 6c7852b0-de54-40a7-ac4b-27f844cce3dd
Faulting package full name: 
Faulting package-relative application ID: 
brianstringfellow commented 5 years ago

Finally found something that works and allowed me to successfully install. There are at least two ways to launch PowerShell and 'Run as Administrator'. Somehow it makes a difference in the execution where one way succeeds and the other way fails when exiting the child PowerShell process. In the image below, the left side succeeds with an exit code of 0 and the right side fails with -1073741819. Any idea how they differ? The whoami and $PSVersionTable are identical in both instances.

image

mikkelhegn commented 5 years ago

The error code indicates that access was denied to some resource. @maburlik: Do you have any ideas why this would happen?

brianstringfellow commented 5 years ago

The problem continues with the Web Platform Installer 5.1 while trying to install Runtime 6.5.641 and SDK 3.4.641. I'm setting up an entirely clean machine with Windows 10 Enterprise (17134.885). Again, I used PowerShell with 'Run as Administrator' using the downloaded msi files to workaround the problem.

brianstringfellow commented 4 years ago

Nearly another year has passed and the Web Platform Installer 5.1 still fails. Again, clean machine with Windows 10 Enterprise (18363.836).

image

maburlik commented 4 years ago

This appears to be the same issue as https://github.com/microsoft/service-fabric/issues/756

If you can ensure the powershell execution policy is set prior to running the installer, you can skip this step using the parameter /SkipPSExecutionPolicy.