TFS构建中的NuGet推送失败

时间:2017-03-27 19:42:11

标签: tfs build nuget push

前言:我在Windows 2012 R2 / IIS 8.5上运行NuGet Server(2.11.3)。 NuGet Server在分离的文件服务器(共享文件夹)中管理其packages文件夹。 另外,我正在运行TFS构建机器(来自TFS 2015的代理),它使用这个nuget服务器进行恢复和推送活动。当然,每个构建最初都读取目标解决方案>>>项目>>> packages.config文件并从nuget服务器恢复已配置的软件包。在后一步,代理生成所需的* .nupkg文件并将它们推送到同一nuget服务器的nuget端点。这些是其他解决方案的依赖。

问题:大多数解决方案正常运行,没有任何特殊问题。有几个解决方案,其中只有1-3个项目,使TFS构建失败,并显示以下消息:

Response status code does not indicate success: 500 (Internal Server Error).
Unexpected exit code 1 returned from tool NuGet.exe

nuget服务器上的IIS日志如下所示:

2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 15
2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 15
2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 31

在nuget服务器中记录以下事件(显示在事件查看器中):

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 27/03/2017 10:40:17 
Event time (UTC): 27/03/2017 07:40:17 
Event ID: cb897ce6dc2f4e40a07c71a9160718f2 
Event sequence: 2073 
Event occurrence: 4 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/MainRepository-1-131350724531418170 
    Trust level: Full 
    Application Virtual Path: /MainRepository 
    Application Path: C:\inetpub\wwwroot\NugetServerInternal\ 
    Machine name: NUGET-SRV 

Process information: 
    Process ID: 2512 
    Process name: w3wp.exe 
    Account name: some.domain/some.user 

Exception information: 
    Exception type: IndexOutOfRangeException 
    Exception message: Index was outside the bounds of the array.
   at System.Web.HttpRawUploadedContent.get_Item(Int32 index)
   at System.Web.HttpMultipartContentTemplateParser.GetNextLine()
   at System.Web.HttpMultipartContentTemplateParser.ParseIntoElementList()
   at System.Web.HttpMultipartContentTemplateParser.Parse(HttpRawUploadedContent data, Int32 length, Byte[] boundary, Encoding encoding)
   at System.Web.HttpRequest.GetMultipartContent()
   at System.Web.HttpRequest.FillInFilesCollection()
   at System.Web.HttpRequest.EnsureFiles()
   at System.Web.HttpRequest.get_Files()
   at System.Web.HttpRequestWrapper.get_Files()
   at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Request information: 
    Request URL: http://nuget-srv/MainRepository/nuget/ 
    Request path: /MainRepository/nuget/ 
    User host address: 192.168.1.30 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: some.domain/some.user 

Thread information: 
    Thread ID: 19 
    Thread account name: some.domain/some.user 
    Is impersonating: False 
    Stack trace:    at System.Web.HttpRawUploadedContent.get_Item(Int32 index)
   at System.Web.HttpMultipartContentTemplateParser.GetNextLine()
   at System.Web.HttpMultipartContentTemplateParser.ParseIntoElementList()
   at System.Web.HttpMultipartContentTemplateParser.Parse(HttpRawUploadedContent data, Int32 length, Byte[] boundary, Encoding encoding)
   at System.Web.HttpRequest.GetMultipartContent()
   at System.Web.HttpRequest.FillInFilesCollection()
   at System.Web.HttpRequest.EnsureFiles()
   at System.Web.HttpRequest.get_Files()
   at System.Web.HttpRequestWrapper.get_Files()
   at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

注意:根据我的检查,有时会在packages文件夹中创建包,有时则不会。 注意:我很确定所有配置都已到位(包括API密钥等)。当然,很高兴知道缺少什么。

对此有任何建议。

非常感谢, 奥弗

1 个答案:

答案 0 :(得分:0)

虽然答案很差,但仍然可以帮助你们遇到的任何潜在问题: - )。

我意识到我的“有问题”的推送请求对新创建的NuGet服务器有效。新的也是Windows Server 2012 R2。我刚刚提出它并添加了必要的Windows功能,以支持针对Nuget服务器的IIS / Web操作。

如果我没弄错的话,那只是ASP.NET 4.5。

祝你好运, 奥弗