You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bb-app start retries unrecoverable managed-server startup failures indefinitely. During a disk-full incident, each failed start also attempted to create another diagnostic JSON file, leaving hundreds of empty files on the filesystem that had already run out of space. Repeated failures should back off, stop after a bounded number of attempts, and preserve stderr evidence when diagnostic writes fail.
Versions and environment
bb-app 0.42.1, npm installation, running under a Linux systemd user unit with Restart=always.
Ubuntu 24.04.4 LTS, Linux 6.8.0-138-generic, Node v22.23.2.
The incident installation included an unrelated protocol-181 skill-discovery backport. The affected launcher and diagnostic code were unchanged from the release base.
Source patch tested against 4ae0a7c893e9922721e0e367c72aa3a1a2990e7c and backported onto the deployed source lineage. No provider session is needed to trigger the failure.
Steps to reproduce
Use an unprivileged account and an isolated data directory; do not fill a real disk. An inaccessible SQLite path plus unwritable logs exercises the unrecoverable-startup path:
bb.db is deliberately a directory, so SQLite cannot open it as a database. Choose unused ports. On an affected build, interrupt the continuing supervisor with Ctrl-C after observing repeated failures. Restore the fixture directory's permissions with chmod 700 "$repro_dir/data/logs" afterward.
Evidence scope: the original disk-full behavior below was recorded during the incident. The isolated commands were executed against the packaged fix in #3339; that run verifies the corrected failure path, not a new unpatched disk-full replay. A real full filesystem was not recreated.
Expected vs actual
The incident investigation recorded 78 restart attempts in five minutes and 980 total before the user unit was stopped. The interval stayed roughly 3.5 seconds. The resulting process-server-startupFailure-*.json files were all zero bytes.
The underlying error was available in the journal:
SqliteError: disk I/O error
at Database.pragma (better-sqlite3/lib/methods/pragma.js:10:27)
Expected: capped exponential backoff, a terminal state after repeated failures, bounded diagnostic retention, atomic diagnostic publication, and the underlying error on stderr even if storage is unavailable. An external service manager must respect that terminal state instead of restarting the supervisor immediately.
SQLite errors reached stderr and the unwritable logs directory contained zero diagnostic files. The source suite passed 83 launcher tests and 22 process-utils tests, with both typechecks. Separate tests cover the five-per-process/kind retention cap and cleanup after failed writes/renames. All executed PR CI checks passed, including Linux and macOS package smoke.
Disk cleanup restores immediate service but does not fix the unbounded retry or diagnostic-writing behavior.
A systemd restart delay alone does not govern the child retry loop inside bb-app start.
Suggested priority
Reliability bug: an unrecoverable storage failure can produce sustained restart and diagnostic-write churn. The original service was restored; #3339 addresses the recurring failure behavior.
Summary
bb-app startretries unrecoverable managed-server startup failures indefinitely. During a disk-full incident, each failed start also attempted to create another diagnostic JSON file, leaving hundreds of empty files on the filesystem that had already run out of space. Repeated failures should back off, stop after a bounded number of attempts, and preserve stderr evidence when diagnostic writes fail.Versions and environment
bb-app0.42.1, npm installation, running under a Linux systemd user unit withRestart=always.4ae0a7c893e9922721e0e367c72aa3a1a2990e7cand backported onto the deployed source lineage. No provider session is needed to trigger the failure.Steps to reproduce
Use an unprivileged account and an isolated data directory; do not fill a real disk. An inaccessible SQLite path plus unwritable logs exercises the unrecoverable-startup path:
bb.dbis deliberately a directory, so SQLite cannot open it as a database. Choose unused ports. On an affected build, interrupt the continuing supervisor with Ctrl-C after observing repeated failures. Restore the fixture directory's permissions withchmod 700 "$repro_dir/data/logs"afterward.Evidence scope: the original disk-full behavior below was recorded during the incident. The isolated commands were executed against the packaged fix in #3339; that run verifies the corrected failure path, not a new unpatched disk-full replay. A real full filesystem was not recreated.
Expected vs actual
The incident investigation recorded 78 restart attempts in five minutes and 980 total before the user unit was stopped. The interval stayed roughly 3.5 seconds. The resulting
process-server-startupFailure-*.jsonfiles were all zero bytes.The underlying error was available in the journal:
Expected: capped exponential backoff, a terminal state after repeated failures, bounded diagnostic retention, atomic diagnostic publication, and the underlying error on stderr even if storage is unavailable. An external service manager must respect that terminal state instead of restarting the supervisor immediately.
Evidence
The fixed package's isolated Linux run recorded delays of 1, 2, 4, 8, 16, 32, and 60 seconds, followed by:
With
Restart=alwaysandRestartPreventExitStatus=75, systemd reported:SQLite errors reached stderr and the unwritable logs directory contained zero diagnostic files. The source suite passed 83 launcher tests and 22 process-utils tests, with both typechecks. Separate tests cover the five-per-process/kind retention cap and cleanup after failed writes/renames. All executed PR CI checks passed, including Linux and macOS package smoke.
What was ruled out
bb-app start.Suggested priority
Reliability bug: an unrecoverable storage failure can produce sustained restart and diagnostic-write churn. The original service was restored; #3339 addresses the recurring failure behavior.