TFS 构建中的 NuGet 推送失败
NuGet Push Failure in TFS build
前言: 我是 运行 NuGet 服务器 (2.11.3) Windows 2012 R2 / IIS 8.5。 NuGet 服务器在单独的文件服务器(共享文件夹)中管理其包文件夹。
此外,我是 运行 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 键等)。当然,很高兴知道缺少什么。
如有任何建议,我们将不胜感激。
非常感谢,
报价
虽然答案很差,但仍然可以帮助解决你们遇到的任何潜在问题:-)。
我发现我的 "problematic" 推送请求对新创建的 NuGet 服务器有效。新的也是 Windows Server 2012 R2。我刚刚将其提升干净并仅添加了必要的 windows 功能以支持针对 Nuget 服务器的 IIS/web 操作。
如果我没记错的话只是 ASP.NET 4.5.
此致,
报价
前言: 我是 运行 NuGet 服务器 (2.11.3) Windows 2012 R2 / IIS 8.5。 NuGet 服务器在单独的文件服务器(共享文件夹)中管理其包文件夹。 此外,我是 运行 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 键等)。当然,很高兴知道缺少什么。
如有任何建议,我们将不胜感激。
非常感谢, 报价
虽然答案很差,但仍然可以帮助解决你们遇到的任何潜在问题:-)。
我发现我的 "problematic" 推送请求对新创建的 NuGet 服务器有效。新的也是 Windows Server 2012 R2。我刚刚将其提升干净并仅添加了必要的 windows 功能以支持针对 Nuget 服务器的 IIS/web 操作。
如果我没记错的话只是 ASP.NET 4.5.
此致, 报价