Azure Devops Create Project TF400711问题分析解决
前几天,团队使用Azure Devops创建团队项目出了一个奇怪的错误:
TF400797: 作业扩展具有一个未处理的错误: Microsoft.TeamFoundation.Framework.Server.TeamFoundationServicingException: TF400711: 在 ProjectCreate 期间,对组件 ProjectCreate.TfsTeamBuild 执行维护步骤”Create the Team Project“时出错: 文件存在。 ---> System.IO.IOException: 文件存在。 在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 在 System.IO.Path.InternalGetTempFileName(Boolean checkHost) 在 Microsoft.TeamFoundation.Build.Server.ProcessTemplate.UpdateCachedProcessParameters(IVssRequestContext requestContext, VersionSpec versionSpec) 在 Microsoft.TeamFoundation.Build.Server.TeamFoundationBuildService.AddProcessTemplates(IVssRequestContext requestContext, IList`1 processTemplates) 在 Microsoft.TeamFoundation.Build.Server.TeamFoundationBuildService.CreateBuiltInProcessTemplates(IVssRequestContext requestContext, String teamProjectUri, Boolean isUpgrade) 在 Microsoft.TeamFoundation.Build.Server.TeamFoundationBuildService.CreateTeamProject(IVssRequestContext requestContext, String projectUri, IList`1 permissions) 在 Microsoft.TeamFoundation.Server.Servicing.TFCollection.BuildStepPerformer.CreateTeamProject(ServicingContext servicingContext) 在 Microsoft.TeamFoundation.Framework.Server.TeamFoundationStepPerformerBase.PerformHostStep(String servicingOperation, ServicingOperationTarget target, IServicingStep servicingStep, String stepData, ServicingContext servicingContext) 在 Microsoft.TeamFoundation.Framework.Server.TeamFoundationStepPerformerBase.PerformStep(String servicingOperation, ServicingOperationTarget target, String stepType, String stepData, ServicingContext servicingContext) 在 Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.PerformServicingStep(ServicingStep step, ServicingContext servicingContext, ServicingStepGroup group, ServicingOperation servicingOperation, Int32 stepNumber, Int32 totalSteps) --- 内部异常堆栈跟踪的结尾 --- 在 Microsoft.TeamFoundation.Framework.Server.ServicingContext.FinishStep(Exception exception) 在 Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.PerformServicingStep(ServicingStep step, ServicingContext servicingContext, ServicingStepGroup group, ServicingOperation servicingOperation, Int32 stepNumber, Int32 totalSteps) 在 Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.PerformOperations(Int32 stepsToPerform) 在 Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.Execute(Int32 numberOfStepsToPerform) 在 Microsoft.TeamFoundation.Framework.Server.TeamFoundationServicingService.PerformServicingJob(IVssRequestContext requestContext, ServicingJobData servicingJobData, Guid jobId, DateTime jobQueueTime, Int32 numberOfStepsToPerform, ITFLogger logger) 在 Microsoft.TeamFoundation.Framework.Server.TeamFoundationServicingService.PerformServicingJobWithPotentialReRun(IVssRequestContext requestContext, ServicingJobData servicingJobData, Guid jobId, DateTime jobQueueTime, ITFLogger logger) 在 Microsoft.TeamFoundation.Framework.Server.TeamFoundationServicingService.PerformServicingJob(IVssRequestContext requestContext, ServicingJobData servicingJobData, Guid jobId, DateTime jobQueueTime, ITFLogger logger) 在 Microsoft.TeamFoundation.JobService.Extensions.Core.ServicingJobExtension.Run(IVssRequestContext requestContext, TeamFoundationJobDefinition jobDefinition, DateTime jobQueueTime, String& resultMessage) 在 Microsoft.TeamFoundation.Framework.Server.JobRunner.ExecuteJob(IVssRequestContext requestContext);
对于这个异常提示:
TF400711: 在 ProjectCreate 期间,对组件 ProjectCreate.TfsTeamBuild 执行维护步骤”Create the Team Project“时出错: 文件存在
网上找了很多解决方案,大多是要删除%temp%下的文件,因为%temp%下的文件个数超过了65536个
但是删除%temp%下的文件后,问题依然没有解决。
此时,通过在Azure devops server上使用ProcessMonitor 分析TFS Job Agent发现了以下问题
可以发现TFS Job Agent实际访问的是
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
通过删除这个路径下*.tmp文件。
问题得到了解决。整个问题的解决过程分享给大家。
周国庆
2022/11/13