mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5512] Automatic-backup failure path can hard-exit the server via unhandledRejection #3063
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#3063
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 @kolacheee on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5512
Originally assigned to: @kolacheee on GitHub.
Found while auditing #5506 for paths that could silently kill the Termux server.
runAutomaticBackupIfDueis invoked from an hourly timer asvoid runAutomaticBackupIfDue(). Its catch block itself awaitsloadAutomaticBackupSettings/saveAutomaticBackupSettings(packages/server/src/routes/backup.routes.ts:3325-3328on staging). If a backup fails and the settings write in the catch also throws (disk full is the realistic case — the same condition that fails backups), the rejection escapes thevoidtimer call and reaches the process-fatalunhandledRejectionhandler (packages/server/src/index.ts:70-75), which callsprocess.exit(1).Consequences: the whole server hard-exits from a background timer, and on Termux
start-termux.shhas no restart loop, so the instance stays down. This is the only timer-driven path found in the audit where a rejection can escape to the fatal handler — every other scheduler/watchdog routes into a catch.Fix shape: wrap the settings-save inside the catch in its own try/catch (log and continue). Only affects installs with automatic backup enabled (off by default).
@SpicyMarinara commented on GitHub (Aug 25, 2026):
@kolacheee I am taking the minimal implementation into one release-hardening PR against staging now, using the fix boundaries from your audit. I will keep your diagnosis credited in the PR and avoid expanding scope beyond the four verified paths.