Files
solution-erp/.claude/WAL.md
pqhuy1987 92d8215a62 [CLAUDE] PurchaseEvaluation: YC-028 sự cố prod A/059 — FE tách "404 thật ⟂ lỗi hệ thống" 5 site ×2 app + guard disk/orphan vào runbook+cicd-monitor
Sự cố 2 tầng (đã giải trọn trong phiên, chi tiết runs/2026-08-10-S189-bookstart-open/run.md + WAL):
- T1: ổ C VPS 0 byte (gitea repo-archive 16,49GB + npm-cache SYSTEM 12,76GB) → SQL Error -2
  → "ko duyệt được" rồi FE vẽ mọi lỗi thành "Không tìm thấy phiếu" (#44). Dọn ~30GB cache
  + AUTO_CLOSE OFF ×3 DB + gỡ nén NTFS 4 file template (#88 tái phát).
- T2: 3 sshd mồ côi (lệnh đo ssh bị cắt output) bão hòa 3/3 core → mọi GET detail 5-47s,
  A/059 (5 NCC) vượt trần hủy ~30s của FE. Kill orphan → A/059 47s→0,38s · phiếu bé 0,17s.

Code (5 site cùng lớp, SHA-mirror 4 cặp MATCH, build ×2 xanh):
- lib/apiError.ts +isNotFound(err) — chỉ 404 mới được nói "không tìm thấy"
- PurchaseEvaluationsListPage (inline + overlay + fullpage) + KhkkListPage + KhkkCreatePage:
  detail.isError && !404 → "Hệ thống đang chậm hoặc lỗi khi tải phiếu — thử lại (refetch)"

Ops-guard (YC-028 (4)): cicd-monitor persona +bước 1b server-health (fsutil free <5GB = FAIL,
CPU-delta tìm orphan) · iis-deploy-runbook +§"Disk-free + orphan guard" + sửa path log Serilog
sai (Logs\log-*.txt → logs\solution-erp-*.log, đo thật). (6) đóng: log 10/08 mất do đợt "giải
phóng dung lượng" hôm qua (retention 30 file config đúng). (3B) cron archive_cleanup Gitea +
decompress Vietreport_Master = chờ ngoài giờ (restart service dùng chung VIETREPORT).

Sổ: +YC-028 (nguyên văn + 2 tầng đã xử). Squash wal: trailing theo §5.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 11:25:51 +07:00

34 lines
2.5 KiB
Markdown
Raw 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.

# WAL — auto-generated, không sửa tay
updated: 2026-08-11 | session: S189 (phiên-LOGIC L15, window 1) | branch: main
goal: SỰ CỐ PROD A/059 (YC-028) — ĐÃ GIẢI TRỌN 2 TẦNG: (T1) disk 0-byte do cache automation
(repo-archive 16,49GB + npm-cache 12,76GB) → SQL Error -2 → "ko duyệt được"/#44;
(T2) 3 sshd MỒ CÔI (lệnh đo của lead bị `head` cắt) bão hòa 3/3 core → mọi phiếu 5-47s,
A/059 vượt trần hủy 30s FE. SAU FIX: A/059 47s→0,38s · phiếu bé 0,17s · inbox 0,12s.
chain:
[x] Bookstart L15 TRỌN 12 vai + vá 7 bề mặt → push 9b3c0edb
[x] T1 disk: xóa repo-archive (cache Gitea tự tái tạo) + npm-cache SYSTEM + 567 u_ex cũ (0,73GB)
→ free ~20GB+ · health 200 · AUTO_CLOSE OFF ×3 DB · gỡ nén 4 file template (#88 tái phát;
Vietreport_Master.mdf CÒN NÉN — đang mở, cần offline ~10s, làm ngoài giờ)
[x] T2 CPU: chẩn đoán ASYNC_NETWORK_IO + query [p7] CPU-66ms-elapsed-23,6s → đo CPU-delta bắt
3 sshd orphan 6,3 core-s/5s trên máy 3-core → kill (chừa chain mình) → 0,17-0,41s ×2 lượt.
🔴 BÀI HỌC MỚI: `ssh ... | head` = ĐẺ ORPHAN SPIN phía Windows-OpenSSH — cấm head trên
ssh output dài; recycle pool + đợi cold-start ~48s trước khi đo
[!] Hàng (1)-(6) YC-028 còn: (3B) bật cron archive_cleanup Gitea + decompress Vietreport_Master
[ngoài giờ — restart gitea vài giây] · (4) disk-watch vào cicd-monitor persona + runbook ·
(5) FE tách "lỗi hệ thống"⟂"không tìm thấy" ×2 app + CÂN NHẮC AsSplitQuery cho
GetPurchaseEvaluationQuery:867 (6-include = mìn cartesian khi data lớn) · (6) truy log
20260810 biến mất (đọc Serilog retention — lệnh trước chết vì quoting, chưa có data)
[ ] chờ anh (cũ): (76)(77)(78)(79) · (89) a/b/c · (74) rotate · value_protect · YC-008↔YC-010 ·
YC-025 review GĐ3 · "ổn rồi" mở W8 · tồn (22)(67)(72)
[ ] NEXT-em (cũ, run.md S189): ring5 @open · YC-027 đủ-cửa · regex 🆕 detector · sentinel-truoc-bu ·
reset-doi-het · w7b-inbox-param · gotcha #89 disk+orphan-sshd + RCA error-ledger
next: chạy (4)(5)(6) + gotcha #89; (3B) chờ ngoài giờ. Anh em xác nhận phiếu OK thì báo.
verify:
toc-do: curl (token admin) GET A/059 -> 200 <1s # da do x2 lan
cpu: ssh delta 5s -> chi gitea ~0,3 core # da do sau kill
free: ssh fsutil volume diskfree C: # ~20GB+