Commit Graph

3 Commits

Author SHA1 Message Date
claude_dev 0f6cdbedc9 fix(entrypoint): uvicorn --log-level 转小写(治 exit2 crash loop,第3根因)
CI/CD / test (push) Successful in 9s
CI/CD / nas-deploy (push) Successful in 22s
CI/CD / nas-verify (push) Successful in 2s
新版 entrypoint(uvicorn 工厂)拼 --log-level ${VNPY_LOG_LEVEL:-info},但 VNPY_LOG_LEVEL
已 export INFO 大写,默认值不生效→传 INFO→uvicorn case-sensitive 拒绝→exit2 crash。
改 ${VNPY_LOG_LEVEL,,} 转小写(bash4+,shebang /bin/bash 支持)。

新版 entrypoint uvicorn 工厂首次在 NAS 跑,连暴露 3 个 crash 根因(已全修):
  6d786fb: PYTHONPATH(spawn import 治 BrokenProcessPool)
  c210197: +x 执行位(tini exit126) + SKIP_REDIS_CHECK(Redis 超时)
  本commit: --log-level 小写(uvicorn exit2)
旧版 python run_web.py 硬编码 log_level='info' 无后两个问题。
2026-08-01 21:59:39 +08:00
claude_dev c210197778 fix(entrypoint): +x 执行位 + SKIP_REDIS_CHECK 默认1(治 run535 NAS crash loop)
CI/CD / test (push) Successful in 8s
CI/CD / nas-deploy (push) Failing after 34s
CI/CD / nas-verify (push) Has been skipped
run535 部署后容器 crash loop(exit126),两个独立根因:
1. Permission denied: entrypoint.sh git mv 后 644 无执行位,rsync 推 NAS 也是 644,
   bind mount 覆盖镜像层 chmod +x 无效,tini exec 失败。→ entrypoint.sh git 100755。
2. Redis 连接超时:新版 entrypoint 检查 SKIP_REDIS_CHECK!=1 才查 Redis(旧版 if false
   硬跳过),NAS 无 Redis 卡检查 crash。→ 默认 SKIP_REDIS_CHECK=1(复现旧版跳过)。

附:文档(nas-deploy-plan 方案①已实施 + ops/README 根治标记)。
2026-08-01 21:43:29 +08:00
claude_dev 6d786fbf41 fix(orchestrator): spawn 子进程 PYTHONPATH + entrypoint 回根治孤儿
CI/CD / test (push) Successful in 8s
CI/CD / nas-deploy (push) Failing after 33s
CI/CD / nas-verify (push) Has been skipped
ProcessPoolExecutor(spawn)子进程不继承主进程 sys.path(insert 是内存修改),
import sanguo_orchestrator 失败->BrokenProcessPool->API 回测静默失败,POST 秒回
task_id 但轮询永远 404。spawn 继承 env 不继承 sys.path,故:
1. Dockerfile ENV PYTHONPATH=/app:/app/vnpy_v4.4.0(镜像层,bind mount 覆盖不了)
2. entrypoint.sh 回仓库根(git mv 自 docker/):promote --exclude /docker 致旧版
   entrypoint 在 NAS 成 git 外孤儿(340行,被 bind mount 覆盖镜像层);回根后全量
   rsync 自动推可复现(对齐 docs/deployment/nas-deploy-plan.md 预设修复)+export 兜底
3. 三 Dockerfile COPY 路径同步

反馈: 策略 session(根因诊断+探针验证)
2026-08-01 21:33:20 +08:00