简体   繁体   English

TFS构建中的NuGet推送失败

[英]NuGet Push Failure in TFS build

Preface: I am running NuGet Server (2.11.3) on Windows 2012 R2 / IIS 8.5. 前言:我正在Windows 2012 R2 / IIS 8.5上运行NuGet Server(2.11.3)。 The NuGet Server manages its packages folder in separated file server (shared folder). NuGet服务器在单独的文件服务器(共享文件夹)中管理其packages文件夹。 Additionally I am running TFS build machine (agent from TFS 2015) that uses this nuget server for both restore and push activities. 另外,我正在运行TFS构建计算机(TFS 2015中的代理),该计算机使用此nuget服务器进行还原和推送活动。 Naturally, each build, initially, reads the target solution >>> projects >>> packages.config files and restores the configured packages from the nuget server. 自然地,每个构建最初都会读取目标解决方案>>>项目>>> packages.config文件,并从nuget服务器恢复配置的软件包。 On late step, the agent generates the required *.nupkg files and pushes them to the nuget endpoint of the same nuget server. 在较晚的步骤中,代理会生成所需的* .nupkg文件,并将它们推送到同一nuget服务器的nuget端点。 Those are dependencies of other solutions. 这些是其他解决方案的依赖项。

Problem: the majority of the solutions running properly without any special issues. 问题:大多数解决方案运行正常,没有任何特殊问题。 There are couple of solutions that only 1-3 projects within them, fail the TFS build with the following message: 有几种解决方案,其中只有1-3个项目失败,TFS构建失败并显示以下消息:

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

The IIS logs on nuget server looks like the following: IIS登录nuget服务器的外观如下所示:

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

The following event is logged (shown in the event viewer) in the nuget server: 在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)

NOTE: per my checking sometime the package is created in the packages folder and sometime is not. 注意:根据我的检查,有时会在packages文件夹中创建该软件包,有时则不会。 NOTE: I am pretty sure that all configuration is in place (including API key etc..). 注意:我很确定所有配置都到位(包括API密钥等。)。 Of course, will be glad to know what is missing though. 当然,很高兴知道缺少了什么。

Will appreciate any advice on this one. 将不胜感激与此有关的任何建议。

Many thanks in advance, Ofer 预先非常感谢,奥弗

Poor answer though, but still one that might help any potential issues you guys encounter :-). 虽然答案不佳,但仍然可以帮助您解决任何潜在问题:-)。

I've realized that my "problematic" push requests had worked against newly created NuGet server. 我意识到我的“问题”推送请求已针对新创建的NuGet服务器进行了处理。 The new one was Windows Server 2012 R2 too. 新的也是Windows Server 2012 R2。 I've just raised it clean and added ONLY the necessary windows features to support the IIS/web operations against the Nuget server. 我刚刚将其清理干净,仅添加了必要的Windows功能以支持针对Nuget服务器的IIS / Web操作。

If I am not mistaken it was only ASP.NET 4.5. 如果我没有记错的话,那只是ASP.NET 4.5。

Best regards, Ofer 最好的问候,奥弗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM