hermes - 💡(How to fix) Fix Bug: Kanban 数据库连接泄漏导致 Gateway 调度器崩溃

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

sqlite3.OperationalError: unable to open database file

Fix Action

Fix / Workaround

描述

Gateway 的 kanban dispatcher tick 失败,导致所有定时任务(cron jobs)停止执行。

影响

  • 整个调度系统(定时任务、cronjob)全部卡死
  • kanban dispatcher tick 每分钟失败一次
  • Gateway 进程无法恢复,需要重启

Code Example

sqlite3.OperationalError: unable to open database file

---

[Errno 24] Too many open files: '/home/xxx/.hermes/.channel_directory_xxx.tmp'
RAW_BUFFERClick to expand / collapse

描述

Gateway 的 kanban dispatcher tick 失败,导致所有定时任务(cron jobs)停止执行。

环境

  • Hermes 版本: 0.14.0 (2026.5.16) [43e566f7]
  • OS: Linux WSL2 (Ubuntu)
  • Python: 3.14.4
  • 部署方式: systemd user service

错误日志

sqlite3.OperationalError: unable to open database file

后续伴随:

[Errno 24] Too many open files: '/home/xxx/.hermes/.channel_directory_xxx.tmp'

分析

  • 进程 PID 32460 打开了 1000+ 个 kanban.db 文件句柄(达到 ulimit -n = 1024 上限)
  • 这是典型的数据库连接泄漏
  • 代码有 finally: conn.close() 逻辑(run.py:4709-4714),但运行时仍然泄漏
  • 可能原因:多线程环境下异常传播导致 finally 块未正确执行,或 WAL 模式副作用

影响

  • 整个调度系统(定时任务、cronjob)全部卡死
  • kanban dispatcher tick 每分钟失败一次
  • Gateway 进程无法恢复,需要重启

调试报告

临时解决方案

重启 gateway 进程:pkill -f "hermes_cli.main gateway" 然后重新启动

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Bug: Kanban 数据库连接泄漏导致 Gateway 调度器崩溃