TFS246017:Team Foundation Server 无法连接到数据库

TFS246017: Team Foundation Server could not connect to the database

在 VS 中尝试分支操作时,我收到错误消息 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.(错误消息框看起来像 中的那个)。

我登录了TFS虚拟机。在事件查看器中,我看到一条警告,其中包含与上面相同的消息 + Process Name: w3wp, User: domain\MyUser。 IIS TFS 站点已启动。

我在TFS机器上同时使用domain\MyUserdomain\tfssetup打开了TFS控制台(这是用户运行 Visual Studio Team Foundation Background Job agent服务),控制台打开成功.两个用户都出现在 Administration Console Users 列表中。我为两个用户做了 reapply account。我也为 domain\MyUser 做了 update password。它显示了带有数据源和初始目录的连接字符串。我登录到数据库机器,打开 SQLSERVER 用户: tfssetup 用户与系统管理员和相关实例的所有者一起在那里。我还添加了 domain\MyUser 并添加了管理员权限(但错误仍然存​​在)。

我还在 TFS 机器上安装了 SSMS,并且能够使用 domain\MyUserdomain\tfssetup 连接到数据库服务器并查看表。

这个错误过去没有发生过。预先在源代码管理中分支不同位置($/Project1/Main$/Project2/Main)时不会发生此错误。源代码管理资源管理器似乎显示正常(因此 TFS 正在运行)。使用 Visual Studio 2013。TFS 2017。 AFAIK 虚拟机未移动,IP 地址未更改。使用 vSphere 似乎有足够的磁盘 space 用于 TFS 和数据库机器。约 4 秒后出现错误。

还有什么可以尝试的?

在 TFS SQLSERVER 日志中查找“服务器声明”错误,这是 TFS 一般错误的原因。

在我的案例中,错误与 the one here 非常相似。 CHECKDB 并更新到最新的服务包没有帮助。有用的是按照该线程中的建议将恢复模式更改为完整模式。