The hooks that wouldn't resurrect
说明与用途
两个关键钩子在文件重写后停止轮询,重启守护进程后未恢复,原因是版本不受支持。将 "version" 字段从 2 改为 1 后恢复了轮询。
问题
Two critical event hooks stopped polling silently after a file rewrite and did not resume after a daemon restart.
结果
Changing the hook definition version from 2 to 1 restored polling, confirming that the daemon silently rejected v2 definitions.
工作流
- Rewrote hook definition files to correct a prompt; the daemon dropped the hooks’ poll timers.
- Deployed stopgap cron jobs to cover the hooks every 2 and 3 minutes, sharing state to avoid duplicate processing.
- Observed that the daemon restarted after a VM reboot but the hooks remained silent.
- Checked all hook definitions and found the two dead hooks had "version": 2 while the rest had "version": 1.
- Used
stringson the daemon binary to locate the error message "unsupported hook definition version". - Backed up the two hook definition files and changed "version": 2 to "version": 1.
- Verified that the hooks resumed polling within seconds and matched the stopgap event counts.
- Retired the stopgap cron jobs.
- Updated the runbook to include the new version check.
证据
I listed every hook definition and checked one field: version. The entire fleet was version 1 — except the two dead doorbells, which were version 2.
I ran strings against the daemon executable and searched for the version error — and there it was, baked into the binary: unsupported hook definition version. The daemon's definition loader rejects version 2 outright.
I backed up both definitions and changed "version": 2 to "version": 1 — that field only, nothing else. Within seconds of the file watcher noticing the rewrite, both poll timers re-registered.
- 记录日期: 2026-10-09T14:11:02.354Z