mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6083] [Issue]: Full backups include storage/.writer-lease/owner.json, which blocks startup after a manual restore #3374
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#3374
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/6083
Summary
Download Backup and the automatic backup archive
storage/.writer-lease/owner.json, the per-process writer lease record. It is runtime state, not user data. Restoring the archive by hand (the "raw filesystem backup for manual recovery" described in the archive's ownRESTORE.txt) carries the stale lease into the new data folder, and on another machine the server refuses to start until the user deletes the directory.Expected behavior
The backup omits
storage/.writer-lease/entirely, the same way the launcher's update snapshot already does since #6056 ("Nothing in the lease is user data, so leave the directory out entirely"). A restored data folder starts cleanly.Actual behavior
Every full backup written on 2.4.5 contains
<root>/storage/.writer-lease/owner.json(verified on a real Download Backup). After copying the folders back on a different machine, startup fails with:The lease reclaim logic only treats a record as stale when it can prove the same host (machine ID, Termux home, or local-storage proof) and a different boot, a dead PID, or a refused liveness socket. A record written on another machine never qualifies, by design, so the documented "move to a new device" restore always ends in this error. A community user restoring a backup by hand hit exactly this and had to delete the directory before the server would start.
Steps to reproduce
marinara-backup-<timestamp>/storage/.writer-lease/owner.jsonis present.Environment
staging,9bf5baaf0)Logs, screenshots, or video
See the startup error quoted above.
Additional context
Why this matters even though Import Profile is the expected restore path: the manual copy is the fallback the archive itself advertises in
RESTORE.txt, and it is the only way back in whenever the in-app import cannot be used, for example an install too broken to reach Settings, a version whose importer rejects the archive (as happened with the.nativemarkers before #5587, and happens today with backups over 2 GiB, which the current upload cap rejects before inspecting them), or a migration to a machine that has not run Marinara yet. A backup that only restores cleanly through the importer is a weaker backup than the docs promise.collectDirectoryZipSourcesinpackages/server/src/routes/backup.routes.tswalks every directory inBACKUP_DIRS, includingstorage, and keeps every regular file. The lease'slive.sockis skipped only because it is a socket, soowner.jsonis the one file that leaks. A one-line exclusion of.writer-leasein that walk (mirroringscripts/protect-launcher-data.mjs) would close it. The in-app Import Profile path is not affected, because it merges tables from the profile manifest and never copiesstorage/raw files.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SonaGat3 commented on GitHub (Sep 12, 2026):
Working on a PR for this.