【问题标题】:TFS 2018 Use NuGet 4.3.0 task fails - ETIMEDOUT 93.184.221.200:443TFS 2018 使用 NuGet 4.3.0 任务失败 - ETIMEDOUT 93.184.221.200:443
【发布时间】:2018-06-09 05:39:58
【问题描述】:

我有一个 WinForms/WPF 应用程序,我正在尝试使用 .NET 桌面构建模板。 因为目前我不想在 TFS 服务器机器上安装 Visual Studio,所以我试图让它在没有它的情况下工作。 我已经安装并配置了执行 config 命令的构建代理(vsts-agent-win7-x64-2.122.1 版本,我猜是最后一个)。 我还编辑了构建模板,禁用了 VS 任务,如您在屏幕截图中所见。

日志:

我在文件夹下有几个版本(3.3、3.5、4.0)的 NuGet.exe: C:\agent_work_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\node_modules\nuget-task-common\NuGet

我在公司防火墙+代理下,带有自动配置脚本。

在 Visual Studio 2017 中,我设置了 PackageReference 格式,以防万一……

一点更新:第一次一切都很顺利。 所有其他构建都失败了:/ 我启用了调试模式,这是日志:

2018-01-08T09:12:43.1617923Z ##[debug]Evaluating condition for step: 'Use NuGet 4.3.0'
2018-01-08T09:12:43.1617923Z ##[debug]Evaluating: succeeded()
2018-01-08T09:12:43.1617923Z ##[debug]Evaluating succeeded:
2018-01-08T09:12:43.1617923Z ##[debug]=> (Boolean) True
2018-01-08T09:12:43.1617923Z ##[debug]Expanded: True
2018-01-08T09:12:43.1617923Z ##[debug]Result: True
2018-01-08T09:12:43.1617923Z ##[section]Starting: Use NuGet 4.3.0
2018-01-08T09:12:43.1930405Z ==============================================================================
2018-01-08T09:12:43.1930405Z Task         : NuGet Tool Installer
2018-01-08T09:12:43.1930405Z Description  : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this step to change the version of NuGet used in the NuGet steps.
2018-01-08T09:12:43.1930405Z Version      : 0.1.3
2018-01-08T09:12:43.1930405Z Author       : Microsoft Corporation
2018-01-08T09:12:43.1930405Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
2018-01-08T09:12:43.1930405Z ==============================================================================
2018-01-08T09:12:43.6305452Z ##[debug]agent.workFolder=C:\agent\_work
2018-01-08T09:12:43.6305452Z ##[debug]loading inputs and endpoints
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-01-08T09:12:43.6305452Z ##[debug]loading INPUT_CHECKLATEST
2018-01-08T09:12:43.6305452Z ##[debug]loading INPUT_VERSIONSPEC
2018-01-08T09:12:43.6305452Z ##[debug]loaded 5
2018-01-08T09:12:43.7086709Z ##[debug]check path : C:\agent\_work\_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\task.json
2018-01-08T09:12:43.7086709Z ##[debug]set resource file to: C:\agent\_work\_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\task.json
2018-01-08T09:12:43.7086709Z ##[debug]system.culture=en-US
2018-01-08T09:12:43.7242974Z ##[debug]versionSpec=4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]checkLatest=false
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]Exact match expected on version: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]Trying to get tool from local cache
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]Agent.Version=2.122.1
2018-01-08T09:12:43.7242974Z ##[debug]Agent.ToolsDirectory=C:\agent\_work\_tool
2018-01-08T09:12:43.7242974Z ##[debug]checking cache: C:\agent\_work\_tool\NuGet\4.3.0\x64
2018-01-08T09:12:43.7242974Z ##[debug]not found
2018-01-08T09:12:43.7242974Z ##[debug]Agent.Version=2.122.1
2018-01-08T09:12:43.7242974Z ##[debug]Agent.ToolsDirectory=C:\agent\_work\_tool
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.0.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]evaluating 1 versions
2018-01-08T09:12:43.7399207Z ##[debug]match not found
2018-01-08T09:12:43.7399207Z ##[debug]Querying versions list
2018-01-08T09:13:04.7988484Z ERR:connect ETIMEDOUT 93.184.221.200:443
2018-01-08T09:13:04.7988484Z ##[debug]task result: Failed
2018-01-08T09:13:04.7988484Z ##[debug]Processed: ##vso[task.complete result=Failed;]
2018-01-08T09:13:04.8144544Z ##[section]Finishing: Use NuGet 4.3.0

奇怪的是它找不到应该找到 Nuget 4.3.0 (C:\agent_work_tool\NuGet\4.3.0\x64) 的缓存文件夹,即使我手动创建它并放入 exe进去。 还有其他想法吗?

【问题讨论】:

    标签: tfs build nuget


    【解决方案1】:

    此错误似乎与是否安装了 VS 无关。 NuGet Tool Installer 任务只是下载和缓存指定版本的 NuGet 并将其添加到 PATH

    与成功任务的日志对比如下:

    2017-12-29T09:35:25.5666249Z Author       : Microsoft Corporation
    2017-12-29T09:35:25.5666381Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
    2017-12-29T09:35:25.5666532Z ==============================================================================
    2017-12-29T09:35:26.5048207Z Downloading: https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe
    2017-12-29T09:35:26.6795171Z Caching tool: NuGet 4.3.0 x64
    2017-12-29T09:35:26.6906111Z Using version: 4.3.0
    2017-12-29T09:35:26.6912667Z Found tool in cache: NuGet 4.3.0 x64
    2017-12-29T09:35:26.6913042Z Using tool path: d:\a\_tool\NuGet\4.3.0\x64
    2017-12-29T09:35:26.6915843Z Prepending PATH environment variable with directory: d:\a\_tool\NuGet\4.3.0\x64
    2017-12-29T09:35:26.7016016Z ##[section]Finishing: Use NuGet 4.3.0
    

    从 Internet https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe 下载版本 4.3.0 nuget.exe 工具时出现 ETIMEDOUT 错误。

    问题应该与构建代理上的网络环境有关,例如防火墙、代理。您还可以尝试在安装了 Visual Studio 且位于相同网络环境中的代理上使用相同的 Nuget 任务。这将缩小与 VS 相关的错误。

    【讨论】:

    • 感谢您的回答和新年快乐 :) 实际上这是一个配置问题,但与代理/网络无关,更多的是关于内部策略。事实上,它被禁用了文件下载(考虑到这是一个服务器,这可能是有道理的)。在 Internet Explorer 上调整设置,步骤显示绿灯。
    【解决方案2】:

    好的,我使用 x64.complete 技巧解决了问题,如 here 所述。 但是我仍然对是否允许下载 nuget.exe 感到困惑。 目前它使用 4.3.0,但它是一种解决方法,因为它是之前下载的,而不是在构建代理过程中。 如果有新版本出来,我应该手动做,就像我现在做的一样。这不是特别舒服。

    【讨论】:

      【解决方案3】:

      注意:TFS2017.2 NuGet restore task - ETIMEDOUT 93.184.221.200:443 可能重复

      为了使其正常工作,我们修改了构建代理的环境变量,添加了

      http_proxy=http://wsa.arz.de:3128
      https_proxy=http://wsa.arz.de:3128
      

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 2018-02-12
        • 2022-06-21
        • 2020-04-26
        • 2017-10-20
        • 1970-01-01
        • 1970-01-01
        • 2018-10-15
        • 2018-12-11
        • 1970-01-01
        相关资源
        最近更新 更多