dy-dashboard/vault/知识库/工作指南/训练记录/2026-08-12-部署后planning页面500修复.md
2026-10-28 11:14:17 +08:00

25 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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.

# 2026-08-12 部署后 planning 页面 500 修复(补全缺失数据库列)
## 旭东 → OpenClaw
> Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
> planning:1 Uncaught (in promise) SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON
## OpenClaw 响应
**问题定位:** 当日两阶段部署(8.186→11.79→云端)后,planning 页面接口 500。错误日志显示 `pymysql.err.OperationalError: (1054, "Unknown column 'p.custom_field1' in 'field list'")`。
**根因:** 部署脚本只迁移了硬编码的订单表新增列(待提数量、未到货数等),未同步 products 表的自定义列和 dashboard_logs 的新列,导致生产/云端数据库缺列。
**修复:** 对比测试环境与生产环境全库结构,找出缺失列并纯加列(不动数据):
- `products`:custom_field1~5(varchar(500))
- `dashboard_logs`:page、field(varchar(100))
已在 11.79 生产 和 云端 82.156.135.91 执行 ALTER TABLE 补列。
**验证:**
- 生产 `GET /api/planning/list` 恢复 200(未登录返回 401 JSON 属正常鉴权)
- 云端接口同样恢复 200
- 服务进程正常(生产 gunicorn 4 worker 监听 18888)