mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6087] [Issue]: Automatic backup writes without checking free space and retries a failed write every hour #3373
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3373
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SonaGat3 on GitHub (Sep 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6087
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The automatic backup writes a full copy of the data folder into
backups/on the same disk without checking that the space exists. When the disk is nearly full the write fails with ENOSPC, the failure is recorded, and one hour later the next tick writes the whole archive again, filling the disk again. The livestorage/tables share that disk.Expected behavior
Before writing, the job checks that the backups folder has at least roughly the size of the previous archive (or of the sources it is about to write) free, plus a margin. If not, it skips the run, records a clear
lastErrorsuch as "Not enough free space for the automatic backup (X free, about Y needed)", and does not thrash the disk on every hourly tick.Actual behavior
writeAutomaticBackupcreatesmarinara-automatic-backup.zip.pendingnext to the previous archive, keeps the previous one until the new one is complete, and only then prunes to the retention count. Peak usage is therefore two full archives plus the retained history. Nothing checks free space first. On ENOSPC the pending file is removed andlastErroris saved, butlastBackupAtis not advanced, sorunAutomaticBackupIfDuetreats the backup as still due and the hourly timer retries the full write. With Automatic backups kept allowed up to 9999 and Daily frequency, retained archives can also grow without bound relative to the disk.Steps to reproduce
Environment
staging,9bf5baaf0)Logs, screenshots, or video
Additional context
No user report yet; found while reviewing the backup code. Node 24 (the minimum in
package.json) exposesfs.promises.statfs, and the server already usesstatfsSyncinpackages/server/src/db/file-backed-store.ts, so a pre-flight check is a few lines inwriteAutomaticBackuporrunAutomaticBackupIfDue.writeFullBackupArchivealready stats every source, so the expected size is available without extra I/O. The retention limit itself and the rotation order look correct and would stay as they are.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Sep 12, 2026):
The translated backup guidance is being published separately to docs-i18n in #6097. The existing implementation and regression work remain in #6088.
@SpicyMarinara commented on GitHub (Sep 12, 2026):
Fixed on staging in #6095.
Automatic backups check the backups volume before writing and leave the previous archive intact when there is insufficient space. A real backup-route regression verifies the error, no partial archive, and a successful retry after space becomes available. Original patch from #6088 is preserved; the translated guide is covered by #6097.