You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Pipelines下载CmdLine任务失败:连接被重置问题求助

解决Azure Pipelines本地Agent下载CmdLine任务失败(Connection reset by peer)的问题

问题场景

已配置如下Azure Pipelines:

trigger:
  branches:
    include:
      - pre-prod

pool:
  name: default

stages:
- stage: build
  displayName: 'Build stage'
  jobs:
  - job: Build
    displayName: 'Build'
    steps:
    - script: echo Build starting
    - script: |
        docker-compose -f docker-compose.yml build
      displayName: 'Build Docker images'

Ubuntu服务器上已安装并注册Azure Agent,能正常连接服务器,但任务初始化阶段下载CmdLine任务时反复报错:

##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[warning]Back off 21.485 seconds before retry.
##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[warning]Back off 27.578 seconds before retry.
##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[error]Unable to read data from the transport connection: Connection reset by peer.

机器处于网络受限环境,修改DNS未解决问题,以下是可行解决方法:

解决方法

  • 手动部署CmdLine任务包

    1. 在能正常访问Azure DevOps的设备上,获取CmdLine任务的离线zip包(对应Agent兼容的稳定版本)
    2. 将zip包传到Ubuntu Agent安装目录下的_work/_tasks文件夹(无此目录则手动创建)
    3. 解压zip包,文件夹命名遵循CmdLine_<任务ID>格式(任务ID可从Azure DevOps任务市场页面或错误日志关联信息中获取)
    4. 执行./run.sh restart重启Agent,重新触发Pipeline任务
  • 配置Agent使用代理服务器

    1. 进入Ubuntu机器上的Azure Agent安装目录,修改config.sh文件
    2. 添加代理环境变量配置:
      export http_proxy="http://你的代理IP:端口"
      export https_proxy="http://你的代理IP:端口"
      export no_proxy="localhost,127.0.0.1,你的Azure DevOps域名"
      
    3. 执行./run.sh restart重启Agent,确保代理配置生效后重试任务
  • 离线安装包含任务的Agent

    1. 在可联网机器上,下载Azure Agent时添加--include-tasks参数,指定包含CmdLine任务,生成完整离线包
    2. 将整个Agent目录打包上传到Ubuntu机器并解压
    3. 在Ubuntu机器上执行./config.sh完成Agent注册(无需联网)
    4. 启动Agent,CmdLine任务已预加载在本地,无需在线下载
  • 检查网络策略与防火墙

    1. 确认Ubuntu机器防火墙允许出站访问Azure DevOps相关域名(如dev.azure.com、vsblob.dev.azure.com)
    2. 联系网络管理员开放443端口的出站权限,确保Agent能访问Azure任务存储节点

内容的提问来源于stack exchange,提问作者reza jafari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 23:10:55