简体   繁体   English

Microsoft Service Fabric 主机服务 (FabricHostSvc) 在启动时挂起

[英]Microsoft Service Fabric Host Service (FabricHostSvc) Hangs on Start

I've been working with Microsoft Service Fabric since November 2015 and have encountered many issues but now Service Fabric has become completely non-functional on my development machine.自 2015 年 11 月以来,我一直在使用 Microsoft Service Fabric,遇到了很多问题,但现在 Service Fabric 在我的开发机器上完全无法正常工作。 Uninstall/reinstall doesn't help.卸载/重新安装没有帮助。

I was using 1.5-preview and have since tried 2.0 to no avail.我使用的是 1.5-preview,此后尝试了 2.0 无济于事。

The problem started when I attempted to run a Service Fabric Application from Visual Studio 2015 Update 1 (as I have done hundreds of times over the past few months).当我尝试从 Visual Studio 2015 Update 1 运行 Service Fabric 应用程序时,问题就开始了(过去几个月我已经做了数百次)。

My machine blue-screened (first time I've seen a Windows 10 blue screen).我的机器蓝屏(我第一次看到 Windows 10 蓝屏)。 After rebooting, I was unable to get my Service Fabric Application to deploy via Visual Studio.重新启动后,我无法通过 Visual Studio 部署我的 Service Fabric 应用程序。 The PowerShell script failed with the following message: PowerShell 脚本失败并显示以下消息:

Starting service FabricHostSvc.启动服务 FabricHostSvc。 This may take a few minutes... Start-Service : Failed to start service 'Microsoft Service Fabric Host Service (FabricHostSvc)'.这可能需要几分钟的时间...启动服务:无法启动服务“Microsoft Service Fabric 主机服务 (FabricHostSvc)”。

I went into the SCM and found "Microsoft Service Fabric Host Service" was in a state of Starting.进入SCM,发现“Microsoft Service Fabric Host Service”处于Starting状态。 It stayed that way for an hour.就这样呆了一个小时。 I tried stopping and starting the service several times and each time it hangs.我多次尝试停止和启动服务,每次都挂起。

I uninstalled Service Fabric (Service Fabric, SDK and Tools for VS) and re-installed with the latest version 2.0 and it exhibits the same problem.我卸载了 Service Fabric(Service Fabric、SDK 和 VS 工具)并使用最新版本 2.0 重新安装,但它出现了同样的问题。

Reboot, same problem.重启,同样的问题。

Removed c:\\SfDevCluster folder, same problem.删除了 c:\\SfDevCluster 文件夹,同样的问题。

Based on some other articles, I looked for any stray performance counters after uninstalling but there weren't any.根据其他一些文章,我在卸载后查找了任何杂散的性能计数器,但没有。

I tried looking through the registry but there are other Azure components with "Fabric" in the name.我尝试查看注册表,但还有其他名称中带有“Fabric”的 Azure 组件。 If I delete them, I will probably hose the rest of my Azure dev setup.如果我删除它们,我可能会处理其余的 Azure 开发设置。

Now... when I attempted to start the service again, it did re-create the SfDevCluster folder and give me some logs.现在...当我再次尝试启动该服务时,它确实重新创建了 SfDevCluster 文件夹并给了我一些日志。 It seems to create two trace log files per minute and they have the EXACT same contents.它似乎每分钟创建两个跟踪日志文件,并且它们具有完全相同的内容。

Every time it fails, the final line of the trace is:每次失败时,跟踪的最后一行是:

Info ,11176,General.FabricSetup.Main,Operation failed with error 0xffffffff信息 ,11176,General.FabricSetup.Main,Operation failed with error 0xffffffff

An earlier trace (SF 1.5) seemed to use a constant rather than the hex value for the error.较早的跟踪 (SF 1.5) 似乎使用常量而不是十六进制值来表示错误。 Seemed to indicate an invalid argument.似乎表明一个无效的论点。

Whatever this failure is, it seems to be the cause of my woes.不管这次失败是什么,它似乎是我痛苦的原因。 Unfortunately, the error is completely unhelpful.不幸的是,该错误完全没有帮助。

I'm trying to avoid reinstalling Windows because that will kill an entire day of productivity.我试图避免重新安装 Windows,因为这会影响一整天的工作效率。

Any help is greatly appreciated.任何帮助是极大的赞赏。

From an elevated powershell session please run: Unregister-ScheduledTask FabricCounters.请从提升的 powershell 会话运行:Unregister-ScheduledTask FabricCounters。

This will fix the issue.这将解决问题。

I was seeing very similar behaviour and reinstalls of the fabric SDK and runtime, deleting scheduled tasks, deleting the SfDevCluster contents etc. all didn't work.我看到了非常相似的行为,重新安装了结构 SDK 和运行时、删除计划任务、删除 SfDevCluster 内容等,但都没有奏效。

I was seeing repeated Docker errors in the event log and when I tried uninstalling Docker for Windows SF instantly woke up.我在事件日志中看到重复的 Docker 错误,当我尝试卸载适用于 Windows SF 的 Docker 时,我立即醒了过来。 I have no idea what the interaction is between the two but worth checking if you have both installed.我不知道两者之间的交互是什么,但值得检查一下你是否都安装了。

For the benefit of searchers, this is the Powershell script I use to fix my local cluster.为了搜索者的利益,这是我用来修复本地集群的Powershell脚本。 It was adapted from this issue fix on github.它改编自 github 上的此问题修复程序

#
# WARNING: YOU MUST STOP 'SERVICE FABRIC HOST SERVICE' IN SERVICES FIRST
#          IF THE APPLICATION IS STUCK IN 'STARTING', RESTART YOUR MACHINE
# 
# This script will completely reset the local cluster
# 

Remove-Item 'C:\SfDevCluster' -Recurse -Force -ErrorAction Stop 

New-Item -ItemType directory -Path 'C:\SfDevCluster'

Set-Location 'C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup'

./DevClusterSetup.ps1 -PathToClusterDataRoot 'C:\SfDevCluster\Data' -PathToClusterLogRoot 'C:\SfDevCluster\Log'

C:\\ drive was full for me. C:\\ 驱动器对我来说已满。 Easy thing to overlook.容易忽视的事情。

Make sure your hard disks aren't full... that was stopping mine from starting.确保你的硬盘没有满......这阻止了我的启动。 Immediately after clearing up some logs, starts up right away.清除一些日志后,立即启动。

It seems like some cluster related settings have gone into an inconsistent state on your machine.似乎某些与集群相关的设置在您的机器上进入了不一致的状态。 This will require looking at Service Fabric traces and figure out the actual cause.这将需要查看 Service Fabric 跟踪并找出实际原因。 I am an engineer on the Service Fabric team.我是 Service Fabric 团队的一名工程师。 I can help you out if you can email me the Service Fabric traces (from logs folder) at harahma[at]microsoft[dot]com.如果您可以将位于 harahma[at]microsoft[dot]com 的 Service Fabric 跟踪(来自日志文件夹)通过电子邮件发送给我,我可以帮助您。

If you are familiar with logging support tickets on Azure, I would suggest you do that too so we can track this issue to resolution.如果您熟悉在 Azure 上记录支持票,我建议您也这样做,以便我们可以跟踪此问题以解决问题。 In the meantime I will continue to work on this to see how we can unblock you.与此同时,我将继续努力解决这个问题,看看我们如何才能解除对您的封锁。

I know this is an old and question, but maybe my pain can help someone else out.我知道这是一个古老的问题,但也许我的痛苦可以帮助其他人。

You'll get a similar error if the Windows Firewall service is not running when Service Fabric attempts to start.如果 Service Fabric 尝试启动时 Windows 防火墙服务未运行,您将收到类似的错误。

Check and make sure that the Windows Firewall service is set for Automatic and is running.检查并确保 Windows 防火墙服务设置为自动并正在运行。

I have tried multiple options to resolve this issue like我尝试了多种选择来解决此问题,例如

  1. Uninstall runtime and SDK - Reinstall it.卸载运行时和 SDK - 重新安装。
  2. Removed cluster using powershell commands and setup using the same and there are couple of more BUT unfortunately none of them worked for me使用 powershell 命令删除了集群,并使用相同的设置进行了设置,还有更多但不幸的是,没有一个对我有用

Then finally I have Uninstalled Docker Desktop and suddenly issue got resolved.最后卸载了 Docker 桌面,突然问题得到了解决。

This is very strange and not sure how docker desktop is obstackle for running FabricHostSvc Service.这很奇怪,不确定 docker desktop 是如何运行 FabricHostSvc 服务的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM