guanghulab/reports/cd-debug-20260310.md
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

65 lines
3.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

━━━ 铸渊排查报告 · YM-CD-DEBUG-20260310-001 ━━━
排查时间2026-03-10T14:33Z
commit SHA60dda7e38a8b2ab118189eb69109ddc8c0730d5c (main HEAD)
① 工作流文件在 main 上:✅ 文件存在SHA: cf2fa91eeaa5436eded5a1f0dc0e17f3e2a4778e
② Actions 运行历史:共 52 次运行,全部失败 ❌
最近一次2026-03-10T14:08:00ZRun #52)状态 ❌ failure
触发 commitf951ef1876aa439a65e6edaef3f4c492fb88d30d
标题Merge pull request #49 from qinfendebingshuo/copilot/fix-model-intera…
③ 触发条件配置:✅ 正确
- 触发分支main ✅
- workflow_dispatch✅ 已配置(支持手动触发)
④ paths-ignore 范围:✅ 合理,仅排除非部署目录
- .github/persona-brain/**
- broadcasts-outbox/**
- syslog-inbox/**
- syslog-processed/**
- signal-log/**
- dev-nodes/**
⑤ 部署目标目录:✅ rsync 同步全仓库到 DEPLOY_PATH已修复旧问题
- rsync path = ./ → $DEPLOY_PATH/(全站同步)
- docs/index.html → 复制到站点根目录 index.html
- Nginx root 迁移逻辑:自动从 status-board/ 子目录迁移到 DEPLOY_PATH
⑥ Secrets 状态:❌ 未配置(这是所有 52 次失败的根本原因)
**失败日志分析Run #52, Job ID 66466822994**
```
echo "" > ~/.ssh/deploy_key ← DEPLOY_KEY 为空
ssh-keyscan -H >> ~/.ssh/known_hosts ← DEPLOY_HOST 为空ssh-keyscan 无参数
##[error]Process completed with exit code 1.
```
缺少的 Secrets
- DEPLOY_HOST — 服务器 IP必需
- DEPLOY_USER — SSH 用户名(必需)
- DEPLOY_KEY — SSH 私钥 PEM必需
- DEPLOY_PATH — 部署路径(必需)
⑦ 手动触发测试结果无法测试Secrets 未配置,部署必然失败)
- validate job✅ 通过(不需要 Secrets
- deploy job❌ 失败Secrets 为空 → ssh-keyscan 无主机名 → exit 1
- notify job 跳过deploy 失败后不执行)
⑧ 服务器上文件是否更新:❌ 从未成功部署过
⑨ guanghulab.com 是否显示最新内容:❌
【结论】CD 管线卡在第⑥步 — GitHub Secrets 未配置
【原因】:仓库 Settings → Secrets → Actions 中缺少 DEPLOY_HOST、DEPLOY_USER、DEPLOY_KEY、DEPLOY_PATH 四个必需 Secrets导致 SSH 连接步骤直接失败
【已执行修复】:在 deploy-to-server.yml 的 deploy job 开头添加了 "🔐 检查必需 Secrets" 步骤,在尝试 SSH 之前提前检测并给出明确错误提示
【建议修复方案】:
1. 在仓库 Settings → Secrets and variables → Actions 中添加以下 Secrets
- DEPLOY_HOST服务器 IP 地址
- DEPLOY_USERSSH 登录用户名
- DEPLOY_KEYSSH 私钥完整 PEM 内容
- DEPLOY_PATH服务器上网站根目录路径如 /var/www/guanghulab
2. 添加后,手动触发 workflow_dispatch 或 push 到 main 验证
✅ YM-CD-DEBUG-20260310-001 排查完成 · 2026-03-10T14:33Z