TeamCity:2019.1.1(内部版本66192) Nuget安装程序:5.1.0
作为我的第一个构建步骤,我有nuget安装程序。我的构建步骤中列出了三(3)个软件包源。 Nuget,DevExpress和我们的内部资源都以teamcity本身体现。
当我运行构建时,它每隔一次就会通过。
当它失败时,是因为TC feed返回401。完整的堆栈跟踪如下:
[15:02:22] [restore] C:\windows\system32\config\systemprofile\AppData\Roaming\NuGet\NuGet.Config
[15:02:22] [restore]
[15:02:22] [restore] Feeds used:
[15:02:22] [restore] https://www.nuget.org/api/v2
[15:02:22] [restore] https://nuget.devexpress.com/ID/api
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json
[15:02:22] [restore] Errors in packages.config projects
[15:02:22] [restore] Unable to find version '2019.7.10.4' of package 'AdvancedMetrics.Core'.
[15:02:22] [restore] https://nuget.devexpress.com/ID/api: Package 'AdvancedMetrics.Core.2019.7.10.4' is not found on source 'https://nuget.devexpress.com/id/api'.
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json: Unable to load the service index for source https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json.
[15:02:22] [restore] Response status code does not indicate success: 401 ().
[15:02:22] [restore] https://www.nuget.org/api/v2: Package 'AdvancedMetrics.Core.2019.7.10.4' is not found on source 'https://www.nuget.org/api/v2'.
[15:02:22] [restore] Unable to find version '2019.7.10.4' of package 'AdvancedMetrics.Core.DAL'.
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json: Unable to load the service index for source https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json.
[15:02:22] [restore] Response status code does not indicate success: 401 ().
[15:02:22] [restore] https://nuget.devexpress.com/ID/api: Package 'AdvancedMetrics.Core.DAL.2019.7.10.4' is not found on source 'https://nuget.devexpress.com/id/api'.
[15:02:22] [restore] https://www.nuget.org/api/v2: Package 'AdvancedMetrics.Core.DAL.2019.7.10.4' is not found on source 'https://www.nuget.org/api/v2'.
[15:02:22] [restore] Unable to find version '2019.7.10.4' of package 'AdvancedMetrics.Core.BLL'.
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json: Unable to load the service index for source https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json.
[15:02:22] [restore] Response status code does not indicate success: 401 ().
[15:02:22] [restore] https://nuget.devexpress.com/ID/api: Package 'AdvancedMetrics.Core.BLL.2019.7.10.4' is not found on source 'https://nuget.devexpress.com/id/api'.
[15:02:22] [restore] https://www.nuget.org/api/v2: Package 'AdvancedMetrics.Core.BLL.2019.7.10.4' is not found on source 'https://www.nuget.org/api/v2'.
[15:02:22] [restore] Unable to find version '2019.7.10.4' of package 'AdvancedMetrics.Core.MailGun'.
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json: Unable to load the service index for source https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json.
[15:02:22] [restore] Response status code does not indicate success: 401 ().
[15:02:22] [restore] https://nuget.devexpress.com/ID/api: Package 'AdvancedMetrics.Core.MailGun.2019.7.10.4' is not found on source 'https://nuget.devexpress.com/id/api'.
[15:02:22] [restore] https://www.nuget.org/api/v2: Package 'AdvancedMetrics.Core.MailGun.2019.7.10.4' is not found on source 'https://www.nuget.org/api/v2'.
[15:02:22] [restore] Unable to find version '2019.7.10.4' of package 'AdvancedMetrics.Core.Web'.
[15:02:22] [restore] https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json: Unable to load the service index for source https://teamcity.mydomain.com/httpAuth/app/nuget/feed/ASPNet_Apps/ASP_NET_Apps/v3/index.json.
[15:02:22] [restore] Response status code does not indicate success: 401 ().
[15:02:22] [restore] https://nuget.devexpress.com/id/api: Package 'AdvancedMetrics.Core.Web.2019.7.10.4' is not found on source 'https://nuget.devexpress.com/id/api'.
[15:02:22] [restore] https://www.nuget.org/api/v2: Package 'AdvancedMetrics.Core.Web.2019.7.10.4' is not found on source 'https://www.nuget.org/api/v2'.
[15:02:22] [restore]
[15:02:22] [restore] Installed:
[15:02:22] [restore] 76 package(s) to packages.config projects
[15:02:22] [restore] Process exited with code 1
[15:02:22] [restore] Process exited with code 1 (Step: NuGet Installer)
[15:02:22] [Step 1/5] Step NuGet Installer failed
答案 0 :(得分:0)
这里的问题是因为我将变量添加到了模板中。显然,您无法在TC中做到这一点。
我从模板中删除了变量,并将其手动添加到构建步骤中。奏效了!