Question

TF255115: The following service did not start: TfsJobAgent. and in the Details box I have this message Time out has expired and the operation has not been completed.

I tried by executing the command net start tfsjobagent but it returned as The service name is unavailable.

So can anyone help me to solve this issues.

Was it helpful?

Solution 2

Please navigate to the below link to find the solution of this problem http://social.msdn.microsoft.com/Forums/en-US/tfssetup/thread/9fb2762c-7633-4cb0-9640-a4ded2deddcf

OTHER TIPS

If you are configuring TFS, go to the Logs folder in TfsMgmt.exe (The Administration Console) and check the log files to see if there is any error related to TfsJobAgent (usually in the form of an exception, and you should be able to find the stack trace there). From what you described, looks like TfsJobAgent failed to be installed as a service. TFS is pretty good at logging configuration errors, so please go to the log files first.

You can also open Event Viewer and check to see if there is any error at the time the configuration happened.

TL;DR: - Skip to Solution

Upgrading to TFS2010 to 2015 and then upto 2017 I get this error.

TF255115: The following service did not start: TfsJobAgent.

According to Sivakumar Shan's answer in MSDN (that's since been locked):

"While Configuring I configured as the TFS service needs to be run under "User Account" instead of "System Account". Then I provided my User account name and password. Finally everything went fine. I am done with my configuration"

Please find the screen shot of the Configuration of "Build Service" Same thing I have done for the TFS Configuration Wizard."

enter image description here

For me using the Network Service instead of an explicit Service Account worked (upgrading from 2010 to 2015). Even though the Service Account was given rights to "Log on as a service" it failed.

To troubleshoot it I manually tried to install TeamFoundationSshService.exe manually:

Start > Run > cmd > cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

InstallUtil "C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\bin\TeamFoundationSshService.exe"

Note: the Microsoft Team Foundation Server 14.0 is because I'm using TFS2015.

Unfortunately it didn't install successfully and got rolled back. The first reason why it failed was an UnauthorisedAccessException to path "C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\bin\TeamFoundationSshService.InstallState"

So I gave the Folder permissions for Modify as well as Read & Execute, Read, Write so that new files could be created.

Then I tried again and got another error, FileNotFoundException.

I decided to take Tarik.Net's advice from the MSDN thread:

This is a tricky one! You have to open (refresh) the services window during the installation not after it fails. You must do it before the TFS installation throws an error because the install gets rolled back (the service is removed) hence, you won't find it.

I ran through the install again (2010 to 2015) and when it came past Configuring Database I kept refreshing the Services.msc window until the TeamFoundationSshService Service was shown. When it appeared it wasn't started so I quickly started it during the install and that allow it to complete successfully.


When upgrading from 2015 to 2017 I hit the error again. This time I had to use the explicit Service Account.

What happens is the Server Configuration Wizard gets up to Configure Services step > installs the TeamFoundationSshService.exe and that fails to start and gets uninstalled as part of a Rollback:

enter image description here

I was too slow to try and start the Service manually during this 2017 install.

And encountered the error again:

enter image description here

When this error happens you have to Restore the Tfs_Configuration database (in my case back to 2015 version) and run through the wizard again.

Before trying again I tried to install the TeamFoundationSshService.exe Service in my TFS2017 install manually.

Start > Run > cmd > cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

InstallUtil "C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services\bin\TeamFoundationSshService.exe"

Note: the Microsoft Team Foundation Server 15.0 as this is the TFS2017 upgrade.

The result:

System.UnauthorizedAccessException: Access to the path 'C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services\bin\TeamFoundationSshService.InstallState' is denied.

Again I give users access to Modify as well as Read & Execute, Read, Write.

I tried to install the Service again and got the Security Exception:

System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

I checked the TeamFoundationSshService.InstallLog and it didn't have any reasons but it pointed to the Event Log. So I checked eventvwr and it shows:

Domain and account: domain\SRV-WTAM-TFS This service account does not have the required user right "Log on as a service."

However it does!!!

enter image description here

Dazed and confused as to why it the service always gets rolled back I decided to open a command Prompt in Admin mode, then I ran the InstallUtil command it Committed Successfully.

Now I've restored the Tfs_Configuration database to TFS2015 I run through the upgrade Wizard again.

However, when I have the TeamFoundationSshService service installed but not started and click Verify in the TFS Wizard I get this error message:

TF255427: The following Windows service is installed on your computer: TeamFoundationSshService. You must uninstall the service using the SC command line program. From a command prompt, type sc delete TeamFoundationSshService

So I uninstall it:

InstallUtil /u "C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services\bin\TeamFoundationSshService.exe"

Re-run the readiness checks and it passes. I click Configure again,

I quickly reinstall the TeamFoundationSshService via the Admin Command Prompt

However I cannot start it under Network Service:

The Team Foundation Ssh Service service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

Then it fails again this time with this error message:

TF255425: An error occurred while installing the following Windows service: TeamFoundationSshService.exe. For more information, open Event Viewer and review the application log.

Googling the TF255425 error I found https://social.msdn.microsoft.com/Forums/vstudio/en-US/516127c9-ed88-4001-a29d-f146408702a2/getting-the-following-error-tf255425?forum=tfsadmin which says:

You must be a member of the Administrators security group on the server on which you will install TFS

I added the service account to the Admins, still no luck.

I'm back to installing the service manually, this time using the SC Create command the TFS installer would use:

sc create "TeamFoundationSshService" obj= "domain\SRV-WTAM-TFS" password= "password" binpath= "C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services\bin\TeamFoundationSshService.exe" start= auto type= share

The above command creates the Windows Service but won’t start it. Manually trying to start it fails with:

Windows could not start the TeamFoundationSshService service on Local Computer. Error 1069: The service did not start due to a logon failure.

Solution

After more troubleshooting I discover the Service Account is in the Local Policies > User rights Assignment > "Log on as a Service Account" group but the Service Account is also in a group listed under "Deny log on as a service"

After removing Service Account from the "Deny logging on as a service" group I restore the Tfs_Configuration database again and kick off an upgrade again and this time it works successfully.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top