解决 Turborepo 报错 Remote cache signature verification failed 缓存签名失效修复
排查 在 CI/CD 中开启 Vercel / 自建 Turborepo 远端缓存时报 remote cache signature verification failed 导致全量重新编译,分析 TURBO_SIGNATURE_KEY 与 Hash 签名校验。
问题现象
GitHub Actions 运行 turbo run build 时,远端缓存无法命中,控制台打印签名拦截警告:
WARNING: Remote caching failed: Signature verification failed for artifact 441209b.
Falling back to local build. Cache hit rate: 0%
触发根因
- 团队启用了远端缓存签名保护(Cache Signature Verification),防止恶意篡改缓存产物;
- CI 构建环境中的
TURBO_SIGNATURE_KEY密钥与本地生成缓存时使用的密钥不匹配; - 自建的远端缓存服务器(如 turborepo-remote-cache)时间戳同步倾斜导致签名摘要校验失败。
解决步骤
统一并核验本地与 CI 环境中的远程缓存凭证环境变量
在 CI Secret 中确保注入:
export TURBO_TOKEN="your-turborepo-token"
export TURBO_TEAM="my-team"
export TURBO_REMOTE_CACHE_SIGNATURE_KEY="your-shared-signature-secret"
在 turbo.json 中核验 remoteCache 配置
检查配置项:
{
"$schema": "https://turbo.build/schema.json",
"remoteCache": {
"signature": true
}
}
若自建缓存服务无签名需求可临时关闭签名校验验证连通性
配置 signature: false。
验证确认
重新触发 CI 流水线:
终端输出显示 >>> FULL TURBO: 12 tasks cached,构建时间从 6 分钟断崖式压缩至 8 秒。


