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

Azure DevOps(AzDO)Maven缓存任务执行超时问题咨询

问题现象

在Azure DevOps(AzDO)中运行用于缓存Maven本地仓库的Cache任务时抛出超时异常,公开网络暂无相关解决参考信息。
错误日志如下:

2021-11-19T13:12:49.5440178Z ##[section]Starting: Cache Maven local repo
2021-11-19T13:12:49.5444463Z ==============================================================================
2021-11-19T13:12:49.5444700Z Task         : Cache
2021-11-19T13:12:49.5444880Z Description  : Cache files between runs
2021-11-19T13:12:49.5445073Z Version      : 2.0.1
2021-11-19T13:12:49.5445247Z Author       : Microsoft Corporation
2021-11-19T13:12:49.5445454Z Help         : https://aka.ms/pipeline-caching-docs
2021-11-19T13:12:49.5445913Z ==============================================================================
2021-11-19T13:12:50.3859003Z Resolving key:
2021-11-19T13:12:50.3867990Z  - maven      [string]
2021-11-19T13:12:50.3868628Z  - "Linux"    [string]
2021-11-19T13:12:50.3869252Z  - **/pom.xml [file pattern; matches: 1]
2021-11-19T13:12:50.3870147Z    - s/pom.xml --> 425BE14263A590554133E4A4AE3B095D0207EE19CADB68111111A8623073C9
2021-11-19T13:12:50.3870747Z Resolved to: maven|"Linux"|6BG0VLzocHR1ABXQNLQ+q7oxXHj2Ln9xNBME=
2021-11-19T13:12:50.3872532Z Resolving restore key:
2021-11-19T13:12:50.3873112Z  - maven   [string]
2021-11-19T13:12:50.3873653Z  - "Linux" [string]
2021-11-19T13:12:50.3874064Z Resolved to: maven|"Linux"|**
2021-11-19T13:12:50.3874469Z Resolving restore key:
2021-11-19T13:12:50.3874998Z  - maven [string]
2021-11-19T13:12:50.3875403Z Resolved to: maven|**
2021-11-19T13:12:50.4071086Z ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 018d9b8b-7e2e-4eb4-9081-60a8aac6ca19
2021-11-19T13:12:50.4271999Z Getting a pipeline cache artifact with one of the following fingerprints:
2021-11-19T13:12:50.4272751Z Fingerprint: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:12:50.4273230Z Fingerprint: `maven|"Linux"|**`
2021-11-19T13:12:50.4273649Z Fingerprint: `maven|**`
2021-11-19T13:12:51.4866539Z There is a cache hit: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:12:51.4878034Z Used scope: 1506;0fc5062f-55dd-476b-baba-8952a15401e7;refs/heads/EOD_STORES;52820a17-3ace-4f9e-ba77-2330a6eccacb
2021-11-19T13:12:51.5808454Z Entry found at fingerprint: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:13:51.9289494Z [https://vb8vsblobprodsu6weus46.blob.core.windows.net/db908636dc538642c896c6b0557076a854/1F68E25AD7A9B91792F6DE976146515E90F7488470FD5DB9D2166AEB7C2451A201?sv=2019-07-07&sr=b&spr=https&se=2021-11-20T14:07:21Z&sp=r&rscl=x-e2eid-7f1caaa0-030b4341-adf321f6-8515e4e2-session-018d9b8b-7e2e4eb4-908160a8-aac6ca19] Try 1/5, Task was requested to be canceled.
2021-11-19T13:45:52.9504822Z ApplicationInsightsTelemetrySender correlated 3 events with X-TFS-Session 018d9b8b-7e2e-4eb4-9081-60a8aac6ca19
2021-11-19T13:45:52.9581543Z ##[error]Attempt timed out after 00:01:00.
2021-11-19T13:45:52.9618987Z ##[section]Finishing: Cache Maven local repo

解决方案

  • 调整任务超时配置:默认Cache任务的单步超时时间为1分钟,大体积Maven缓存拉取容易触发超时,可在流水线的Cache任务配置中添加timeoutInMinutes参数,根据缓存体积设置为5~10分钟即可。如果使用自托管代理,同时检查代理节点的全局超时配置,避免上层配置截断任务执行时间。
  • 缩减缓存体积:Maven本地仓库默认会包含快照版本依赖、临时下载文件、失效的冗余依赖,建议配置缓存路径时排除此类文件,仅保留稳定的正式版本依赖,降低缓存包大小,提升拉取速度。
  • 排查网络连通性:若使用自托管代理,确认代理节点可正常访问AzDO关联的Azure Blob存储域名,无内网防火墙、代理服务器拦截限速。如果企业内网出口带宽有限,可放弃使用AzDO自带缓存,改为将依赖缓存托管在内网制品库中。
  • 清理无效历史缓存:进入AzDO项目的管道缓存管理页,删除对应指纹的旧Maven缓存,重新运行流水线生成新的缓存包,避免旧缓存包损坏、存储节点异常导致的拉取失败。
  • 降级Cache任务版本:当前使用的2.0.1版本Cache任务存在已知的Linux环境大文件拉取超时问题,可切换为1.x稳定版本的Cache任务规避该bug。

内容的提问来源于stack exchange,提问作者Wilfred Clement

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.24 22:54:00