← 리포트 목록
ops_multiagent DB integrity 반복 경보 근본원인 추적·복구
2026-04-24
ops
[ops, sqlite, drift-recovery, db-integrity, hermes]
결론
~/.openclaw/data/ops_multiagent.db 자체 손상은 없었다. 반복된 DB integrity issues: 1은 drift-recovery가 optional DB인 ~/Documents/New project/.agentfirm/state.db 접근 실패(authorization denied)를 ops DB 무결성 문제로 합산한 오탐이었다.
수정 후 수동 실행에서 DB integrity issues: 0 확인.
실측 진단
| 항목 | 결과 |
|---|---|
sqlite3 ~/.openclaw/data/ops_multiagent.db "PRAGMA integrity_check;" |
ok |
PRAGMA quick_check |
ok |
| journal mode | wal |
| WAL/SHM | ops_multiagent.db-wal 0B, -shm 32768B |
| 파일 락 | 재확인 시 active holder 없음 |
scripts/check_ops_db.py |
Schema/FK OK, 구조 손상 없음. 단, 오래된 bus_commands queued 20건은 별도 큐 위생 이슈로 탐지됨 |
| drift-recovery 로그 | 04-22 00:00부터 04-24 00:00까지 agentfirm: authorization denied 직후 DB integrity issues: 1 반복 |
로그 근거:
2026-04-22 00:00:01 [ERROR] DB 점검 실패 (agentfirm): authorization denied
2026-04-22 00:00:01 [INFO] DB integrity issues: 1
...
2026-04-24 00:00:02 [ERROR] DB 점검 실패 (agentfirm): authorization denied
2026-04-24 00:00:02 [INFO] DB integrity issues: 1
수정 후:
2026-04-24 09:34:01 [INFO] DB integrity issues: 0
2026-04-24 09:34:01 [INFO] === drift-recovery 완료 (점검 완료: 이슈 0건, 복구 0건 (성공 0)) ===
12시간 주기 잡 확인
현재 jobs.json에서 12시간 주기 후보:
| 위치 | job | expr | enabled | ops DB 쓰기 판단 |
|---|---|---|---|---|
~/.openclaw/cron/jobs.json |
twitter-collector |
0 0,12 * * * |
false | 코드상 shared.db 사용, 현재 disabled |
~/.openclaw/cron/jobs.json |
channel-collector |
30 0,12 * * * |
false | 현재 disabled, ops DB 직접쓰기 근거 없음 |
~/.hermes/cron/jobs.json |
직접 12h 후보 없음 | - | - | 반복 로그의 주체는 drift-recovery 자체 |
판정: 동시 쓰기 충돌/미닫힘 트랜잭션이 아니라 drift-recovery의 DB 분류 로직 문제. 12시간 간격은 충돌 주기가 아니라 drift-recovery 실행 주기다.
백업
필수 백업 생성 완료:
/Users/ron/.openclaw/data/ops_multiagent.db.bak-20260424-fix/Users/ron/.hermes/workspace/scripts/ops/drift_recovery.py.bak-db-integrity-20260424/Users/ron/.openclaw/workspace/scripts/ops/drift_recovery.py.bak-db-integrity-20260424/Users/ron/.openclaw/scripts/ops/drift_recovery.py.bak-db-integrity-20260424- Hermes cron 백업:
/Users/ron/.hermes/cron/jobs.json.bak-ops-db-monitor-20260424
수정 내역
수정 파일:
/Users/ron/.hermes/workspace/scripts/ops/drift_recovery.py/Users/ron/.openclaw/workspace/scripts/ops/drift_recovery.py/Users/ron/.openclaw/scripts/ops/drift_recovery.py
내용:
ops_multiagent는 required DB,agentfirm은 optional DB로 명시.authorization denied,Operation not permitted,Permission denied류 optional DB 예외는permission_denied로 분류.DB integrity issues집계는 required DB의corrupted/error만 포함.- optional DB 접근 문제는 보고서의
DB 경고(비치명)섹션으로 분리. - 기존 DB 접근은
shared.db.db_connection경로 유지.
다음 12h 사이클 모니터링
추가 스크립트:
/Users/ron/.hermes/workspace/scripts/ops/ops_db_next_cycle_monitor.py
Hermes cron 등록:
- id:
ocMON-ops-db-integrity-next-cycle - schedule:
5 0,12 * * * - next run:
2026-04-24T12:05:00+09:00 - 목적: 00:00/12:00 drift-recovery 직후
PRAGMA integrity_check와 최근 로그의DB integrity issues: [1-9]재발 여부 확인
모니터 초기 수동 실행:
{"status":"PASS","db":{"integrity":"ok","journal_mode":"wal","wal_bytes":0,"shm_bytes":32768},"ok_log_hits":2,"bad_log_hits":0}
결과 누적 파일:
/Users/ron/knowledge-agent/400-reports/260424_ops_db_next_cycle_monitor.md
검증
| 검증 | 결과 |
|---|---|
py_compile drift_recovery 3개 파일 |
통과 |
| optional DB permission-denied 모의 테스트 | permission_denied, db_issues=0 |
| drift-recovery 수동 실행 | exit 0, DB integrity issues: 0 |
PRAGMA integrity_check |
ok |
PRAGMA quick_check |
ok |
| monitor 수동 실행 | PASS |
| Hermes cron job 등록 | active, next run 2026-04-24 12:05 KST |
남은 리스크
scripts/check_ops_db.py는 구조 손상이 아니라 오래된bus_commandsqueued 20건을 별도 이슈로 계속 잡는다. 이번 반복 경보의 원인은 아니므로 DB 직접 정리는 하지 않았다.crontab -l,ps aux는 현재 실행 컨텍스트에서Operation not permitted가 발생한다. drift-recovery는 Hermes cron status를 보조 authoritative 소스로 사용 중이다.
자체평가
- 정확성: 5/5 — 실제 손상과 오탐을 분리했고 반복 로그 원인을 코드 경로로 확인.
- 완성도: 4.5/5 — 수정·백업·모니터까지 완료. 오래된 queued 20건은 범위 밖으로 남김.
- 검증: 5/5 — PRAGMA, py_compile, 수동 실행, 모의 permission test, monitor 실행 완료.
- 최소 변경: 4.5/5 — drift-recovery DB 분류와 모니터 스크립트만 추가.
종합: 4.75/5
DONE