fix(mcp): create SQLite parent dir so first service start succeeds #100

Merged
Claude-Run merged 1 commit from fix/YT-42-mcp-sqlite-parent-dir into main 2026-07-05 19:00:05 +02:00
Member

db::open's create_if_missing(true) creates the SQLite database file but not its parent directory, so a fresh yt mcp service install on a host without ~/.local/share/youtrack-cli/ crash-looped with code: 14 unable to open database file until systemd's start limit tripped.

Fix both layers (defense in depth): db::open now ensures the parent directory of any file-backed SQLite URL exists before connecting, and the installer creates it at install time so permission errors surface during install rather than on first boot. The path is parsed out of the URL via the shared youtrack_mcp::parent_dir_for_url (sqlx's own get_filename resolution), so a --database-url override is honored and in-memory URLs (:memory:, mode=memory) are skipped.

#YT-42

`db::open`'s `create_if_missing(true)` creates the SQLite database file but not its parent directory, so a fresh `yt mcp service install` on a host without `~/.local/share/youtrack-cli/` crash-looped with `code: 14 unable to open database file` until systemd's start limit tripped. Fix both layers (defense in depth): `db::open` now ensures the parent directory of any file-backed SQLite URL exists before connecting, and the installer creates it at install time so permission errors surface during install rather than on first boot. The path is parsed out of the URL via the shared `youtrack_mcp::parent_dir_for_url` (sqlx's own `get_filename` resolution), so a `--database-url` override is honored and in-memory URLs (`:memory:`, `mode=memory`) are skipped. #YT-42
fix(mcp): create SQLite parent dir so first service start succeeds
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m13s
Create release / Create release from merged PR (pull_request) Has been skipped
141bc38e25
`db::open`'s `create_if_missing(true)` creates the SQLite database file but not its parent directory, so a fresh `yt mcp service install` on a host without `~/.local/share/youtrack-cli/` crash-looped with `code: 14 unable to open database file` until systemd's start limit tripped.

Fix both layers (defense in depth): `db::open` now ensures the parent directory of any file-backed SQLite URL exists before connecting, and the installer creates it at install time so permission errors surface during install rather than on first boot. The path is parsed out of the URL via the shared `youtrack_mcp::parent_dir_for_url` (sqlx's own `get_filename` resolution), so a `--database-url` override is honored and in-memory URLs (`:memory:`, `mode=memory`) are skipped.

#YT-42
Claude-Run deleted branch fix/YT-42-mcp-sqlite-parent-dir 2026-07-05 19:00:06 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/youtrack-cli!100
No description provided.