Team Foundation Server suddenly failing to connect (Error: TF400324)

Team Foundation Server suddenly failing to connect (Error: TF400324)

使用 Team Foundation Server (TFS) 多年后,我们突然失去了通过 Visual Studio (VS) 或 URL 进行连接的能力。据我所知,没有对支持 TFS 的虚拟服务器进行任何更改。

在 VS 中错误是:

TF400324: TF services are not available from server... Unable to connect to the remote server...

如果我在浏览器中使用 {server}:8080/tfs 或 localhost:8080/tfs url,它会告诉我连接被拒绝。

在 SQL Management Studio 中,Tfs_Configuration 和 Tfs_DefaultCollection 数据库似乎都已连接,并显示 "Ready" 状态。在 TFS 管理控制台中,DefaultCollection 状态为 "Online".

也许最好的线索是,如果我使用 netstat 查看服务器上正在使用哪些端口,则根本没有列出端口 8080。是否有监听服务需要启动?

我看到以下服务当前被禁用:UPnP 设备主机、SSDP 发现、Internet 连接共享、SSDP 发现、Internet 连接共享、智能卡、路由和远程访问、Net.Tcp 端口共享服务、和计算机浏览器。

当然,我们试过重启也无济于事。

我们将不胜感激任何故障排除建议,因为这已经开始影响我们的工作效率。提前致谢!

版本:TFS 2015
版本:14.114.28805.0(更新 4.2)

更新: 我应该提一下,在尝试诊断问题时防火墙已被禁用。

此外,在 Even Viewer 中存在与 TFS 相关的错误,但它们一点也不清楚。这是一个片段:

VssRequestContext.HostManagement.Microsoft.TeamFoundation.JobService.Extensions.Core.IdentitySyncJobExtension.Run:1 Registry.TeamFoundationRegistryService.Write:1 Default.SqlResourceComponent.Execute prc_UpdateRegistry ds:LT-TFS2 db:Tfs_Configuration:2 Default.SqlResourceComponent.Execute:-3 Registry.TeamFoundationRegistryService.Write:-3 GroupComponent.SqlResourceComponent.GetGroupsToSync:3 GroupComponent.SqlResourceComponent.Execute prc_GetGroupsToSync ds:LT-TFS2 db:Tfs_Configuration:3 GroupComponent.SqlResourceComponent.Execute:-4 GroupComponent.SqlResourceComponent.GetGroupsToSync:-4 GroupComponent.SqlResourceComponent.ReadGroups:4 GroupComponent.SqlResourceComponent.Execute prc_ReadGroups ds:LT-TFS2 db:Tfs_Configuration:4 GroupComponent.SqlResourceComponent.Execute:-5

此错误通常与 TFS 缓存有关。您可以按照以下步骤尝试一下:

  1. Close all instances of Visual Studio
  2. Open the Task Manager and check if any TFS Services are running.
    Select each of them and click on End Process Tree
  3. Browse to the folder %LocalAppData%\Microsoft\Team Foundation\
    and then select the folder with your TFS version and go inside the Cache folder.
    for example, the path was %LocalAppData%\Microsoft\Team Foundation\x.0\Cache and it should be the same on your machine with the difference of the TFS version folder name.
  4. Delete everything in that Cache folder.
  5. Start Visual Studio and run it with Admin mode.

此外,如果您的 TFS 配置了自签名 TLS/SSL 证书。 如果是这种情况,您需要将该证书安装到您拥有 VS 的客户端计算机上的受信任的根证书颁发机构存储中。

对于这种情况,您可以参考this答案。

此外,请同时检查您的TFS服务器中的事件查看器是否有任何错误。这可能有助于缩小问题范围。

已解决! 我发现 TFS 站点在 IIS 管理器中被禁用。当我尝试启用它时,它报告万维网发布服务被禁用。启用两者都解决了问题。