TFS Waiting for Service to Start - visual-studio

I'm using TFS Express and trying to set up the environment. I create the project and then it hangs saying its 'Waiting for Service to Start"
What service is it waiting for to start?

Check TFS Background Job Agent service is running or not.
Check Event log in Event Viewer to see whether there is useful information.

Related

What are the reason when a stopped windows service starts automatically?

What are the reason when a stopped windows service starts automatically?
I know only few which are
When service start-up mode is automatic and someone re-start the server then service will also get started.
When someone forcefully start the service manually.
Is there any other way when a stopped service can start?
Service triggers. This can be hardware device added, internet connection discovered, group policy change or any ETW event.
Have you checked there is a service Dependence? If another service depends on its function, it will automatically come up even though you stop the service.
Since it keeps restarting, it means you are not suppose to disable or stop the service.
Locate the ASP.NET State Service and check the Startup Type property and click the recovery tab for your service configuration and check if the options there could be restarting it.
You can also run a virus scan on your system to be sure your pc is safe.

how to troubleshoot failing Automatic start by Windows Services

The Windows Services UI is able to successfully start a service (Apache) manually.
However, when the service Startup Type is configured as Automatic or "Automatic (Delayed Start)", the service fails to automatically start after restarting Windows (via "shutdown /r").
When automatic start fails, the Event Viewer contains a generic "Incorrect function" message, which we saw previously with a different Services automatic start issue for another service (Wildfly).
For this issue, Apache Loglevel debug does not seem to provide any useful logging.
Since the Windows Services UI is able to successfully start the service manually, are there any logs/tips/tricks/hints for troubleshooting automatic Services start ?

Teamcity agent in disconnected state (Agent has unregistered (will upgrade))

Teamcity build agent in disconnected state (Agent has unregistered (will upgrade)) on the server UI.
The build agent service was in hung state tried reboot but still didn't work so manually upgraded the TC build agent with the version server had. Rebooted the build agent service. Still disconnected. Please suggest.
I ran into this issue and found a solution, but I'm going to make a few assumptions about your setup.
This fixed an issue I had with a TeamCity build agent on Windows and running as a user account (as opposed to a System Account).
Stopped the TeamCity service and changed the account to a System Account
Started the TeamCity service and waited about 10 minutes for the upgrade to complete. The build agent showed up in the "Connected" agents tab indicating a successful upgrade.
Stopped the TeamCity service and switched back to the user account
Started the TeamCity service
The other option is to grant the user account permissions to start/stop services, but I went this route instead. See this article for those steps.
Old question but someone might find my comments useful. If you cant read the upgrade logs, check the buildAgent/update/ folder, If files and files sizes are changing in this particular folder then It means that the Agent is updating and you only need to wait. If this is not the case but you still see Agent has unregistered (will upgrade) in Team city under Agents --> Disconnected then the agent is either hung or there is some problem with it. Stop the agent from the services and then by running the agent.bat(Windows) and agent.sh (nix) by giving stop argument and then start it from the same script using start argument. You can also see the status of the agent using status argument. If this also does not work then you will have to read all the logs.
This worked for me:
In the Agents tab, I removed the build agent by clicking "Remove Agent".
I restarted the service.
I refreshed the Agents tab and it the build agent appeared in the Unauthorized Agents.
I authorized the agent and it's now connected.
For the one who kept restarting build agent service and see the "Agent has unregistered(will upgrade)", please check the log under BuildAgent/logs to see the upgrade process and wait.
I just encountered this problem too on Ubuntu Linux 19.10 and it is related to systemd. My TeamCity agents are started and stopped using a systemd script and apparently this is what prevents them from upgrading. When I stopped teamcity systemd services and started agents manually with agent.sh start agents successfully updated and worked just fine since that.
It could be the permissions on the account under which the agent is running. In BuildAgent\Logs\Upgrade.txt, you may find this
Upgrade failed: Failed to stop TeamCity build agent service. Please check TeamCity build agent service user have enough permissions to stop and start the service.
java.io.IOException: Failed to stop TeamCity build agent service. Please check TeamCity build agent service user have enough permissions to stop and start the service.
Although the service appears to be running fine on the machine (windows in my case), it produces the error in it's log rather than event viewer or failing to start, and disconnects from TeamCity on upgrade.
I gave higher privileges and it started to work. +1 to Lemtronix's way if you do not want to restrict permissions of your service account.
I had the same issue. I triggered a build and the agent was automatically changed to connected status.
Looks like the agent tries to upgrade itself, but if your Windows service is set up running from non-admin account, it fails.
Options are:
Temporary change service account to System as proposed by #Lemtronix
Add user to administrators group and restart service.
I resolved this issue with TeamCity 2019.2.4 on Windows Server 2016 by completing the following steps listed below:
Stop the TeamCity Build Agent service.
Stop the TeamCity Server service.
Start the TeamCity Server service.
Start the TeamCity Build Agent service.
Refresh the TeamCity UI tab in your browser window, and wait a few moments for the status to reflect Connected in green.
Changing the service user did not fix the issue for me :
but this method worked (Windows, with Teamcity server and agents on the same machine).
Stop these services : Teamcity server, all the Teamcity agents.
Open a cmd.exe instance as Administrator.
Run these (adapt to you own paths / number of agents). It will start Teamcity server and agents as simple processes (i.e. not as services) :
cd C:\Teamcity\bin
.\runAll.bat start
cd C:\Teamcity\BuildAgent1\bin
.\agent.bat start
cd C:\Teamcity\BuildAgent2\bin
.\agent.bat start
cd C:\Teamcity\BuildAgent3\bin
.\agent.bat start
Check in the UI that the agents have registered again.
Kill the processes created in 3. ; and start the Teamcity services again.

IIS w3svc error

I am trying to start my website in IIS, whenever I try to start my website I get the following error
Cannot start service w3svc on computer
I tried to start "World wide web publishing service", but I was unable to start it as it said:
Error 1068: The dependency service or group failed to start
Meanwhile when I checked my log I found this error,
The World Wide Web Publishing Service service depends on the HTTP service which failed to start because of the following error:
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
Please help me, I am badly caught with this error, I have spent a week researching this error but haven't found a solution yet.
Confirm that "Windows Management Instrumentation" is started and its start up type is set to automatic.
Also make sure the following dependency services are started for World Wide Web Publishing Service:
Windows Process Activation Service
Remote Procedure Call (RPC)
DCOM Server Process Launcher
RPC Endpoint Mapper.
Open regedit, navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP]:
a) Double click on Start and change value data from 4(disabled) to 3(automatically).
b) Delete "NoRun" key if this key exists.
(warning: backup any IIS website configuration first). UN-install "Internet information Service" and "Windows process activation service(if it is already installed)" from "Turn windows feature on or off" and Restart your PC.
Type the below command in CMD and press enter:
net start http
Now it will notify you that service is already running.
Re-install Internet information Service from "Turn windows feature on or off".
Start IIS and my websites are started now, no more "w3svc service is not running error."
As for me - I just restarted the computer.
Make sure these 2 services running and their startup type is automatic.If they disabled and not running right click on them and go to properties and change from there.
Windows process activation service
Worldwide web publishing service.
Run cmd as administrator. Type iisreset. That's it.
Go to Task Manager --> Processes and manually stop the W3SVC process. After doing this the process should start normally when restarting IIS
In my case it was C:\Windows\System32\inetsrv\config\applicationHost.config which had an issue.
I had a "system.web" section in this file which was causing the problem. Removed the section and everything started working
I have got same issue on my server. Follow below steps -
Open command prompt (run as administrator)
type IISReset and enter.
It works and solved my problem.
I have had this problem after a windows update. Windows Process Activation Service is dependent service for W3SVC. First, make sure that Windows Process Activation Service is running. In my case, it was not running and when I tried to run it manually, I got below error.
Windows Process Activation Service Error 2: The system cannot find the file specified
The issue seems to be, that windows adds an incorrect parameter to the WAS service startup parameters. I fixed the issue using the following steps:
Start regedit (just type it into start) Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters
Delete the NanoSetup variable. This variable is preventing WAS from starting
Start the WAS service using task manager
Now start the W3SVC service
You can now start your website in IIS again
I found above WPA service solution in this stack overflow thread.
In my case, IIS suddenly stopped working, and after that Windows process activation service was unable to restart.
The solution to fix this was:
Find WAS service in the services tab of windows task manager
In context menu choose Go to process
Kill process (its name will be svchost.exe)
Restart Windows process activation service
My Net.Tcp Port Sharing Service was disabled. I changed its startup to manual, started the service, and then IISRESET worked.
I also verified that the following dependent services were started in Services ([windows]+[r] services.msc):
World Wide Web Publishing Service
Windows Process Activation Service
Remote Procedure Call (RPC)
DCOM Server Process Launcher
RPC Endpoint Mapper
Net.Msmq Listener Adapter
Net.Pipe Listener Adapter
Net.Tcp Listener Adapter
Net.Tcp Port Sharing Service
I found this solution by going through all dependencies and child dependencies of the World Wide Web Publishing Service and making sure that each service was enabled and started.
To verify all services for yourself, do the following:
Open up Services (just search for it from the start menu in Windows 10)
Find the World Wide Web Publishing Service
Right click on the service and then click "Properties"
Click on the Dependencies tab
Go through each system component in the two boxes and verify that each service is started (in Services).
Repeat steps 3-5 for each of the dependencies' dependencies until you run out of child dependencies
Service Properties - Dependencies Tab
This is probably a rarer case, but...
If you are using a custom AppPool Identity configuration be sure to check the AppPool is running. It may be turned off because credentials are invalid (usually due to an expired password). Update your credentials and start the AppPool.
I am able to resolve this by simply executing the below command in PowerShell to kill/stop service and restart the IIS server
taskkill /F /FI "SERVICES eq w3svc"
I managed to solve after:
Ctrl+Shift+Esc = To open Task Manager
In the "Processes" tab locate the "IIS Worker Process" and
finish it!
Run on cmd as an administrator. Type iisreset.
I was getting this error. It turns out World Wide Web Publishing Service was disabled.
Click Start, type Services in the Search box, and then click Services.
Scroll until you find the World Wide Web Publishing Service that is stopped or disabled.
right-click the service, and then click Properties.
Click the Startup type list, and then click Automatic.
Click Apply, and then click OK.

How to start windows service

I have created a windows service with Automatic Start Type and install it in my system successfully but it does not start until i restart my system.
Details: yesterday i have create and install my service and then restart my windows so the service started successfully. but the problem occurred today when i boot my windows and opened the services list of windows from Control Panel\Administrative Tools\Services and selected my service i saw that it did not start automatically.
what is my mistake?
Assuming the service is set to 'Automatic' as the startup mode, and that it's state is not 'Started', then there will be at least one message about why the service did not start in the System Event Log.
Typical reasons are that the service didn't start quickly enough (Service Controller imposes a time limit on how quickly services must respond to the 'Start' message) or that the service depended on another service which wasn't yet available (check your service dependencies) or that your service simply failed due to a software error (e.g. some resource it needs could not be found).
Find the error in the event log, and you'll have a much better idea of why your service hasn't started.
As your service was running fine yesterday but not today. Checking all its dependencies would be my first suggestion.
In your Start-> Run, type services.msc . It's a shortcut to open the services console.
Then Right click on your service , if it is listed there, click on Properties on this popup menu.
Open the Dependency tab (4th tab) , check if your service depends on some other service and that dependency is running.
Regards,
bhupendra
Example:
SC.exe config "ServiceName" start= auto

Resources