TFS Trust Relationship failed on Analysis Database Sync - tfs

We are receiving the error below for both the 'Full' and 'Incremental' Analysis Database Sync jobs in TFS 2015. I've searched for this error online and none of the answers worked in our situation. Does anyone have experience with this along with a possible solution?
[Full Analysis Database Sync]: --->
AnalysisDatabaseProcessingType=Full, needCubeSchemaUpdate=True. --->
Microsoft.TeamFoundation.Warehouse.WarehouseException: TF221122: An
error occurred running job Full Analysis Database Sync for team
project collection or Team Foundation server TEAM FOUNDATION. --->
Microsoft.TeamFoundation.Warehouse.WarehouseException: Failed to
Process Analysis Database 'Tfs_Analysis'. ---> System.SystemException:
The trust relationship between the primary domain and the trusted domain failed. at
System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection
sourceAccounts, Boolean& someFailed) at
System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection
sourceAccounts, Type targetType, Boolean forceSuccess) at
System.Security.Principal.NTAccount.Translate(Type targetType) at
Microsoft.TeamFoundation.Warehouse.OlapCreator.AddAccountToRole(Role
role, String accountName, Boolean throwOnError) at
Microsoft.TeamFoundation.Warehouse.OlapCreator.AddAccountsToRole(Database
database, String roleName, IEnumerable1 accountNames, Boolean
ignoreAccountResolutionFailures) at
Microsoft.TeamFoundation.Warehouse.OlapCreator.CreateOrUpdateRoles(Server
server, Database database, IEnumerable1 serviceAccountNames, Boolean
ignoreServiceAccountResolutionFailures, IEnumerable1
readerAccountNames, Boolean ignoreReaderAccountResolutionFailures) at
Microsoft.TeamFoundation.Warehouse.OlapCreator.UpdateOlapSchema(Server
server, IEnumerable1 readerAccountNames, WarehouseConfig
warehouseConfig) at
Microsoft.TeamFoundation.Warehouse.TFSOlapProcessComponent.UpdateOlapSchema()
at
Microsoft.TeamFoundation.Warehouse.TFSOlapProcessComponent.ProcessOlap(AnalysisDatabaseProcessingType
processingType, WarehouseChanges warehouseChanges, Boolean
lastProcessingFailed, Boolean cubeSchemaUpdateNeeded) --- End of inner
exception stack trace --- at
Microsoft.TeamFoundation.Warehouse.TFSOlapProcessComponent.ProcessOlap(AnalysisDatabaseProcessingType
processingType, WarehouseChanges warehouseChanges, Boolean
lastProcessingFailed, Boolean cubeSchemaUpdateNeeded) at
Microsoft.TeamFoundation.Warehouse.AnalysisDatabaseSyncJobExtension.RunInternal(IVssRequestContext
requestContext, TeamFoundationJobDefinition jobDefinition, DateTime
queueTime, String& resultMessage) at
Microsoft.TeamFoundation.Warehouse.WarehouseJobExtension.Run(IVssRequestContext
requestContext, TeamFoundationJobDefinition jobDefinition, DateTime
queueTime, String& resultMessage) --- End of inner exception stack
trace ---

This is a very common problem due to the error ID TF221122.
To narrow down the issue, suggest you could look in the OLAP log file, if there is useful information for what had happenеd there exactly. Usually the log is located under the OLAP folder of the MSAS installation (\Program Files\Microsoft SQL Server\MSASX.MSSQLSERVER\OLAP\Log), and it could be called msmdsrv.log .
If there isn’t proper information, also check the Event View on server if there are some more error message.
Back to the error info, The trust relationship between the primary domain and the trust domain failed. It seems there's the trust issue in your two domains, please double check it first.
Besides also try to delete the whole Tfs_Analysis Database/Tfs_Warehouse Database, and run the “Rebuild” operation from the Application Tier following the steps below:
Open Team Foundation Server Administration console.
Go to Reporting and there is “Start Rebuild”.
Note that this action could be used to rebuild your data warehouse and analysis database for the cube. Once you start it, it will take offline, delete, and rebuild both your Warehouse and Analysis Services databases. Based on the amount of data you have n your TFS DB, it could take significant amount of time to complete these jobs. The reports will not show any data until the above databases are not rebuilt successfully.
Take a look at below similar issue:
TFS2010 TF221122: An error occurred running job Full Analysis
Database Sync: the trust relationship between the primary domain and
the trusted domain failed
TF221122: An error occurred running job Full Analysis Database Sync for team project collection or Team Foundation server TEAM FOUNDATION

Our server support group found in the Event Viewer on the TFS server that the password was not valid for the user ID in three of the TFS services. I had changed the password for our TFS service account a while ago, but apparently did not update it in the services.
The "trust relationship" failure was resolved once I corrected the TFS service account password in the services below.
Team Foundation Ssh Service
Visual Studio Team Foundation Background Job Agent
Visual Studio Team Foundation Build Service Host 2015

Related

TFS246017: Team Foundation Server could not connect to the database

While attempting Branch operation from within VS I get the error message TFS246017: Team Foundation Server could not connect to the database. Verify that the instance is specified correctly, that the server that is hosting the database is operational, and that network problems are not blocking communication with the server. (The error message box looks like the one in this question).
I logged on to the TFS virtual machine. In event viewer I see a warnning with with the same message as above + Process Name: w3wp, User: domain\MyUser. The IIS TFS site is started.
I opened the TFS console on the TFS machine using both domain\MyUser and domain\tfssetup (this is the user running the Visual Studio Team Foundation Background Job agent service), the console opens successfully. Both users appear in the Administration Console Users list. I did reapply account for both users. I also did update password for domain\MyUser. It shows a connection string with Datasource and Initial Catalog. I logged in to the DB machine, opened SQLSERVER users: the tfssetup user is there with sysadmin and owner of relevant instances. I also added the domain\MyUser and added admin privileges (but the error persists).
I also installed SSMS on TFS machine & was able to connect to DB server using both domain\MyUser and domain\tfssetup and view tables.
This error did not happen in the past. This error didn't happen when branching a different location in the source control ($/Project1/Main vs $/Project2/Main) beforehand. The Source Control Explorer appears to show OK (so TFS is working). Using Visual Studio 2013. TFS 2017. AFAIK Virtual Machines were not moved, IP address were not changed. Using vSphere it seems there is enough disk space for both TFS and DB machines. The error appears after ~4 seconds.
What else can be tried?
Looking in the TFS SQLSERVER log there was a "SERVER ASSERTION" error and this was the cause for the TFS generic error.
In my case the error was very similiar to the one here. CHECKDB and updating to the latest service pack didn't help. What helped was changing the recovery mode to full as recommended in that thread.

BackupSets.xml locked by SYSTEM

I have an installation of TFS 2018 which is split over an app and database server. Both servers run Windows Server 2016. Frequently I get an error that the scheduled backup has failed because BackupSets.xml is locked.
Process Explorer shows that it is locked by SYSTEM. There is plenty of disk space on the backup disk (Currently 1.3TB and the full backup is 150GB).
The only way I have found to resolve this is to reboot both the app and database servers. This is not a viable long term solution to this.
Has anybody else encountered anything similar? Can you suggest a solution?
[23.03.2018 19:04:51] [Error]
Exception Message: The process cannot access the file
'\\DatabaseServer\TFSBackups\BackupSets.xml' because it is being used by
another process. (type IOException)
Exception Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode,
String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Microsoft.TeamFoundation.Admin.BackupSets.Save(String folder)
at Microsoft.TeamFoundation.Admin.Jobs.DatabaseBackupJob.TakeTransactionalBackups (IVssRequestContext requestContext, BackupSettings settings, ITFLogger logger)
at Microsoft.TeamFoundation.Admin.Jobs.DatabaseBackupJob.RunBackupJob(IVssRequestContext requestContext, BackupJobType requestedJobType, String& resultMessage)
[23.03.2018 19:04:51] [Info] Backup Job Finished. Completed: Transactional. Result = Failed
First, suggest you to check the Event View on both server to see if there are more log info for troubleshooting. Also check the process especially for TFS related if some thing hangs on.
In this case you could try below solution:
Delete the Backupsets.xml file altogether
Reconfigured Backups using the wizard - Now that it didn't find the
xml file at all it created a new one.
Ran a full backup - which should be successfully.
Double check if the scheduled backups will now also work from now on.

Project administrator cannot run workitem query

TFS team project administrator not able to run work item query, when tried through the web browser, page shows the error:
TF401349: An unexpected error has occurred, please verify your request and try again
When tried using Visual Studio 2015, the below error:
TF201072: A user or group could not be found. Verify that the users and groups used in your work item type definition have been added to Team Foundation Server.
Event log in the application server shows the below event error:
System.Data.SqlClient.SqlException (0x80131904): error="600047";%:RebuildCallersViews: Connecting Domain User could not be alidated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
I am using TFS 2015 update 2.
Note: Same project other users can view normal.
Seems there is something wrong with that user account, although this user is already part of a TFS group, but he still can't access TFS work items. Maybe there is some snag in the TFS identity synch service, and it's usually related to a specific collection.
Attaching and re-attaching the collection will force a refresh of the identity synch data, and will usually resolve this kind issue.
If above is sitll not work.There are also many other articles on the web which help determine the root cause:
You can check whether built-in records were missing in table
TFSIntegration..tblsubscription. Refer to the link below for more
details: A case study on TFS identity replication
Another option is check if the SID of service account is correct.
Replace SID if not, you can refer to this thread for the steps.
Also take a look at the solution of this similar
error:Unable to shelve changes in VS2012 for TFS2010

Upgrading TFS2012.2 to TFS2012.3

I'm trying to upgrade from TFS2012.2 to TFS2012.3.
I downloaded the ISO, ran the tfs_server.exe, and after a few reboots, I'm prompted with the Upgrade Wizard.
On step two(2) "Specify a Team Foundation Server configuration database to upgrade", I need to specify a SQL Server Instance. But when I click "List Available Databases", no database shows up in the list.
I tried different combinations of SQL Server Instance (servername, servername.domain, ., (local)) but all of them returns an empty list. Note SQL is not running named instance.
SQL is up and running and I can see the TFS databases (Tfs_Configuration, Tfs_DefaultCollection, Tfs_Warehouse).
Everything is running on this one machine.
Digging deeper, in the Event Logs (Team Foundation Server Build Service Events), I found this:
Exception Message: TF400686: The requested schema property TFS_SCHEMA_VERSION did not match the expected value. The server requires the Microsoft Team Foundation Server 2012 M49 schema but the database currently implements Microsoft Team Foundation Server 2012 M44 (QU2). (type DatabaseSchemaException)
I'm not sure if this is a clue or not.
Last point: If I go to the TFS Admin Console, when I click on Application Tier, the screen shows a "This features has been installed but needs to be configured. Click on Configure Installed Features to begin initial configuration."
Did I miss a step?

I need help creating a new TFS project. I'm getting a Reporting Services error

I recently inherited control of our TFS server. I am trying to create a new TFS project and get an error. Any help or clues to how to solve this would be greatly appreciated.
Here is the exception message that is logged.
---begin Exception entry---
Time: 2010-06-22 11:09:47Z
Module: Initializer
Event Description: TF30207: Initialization for plugin "Microsoft.ProjectCreationWizard.Reporting" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: TF30224: Failed to retrieve projects from the report server. Please check that the SQL Server Reporting Services Web and Windows services are running and you have sufficient privileges for creating a project.
Exception Details: The Project Creation Wizard encountered a problem while creating reports on the SQL Server Reporting Services on DELTADEV.
The reason for the failure cannot be determined at this time.
Because the operation failed, the wizard was not able to finish creating the SQL Server Reporting Services site.
Stack Trace:
at Microsoft.VisualStudio.TeamFoundation.RosettaReportUploader.CheckForProjectFolder(PrivateData data, String projectName, ProjectCreationContext context)
at Microsoft.VisualStudio.TeamFoundation.RosettaReportUploader.Initialize(ProjectCreationContext context)
at Microsoft.VisualStudio.TeamFoundation.EngineStarter.InitializePlugins(MsfTemplate template, PcwPluginCollection pluginCollection)
-- Inner Exception --
Exception Type: System.Web.Services.Protocols.SoapException
Exception Message: Server did not recognize the value of HTTP Header SOAPAction: http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren.
SoapException Details: <detail />
Stack Trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.TeamFoundation.Proxy.Reporting.ReportingService.ListChildren(String Item, Boolean Recursive)
at Microsoft.VisualStudio.TeamFoundation.RosettaReportUploader.CheckForProjectFolder(PrivateData data, String projectName, ProjectCreationContext context)
-- end Inner Exception --
--- end Exception entry ---
I think this is the most relevant part of your exception stack:
Failed to retrieve projects from the
report server. Please check that the
SQL Server Reporting Services Web and
Windows services are running and you
have sufficient privileges for
creating a project.
Make sure you are a content manager on reporting services by going to http://deltadev/reports
and looking at the security page. Making yourself a TFS Admin does not automatically give you permissions in Reporting Services. This has to be done separately. Same for SharePoint by the way.
Make sure you have Visual Studio 2008 SP1 installed. Without SP1, you may get this error during project creation.

Resources