AdguardTeam/AdGuardHome · error
committing transaction: %w
Error message
committing transaction: %w
What it means
bbolt failed to commit the write transaction that persisted removals of expired/invalid sessions during startup load. The commit happened because processSessions removed at least one stale session (removed > 0).
Source
Thrown at internal/aghuser/sessionstorage.go:181
if bkt == nil {
return nil
}
removed, err := ds.processSessions(ctx, bkt)
if err != nil {
return fmt.Errorf("processing sessions: %w", err)
}
if removed == 0 {
ds.logger.DebugContext(ctx, "loading sessions from db", "stored", len(ds.sessions))
return nil
}
needRollback = false
err = tx.Commit()
if err != nil {
return fmt.Errorf("committing transaction: %w", err)
}
ds.logger.DebugContext(
ctx,
"loading sessions from db",
"stored", len(ds.sessions),
"removed", removed,
)
return nil
}
// processSessions iterates over the sessions bucket and loads or removes
// sessions as needed.
func (ds *DefaultSessionStorage) processSessions(
ctx context.Context,
bkt *bbolt.Bucket,
) (removed int, err error) {View on GitHub (pinned to b41aefbe51)
Solutions
- Check disk space on the volume holding sessions.db (df -h) and free space
- Verify the database file still exists and is writable by the service user
- If the file was replaced mid-startup, restart the service after the replacement settles
- Run filesystem checks if I/O errors persist
Example fix
# before # df shows 100% on /var # after # free space, then restart the service
Defensive patterns
Strategy: retry
Validate before calling
if avail := diskFree(sessionsDir); avail < minRequiredBytes { return fmt.Errorf("low disk: %d free", avail) } Try / catch
if err := ds.loadSessions(ctx); err != nil {
if errors.Is(err, syscall.ENOSPC) { free space; retry startup }
} Prevention
- Monitor disk space on the data volume
- Keep sessions.db on a volume with headroom alerts
When it happens
Trigger: tx.Commit fails after invalid sessions were deleted: underlying I/O error on the database file (disk full, ENOSPC), file removed underneath the process, or the transaction was already rolled back/closed.
Common situations: Disk-full conditions in the data directory; the sessions file deleted or replaced while the app was starting; hardware/filesystem errors on the volume holding the db.
Related errors
- loading sessions: %w
- starting transaction: %w
- opening database: %w
- opening a transaction: %w
- opening transaction: %w
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/d67ffe543dd6713a.
Report an issue: GitHub.