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. Uninstall/reinstall doesn't help.
I was using 1.5-preview and have since tried 2.0 to no avail.
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).
My machine blue-screened (first time I've seen a Windows 10 blue screen). After rebooting, I was unable to get my Service Fabric Application to deploy via Visual Studio. The PowerShell script failed with the following message:
Starting service FabricHostSvc. This may take a few minutes...
Start-Service : Failed to start service 'Microsoft Service Fabric Host
Service (FabricHostSvc)'.
I went into the SCM and found "Microsoft Service Fabric Host Service" was in a state of 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.
Reboot, same problem.
Removed c:\SfDevCluster folder, same problem.
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. If I delete them, I will probably hose the rest of my Azure dev setup.
Now... when I attempted to start the service again, it did re-create the SfDevCluster folder and give me some logs. 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
An earlier trace (SF 1.5) seemed to use a constant rather than the hex value for the error. 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.
Any help is greatly appreciated.
From an elevated powershell session please run: 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.
I was seeing repeated Docker errors in the event log and when I tried uninstalling Docker for Windows SF instantly woke up. 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. It was adapted from this issue fix on 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. 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. I am an engineer on the Service Fabric team. I can help you out if you can email me the Service Fabric traces (from logs folder) at harahma[at]microsoft[dot]com.
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. 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.
Check and make sure that the Windows Firewall service is set for Automatic and is running.
I have tried multiple options to resolve this issue like
Uninstall runtime and SDK - Reinstall it.
Removed cluster using powershell commands and setup using the same
and there are couple of more
BUT unfortunately none of them worked for me
Then finally I have Uninstalled Docker Desktop and suddenly issue got resolved.
This is very strange and not sure how docker desktop is obstackle for running FabricHostSvc Service.
Related
I am having the following problem. A while ago I migrated my project from .net core 2.2 to .net 5. Migration itself was no problem, locally everything worked almost out of the box. But then I was facing problems deploying the app into an azure app service. The app wouldn't start up. I was getting start up timeouts. After a while I solved the problem by switching the hosting model to outOfProcess
<PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
Because of lack of time to thoroughly test the application, I had to stick with .net 2.2 until now.
Now that I migrated again, I am facing the same issue. Locally everything works just fine, but after deploying to the app service, the application won't start. But the hostingModel doesn't solve it this time.
I tried linux and windows app service, and I tried to deploy via our azure devops pipes as well as manually from VS. I tried to deploy into an existing app service, I tried to deploy into a new app service, created during the deployment process. None of it solves it.
When i look at the log stream, I see the following:
2022-02-10T09:13:55.360Z ERROR - Container webapp... for site t2bwebappdev did not start within expected time limit. Elapsed time = 230.2593377 sec
2022-02-10T09:13:55.368Z ERROR - Container webapp... didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
So I tried to solve this via PORTS and WEBSITES_PORT settings - but non of it seems to get it up and runnig.
Thanks in advance for any hints on how to solve this.
Update:
While I was playing around with the logs, I saw that the app was listening on port 5000. Seems with the Net5 upgrade the launchsettings.json is being ignored.
Then I just dockerized it from VS 2019, and in that container I can also not reach the app. So after all this, could it just be a port issue?
Try adding this line in your Program.cs class:
And make sure you expose ports in Dockerfile:
NOTE:
Everything depends on which port was exposed in Dockerfile.
Port that you have exposed should match with the port you will pass to UseUrls as an argument. Also, consider either http/https in accordance with the existence of the certificate.
I hope my answer was useful and helpful!
The deployment of an Azure Statefulservice is failing with the following output:
Service Status:
fabric:/Cloud.Application/MyServiceStateless is ready.
fabric:/Cloud.Application/MyServiceStateful is not ready, 1 partitions remaining.
Something is taking too long, the application is still not ready.
Finished executing script 'Get-ServiceFabricApplicationStatus'
This is strange since no other member of my team has seen this problem. To help diagnose it, I set a breakpoint at Program.Main(), but the breakpoint was not hit. Instead, the message "The breakpoint will not currently be hit. A copy of Program.cs was found in StatelessServiceXYZ.exe, but the current source code is different from the version built into StatelessServiceXYZ.exe" when the mouse is hovered over they whited out breakpoint circle. This indicates the assembly isn't loading.
Because no one else can reproduce this problem even though our environments are seemingly identical (we're all using Visual Studio 2017, Microsoft Azure ServiceFabric CoreSDK, .Net Frameword 4.5, and Windows 7), it appears there is some configuration difference or problem with my machine. The other solutions to this problem that I've found online, such as lack of disk space, etc., are not applicable to my situation. I've also tried resetting the local cluster to no avail. Deploying a test StatefulService also worked.
I find a similar issue in the github. if updating the netcore runtime is acceptable, you could have a try to update projects to the 2.0.3 runtime service.
I have 2 Service Fabric services, which I need to debug. Those services communicate with each other.
I am using:
VS 2017(update 7),
.NET Framework 4.6.1,
Azure SDK 2.9.5.3,
Service Fabric Tools 2.0.20180124.2,
Service Fabric 6.1.456.9494,
Service Fabric SDK 3.0.456.9494
Everything was going alright, but at some point I've started to get following errors, when I try to start debugging 2nd service.
I don't understand why I am getting those errors.(Google produces absolutely nothing on those errors) Here they are:
1st error: Error MSB4064 The "ProjectReferencesWithConfiguration"
parameter is not supported by the "GetServiceProjectReferences" task.
Verify the parameter exists on the task, and it is a settable public
instance
property. \packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.5\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets 95
2nd error:Error MSB4063 The "GetServiceProjectReferences" task could
not be initialized with its input parameters.
\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.5\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets 94
Here is complete scenario:
One of the services(does not matter which one) in one copy of VS has started successfully without errors.
I've trying to start 2nd service in another copy of VS. And during this attempt I'm getting errors I've mentioned above.
To remedy the situation I have to close offending copy of the VS and open ServiceFabric service project in new VS copy and after that service will start successfully.
Unfortunately all that dancing are getting quite annoying because it's taking up A LOT OF time.
Any help would be appreciated.
I solved this by upgrading Nuget package Microsoft.VisualStudio.Azure.Fabric.MSBuild from version 1.6.4 to 1.6.5
After that also had to manually change 1.6.4 to 1.6.5 in the .sfproj file, as Nuget package manager did not do that automatically.
I had the same issue after upgrading Visual Studio to version 15.6.4 (can't remember what my previous version was). Tried altumano's solution of updating Microsoft.VisualStudio.Azure.Fabric.MSBuild and ran into other errors.
Solution that appears to have worked for me is to upgrade Visual Studio again to version 15.6.6. I still plan to update Service Fabric SDK to a more recent version, but so far this Visual Studio update alone has solved my issue.
It looks like updating Service Fabric SDK to 467 version did the the trick.
I've been working all day today and didn't see pesky error messages during services start up. Now I have in Control Panel\Programs and Features following lines:
Microsoft Azure Service Fabric 6.1.467.9494
Microsoft Azure Service Fabric SDK 6.1.467.9494
Upgrading Visual Studio to version 15.6.7 and Service Fabric SDK to version 3.1.269 seems to work.
I am developing an app to install & run as a Windows service. It's still buggy and stopped unexpectedly (leaving nothing in the Windows Event log either) and when I tried to start it up again I got the error
Windows could not start the {name of service} service on Local Computer.
Error 1067: The process terminated unexpectedly.
I restarted the computer (Server 2008 R2; a virtual machine, in case that makes a difference), no help. Uninstalled and reinstalled my service, and still get that error!
Something on the machine needs cleared out / refreshed so that it will attempt to start the service again. I don't want to rebuild the whole virtual machine but I'm out of ideas.
UPDATE
I forgot to mention that this Windows service -- exact same code & install -- is running on 3 other machines without the above error. Putting in that debugger in OnStart() still sounds like the way to go though.
If you have access to the code, you can add a method Debugger.Break at the first line of the OnStart method.
Once you "break" into the application investigate where the exception is thrown.
You can attach the debugger to a running service. Details at Debug Windows Service Applications.
It's fortunate that you can replicate the problem easily. You can install the .NET Studio with code to debug your problem.
Another technique is to make the Service into a regular app. You know that the suspect code is during Startup. So simply create the app with code in the Startup function, and start debugging from there.
Good luck,
Tommy Kwee
I'm trying to set up CruiseControl.NET (1.6)
The installation completes successfully, however i cannot seem to start the actual service.
When running the CCNET.exe i get a console window that the last thing it writes is: Initialising Security.
Running the service from service control manager also does not work..
Trying to access localhost/ccnet returns no response.
What am i missing here? I have installed the product in the past with success, not sure what is wrong this time.
#lysergic-acid - Even if the main config is done (server/ccnet.config) and you are running it from a command prompt, you won't see the web dashboard yet.
If you are installing on IIS7, the setup process for the web dashboard requires steps that aren't in the CC.Net webdashboard setup docs in sourceforge.
What got me working was this CC.Net web dashboard installer page, which is from the Confluence site, rather than the source forge site: http://confluence.public.thoughtworks.org/display/CCNET/Installing+the+Web+Dashboard
In the comments area, there are specifics about IIS7 (I'm assuming that's part of the problem).
I am still having trouble with the service, so I can't help you there, but you can definitely run the web dashboard without the service as long as the cmd prompt version is running.
The setup of the virtual directory for the web front-end might of not completed successfully. Try using the IIS Service Manager to create an application around the Service folder. I think there's an issue with the install if you forget to unblock the download, but I haven't fiddled with it enough to be sure.
Keep in mind that the web front-end and ccnet service are two totally isolated pieces. You should be able to see the web front-end even if the ccnet service doesn't run.
I had trouble one time when installing it and IIS was set to disabled (and thus was not running), I had to uninstall CruiseControl.NET, start IIS and then reinstall CC.Net.
Do you have a firewall that blocks ports? The default port is 21234.
You need both the web part and the service part installed to be able to run CC.Net.