TFS2015 新安装,503 服务不可用
我已经根据单服务器"手册安装了 TFS 2015(https://msdn.microsoft.com/en-us/Library/vs/alm/TFS/setup/single-server?f=255&MSPPError=-2147217396).
I've installed TFS 2015 all according the 'Single Server' manual (https://msdn.microsoft.com/en-us/Library/vs/alm/TFS/setup/single-server?f=255&MSPPError=-2147217396).
我配置了一个简单的构建,构建了一个添加了单元测试项目的小型控制台应用程序,以及一个小的单元测试.
I configured one simple build, building a small console-app with a unit test project added, with one little unit test.
构建配置现在分为三个步骤.
The build configuration has now three steps.
- NuGet 安装程序
- Visual Studio 构建
- Visual Studio 测试
现在,每次调用第三步时,都会出现错误,浏览器中出现一个带有文本的红色框:
Now, every time the third step is called, an error occurs, a red box in the browser with the text:
503: 503: error
TFS.WebApi.Exception: 503: error at k (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/corejs?v=IiKWXrylMIeJdHBpXJwuE0SpVjVnmci79kLQuyG8-s41:64:375)
at http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/corejs?v=IiKWXrylMIeJdHBpXJwuE0SpVjVnmci79kLQuyG8-s41:64:2955
at d (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/corejs?v=IiKWXrylMIeJdHBpXJwuE0SpVjVnmci79kLQuyG8-s41:64:635)
at http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/corejs?v=IiKWXrylMIeJdHBpXJwuE0SpVjVnmci79kLQuyG8-s41:64:2888
at l (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:8122)
at http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:8348
at t.when (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:3780)
at t.u.promiseDispatch (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:2824)
at http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:1649
at MessagePort.t (http://teamfs2015:8080/tfs/_static/tfs/Dev14.M95.3/_scripts/TFS/min/q.js:27:5773)
Session Id: c0c3ef7f-e1db-4bf8-976a-f820a0701334
是的,烦人的 503:服务不可用错误....
Yes, the annoying 503: Service unavailable error....
有没有办法摆脱这个错误?我正在为构建服务器使用域帐户,它们未配置为过期,帐户位于管理员组中.等等等等
Is there any way to get rid of this error? I'm using domain accounts for the build servers, they are not configured to expire, the accounts are in the administrators group. Etc. etc.
我想我尝试了所有有关互联网上有关此问题的信息,但似乎没有任何效果.
I think I tried everything there is to know about this problem on the internet, but nothing seems to work.
我们在安装 TFS2012 时遇到了同样的问题.
We have the same problem on out TFS2012 installation.
查看事件查看器(应用程序),每次出现问题前都会出现以下信息:
Looking at the event viewer (application), everytime there is the following information just before the problem occurs:
信息:TFS 服务
Information: TFS Services
申请请求处理开始
服务器版本 = Microsoft.TeamFoundation.Framework.Server,版本=14.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a服务帐户 = NT AUTHORITY\网络服务机器名称 = TEAMFS2015
Server Version = Microsoft.TeamFoundation.Framework.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Service Account = NT AUTHORITY\NETWORK SERVICE Machine Name = TEAMFS2015
应用域:/LM/W3SVC/2/ROOT/tfs-1-131066466082045873
Application Domain: /LM/W3SVC/2/ROOT/tfs-1-131066466082045873
信息:TFS 服务
由于以下原因,应用程序正在关闭:HostingEnvironment应用域:/LM/W3SVC/2/ROOT/tfs-1-131066466082045873
The application is being shutdown for the following reason: HostingEnvironment Application Domain: /LM/W3SVC/2/ROOT/tfs-1-131066466082045873
信息:TraceLog Profiler
Information: TraceLog Profiler
TraceLog Profiler 组件关闭,处理 w3wp.exe
TraceLog Profiler component shutdown, process w3wp.exe
信息:TraceLog Profiler
Information: TraceLog Profiler
TraceLog Profiler 组件关闭,处理 te.processhost.managed.exe
TraceLog Profiler component shutdown, process te.processhost.managed.exe
错误:Perflib
DLLC:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_perf.dll"中服务ASP.NET_64_2.0.50727"的打开过程失败.此服务的性能数据将不可用.数据部分的前四个字节 (DWORD) 包含错误代码.
The Open Procedure for service "ASP.NET_64_2.0.50727" in DLL "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_perf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.
错误:Perflib
DLL "C:\Windows\System32\Secur32.dll" 中服务 "Lsa" 的打开过程失败.此服务的性能数据将不可用.数据部分的前四个字节 (DWORD) 包含错误代码.
The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.
错误:PerfNET
无法打开服务器服务性能对象.数据部分的前四个字节 (DWORD) 包含状态代码.
Unable to open the Server service performance object. The first four bytes (DWORD) of the Data section contains the status code.
更新
Microsoft Team Foundation Server 应用程序池"每次都停止".所以问题可能与应用程序池有关.或者应用程序池会因为另一个错误而停止......
The 'Microsoft Team Foundation Server Application Pool' is 'stopped' every time. So the problem can be related to the app pool. Or the app pool will stop because of another error....
更新阅读 jessehouwing 的评论,有来自事件查看器的结果:应用程序和服务日志">Microsoft-Team Foundation Server">调试":
Update Reading the comment of jessehouwing, there the results from the event viewer: 'Applications and Services Logs' > 'Microsoft-Team Foundation Server' > 'Debug':
- 错误总时间:19235.2866(延迟0ms)(持续时间19235.2866ms)(阈值10ms)(快速18)(截断0)VssRequestContext.HostManagement.TaskAgentPoolHub.Connect:19223 VssRequestContext.HostManagement.TaskAgentPoolHub.Connect:-19235 HostManagement.AspNetRequestContext.EndRequest:19235
- 错误总时间:19372.701(延迟0ms)(持续时间19372.701ms)(阈值10ms)(快速19)(截断0)HostManagement.AspNetRequestContext.EndRequest:19372
- 错误总时间:19235.1277(延迟0ms)(持续时间19235.1277ms)(阈值10ms)(快速19)(截断0)HostManagement.AspNetRequestContext.EndRequest:19235
- 错误总时间:19278.2777(延迟0ms)(持续时间19278.2777ms)(阈值10ms)(快速19)(截断0)HostManagement.AspNetRequestContext.EndRequest:192785、6 和 7. 信息TFS 活动日志条目
- 错误Microsoft.TeamFoundation.Framework.Server.RequestCanceledException: TF400733: 请求已被取消:客户端已断开连接..在 Microsoft.TeamFoundation.Framework.Server.VssRequestContext.CheckCanceled(Boolean throwIfShutdown)在 Microsoft.TeamFoundation.Framework.Server.VssRequestContext.get_ServiceProvider()在 Microsoft.TeamFoundation.Framework.Server.VssRequestContextExtensions.GetService[TService](IVssRequestContext 上下文)在 Microsoft.TeamFoundation.Framework.Server.ActivityLoggingAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)在 System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancelationToken)--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()
- 错误Microsoft.TeamFoundation.Framework.Server.RequestCanceledException: TF400733: 请求已被取消:客户端已断开连接..在 Microsoft.TeamFoundation.Framework.Server.VssRequestContext.CheckCanceled(Boolean throwIfShutdown)在 Microsoft.TeamFoundation.Framework.Server.VssRequestContext.get_ServiceProvider()在 Microsoft.TeamFoundation.Framework.Server.VssRequestContextExtensions.GetService[TService](IVssRequestContext 上下文)在 Microsoft.TeamFoundation.Framework.Server.ActivityLoggingAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)在 System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancelationToken)--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()
查看日志记录的详细信息",我没有看到任何类似问题的原因.在错误之前,有几个日志条目,例如:TaskHubTimelineRecordLog.AppendLogContent、TaskHubTimelineRecordLog.CreateLog、TaskHubTimelineRecordFeeds.PostLines、TaskHubTimelineRecords.UpdateRecords.然后在UpdateRecords"之后,立即出现来自 SignalR 的错误(这是后端和我开始构建的前端页面之间的通信.
Looking at the 'Details' of the logging, I'm not seeing anything resambling a cause of a problem. Before the errors, there are several log entries like: TaskHubTimelineRecordLog.AppendLogContent, TaskHubTimelineRecordLog.CreateLog, TaskHubTimelineRecordFeeds.PostLines, TaskHubTimelineRecords.UpdateRecords. Then after the 'UpdateRecords', immediately an error from SignalR (which is communication between backend and the frontend page where i start the build.
Pffff,终于找到问题了.... 对于具体的解决方案,我们使用了一个 UnitTest.runsettings 文件(参见 https://msdn.microsoft.com/en-us/library/jj635153.aspx) 我们可以配置应从代码覆盖率报告中排除哪些程序集.
Pffff, finally found the problem.... For the particular solution, we use a UnitTest.runsettings file (see https://msdn.microsoft.com/en-us/library/jj635153.aspx) to we can configure which assemblies should be excluded from the code coverage reports.
我已将Visual Studio 测试"构建步骤配置为使用此文件.执行选项:运行设置文件".runsettings 文件与 VS2012(更新 4)中此解决方案的文件相同.
I've configured the 'Visual Studio Test' build step to use this file. Execution options: 'Run Settings File'. The runsettings file was the same as the file for this solution in VS2012 (update 4).
由于某些奇怪的原因,TFS2015(更新 2)无法处理我们的运行设置文件.因此,通过删除上述设置,应用程序池不再停止......
For some odd reason TFS2015 (update 2) cannot handle our runsettings file. So by removing the setting mentioned above, the application pools are not stopping anymore....
举个例子,我在这里展示了 runsettings 文件:
Just for example, i'm showing the runsettings file here:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<!-- Path relative to solution directory -->
<ResultsDirectory>.\TestResults</ResultsDirectory>
<!-- [x86] | x64
- You can also change it from menu Test, Test Settings, Default Processor Architecture -->
<TargetPlatform>x86</TargetPlatform>
<!-- Framework35 | [Framework40] | Framework45 -->
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
<!-- [false] | true -->
<TreatTestAdapterErrorsAsWarnings>false</TreatTestAdapterErrorsAsWarnings>
</RunConfiguration>
<!-- Configurations for data collectors -->
<!-- For code coverage exclusions etc see: http://msdn.microsoft.com/en-us/library/jj159530.aspx.
Also: https://msdn.microsoft.com/en-us/library/jj159530.aspx -->
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage"
uri="datacollector://Microsoft/CodeCoverage/2.0"
assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage>
<!-- Match assembly file paths: -->
<ModulePaths>
<Exclude>
<ModulePath>.*CPPUnitTestFramework.*</ModulePath>
<ModulePath>.*fluentassertions.*</ModulePath>
<ModulePath>.*utils.test.dll</ModulePath>
</Exclude>
</ModulePaths>
<!-- Match the company name property in the assembly: -->
<CompanyNames>
<Exclude>
<CompanyName>.*microsoft.*</CompanyName>
</Exclude>
</CompanyNames>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<!-- Adapter Specific sections -->
<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>true</MapInconclusiveToFailed>
<CaptureTraceOutput>false</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>true</DeploymentEnabled>
</MSTest>
</RunSettings>
对我来说,这个文件没有任何问题,并且在 VS2015 和 VS2013 中使用它时它的工作原理......
To me, nothing is wrong with this file, and it works like it should when using it in VS2015 and VS2013....
如果没有这个文件,TFS2015 会报告错误的代码覆盖率,因为它不会忽略 3rd 方 nuget 包.所以运行设置文件的代码覆盖率约为 80%,但 TFS2015 现在报告的代码覆盖率为 31%....
Without this file, TFS2015 is reporting the wrong code coverage, because it does not ignore 3rd party nuget packages. So the code coverage with the runsettings file is about 80%, but TFS2015 is now reporting 31% code coverage....
但是,嘿,问题似乎已经解决了...或者我应该说,我在 TFS2015 中发现了一个错误 :-)
But hey, the issue seems to be resolved... Or should I say, I found a bug in TFS2015 :-)