[GH-ISSUE #5619] [Issue]: Profile backup restore fails on the seeder's own game-assets .native marker #3113

Closed
opened 2026-10-21 05:59:42 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Romuromylus on GitHub (Aug 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5619

Originally assigned to: @Romuromylus on GitHub.

Summary

Restoring a full profile backup on a fresh Termux install fails with Import failed: Profile asset game-assets/sprites/.native is not a supported image file. The .native file is an empty directory marker that Marinara's own game-asset seeder writes into every bundled asset directory; profile export archives those directories verbatim, and the 2.4.4 import asset validation then rejects the marker as a bad image and aborts the entire restore.

Expected behavior

A profile archive produced by Marinara's own export restores cleanly, including the game-assets/ directories the seeder manages.

Actual behavior

Import stops at the first .native marker under a validated image prefix (game-assets/sprites/, game-assets/backgrounds/ behave the same way) and the whole restore fails. For a user who reset their device and only has the backup, this reads as data loss.

Steps to reproduce

  1. On any install that has the bundled game assets seeded (so game-assets/sprites/.native exists), export a full profile archive.
  2. Reset or use a fresh install and import that archive via Settings → Imports → Import Profile (JSON/ZIP).
  3. The import fails with Profile asset game-assets/sprites/.native is not a supported image file.

Environment

  • Marinara Engine version: 2.4.4 (build 2.4.4+1a299369ac70)
  • Install type: termux
  • OS + version: Server: Android / Termux 6.1.157-android14-11 (arm64); Client: Android 10
  • Browser or app shell: Chrome 151 Mobile

Logs, screenshots, or video

Client toast and Imports panel show: Profile import failed — Profile asset game-assets/sprites/.native is not a supported image file. Server log during the same import also emits repeated [backup] Profile import hydration exceeded 512 MiB after table messages; heap=~455-471 MiB warnings from the near-limit memory watchdog (warnings only; heap stayed at ~471/1120 MiB — not the failure cause).

Additional context

Root cause pairing: ensureNativeMarkers in packages/server/src/db/seed-game-assets.ts writes an empty .native marker per bundled directory; packages/server/src/services/import/profile-import-assets.ts validates every staged file under game-assets/sprites/ and game-assets/backgrounds/ as an image and throws on the marker. The fix should tolerate exactly this marker on import (empty, dot-prefixed, never served as media) while keeping the image validation for everything else.

Reported on Discord by TheMoochingHobo (thread: "profile backup import fails after Termux reset"), 2026-08-29.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Aug 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5619 Originally assigned to: @Romuromylus on GitHub. ## Summary Restoring a full profile backup on a fresh Termux install fails with `Import failed: Profile asset game-assets/sprites/.native is not a supported image file.` The `.native` file is an empty directory marker that Marinara's own game-asset seeder writes into every bundled asset directory; profile export archives those directories verbatim, and the 2.4.4 import asset validation then rejects the marker as a bad image and aborts the entire restore. ## Expected behavior A profile archive produced by Marinara's own export restores cleanly, including the `game-assets/` directories the seeder manages. ## Actual behavior Import stops at the first `.native` marker under a validated image prefix (`game-assets/sprites/`, `game-assets/backgrounds/` behave the same way) and the whole restore fails. For a user who reset their device and only has the backup, this reads as data loss. ## Steps to reproduce 1. On any install that has the bundled game assets seeded (so `game-assets/sprites/.native` exists), export a full profile archive. 2. Reset or use a fresh install and import that archive via Settings → Imports → Import Profile (JSON/ZIP). 3. The import fails with `Profile asset game-assets/sprites/.native is not a supported image file.` ## Environment - Marinara Engine version: 2.4.4 (build 2.4.4+1a299369ac70) - Install type: termux - OS + version: Server: Android / Termux 6.1.157-android14-11 (arm64); Client: Android 10 - Browser or app shell: Chrome 151 Mobile ## Logs, screenshots, or video Client toast and Imports panel show: `Profile import failed — Profile asset game-assets/sprites/.native is not a supported image file.` Server log during the same import also emits repeated `[backup] Profile import hydration exceeded 512 MiB after table messages; heap=~455-471 MiB` warnings from the near-limit memory watchdog (warnings only; heap stayed at ~471/1120 MiB — not the failure cause). ## Additional context Root cause pairing: `ensureNativeMarkers` in `packages/server/src/db/seed-game-assets.ts` writes an empty `.native` marker per bundled directory; `packages/server/src/services/import/profile-import-assets.ts` validates every staged file under `game-assets/sprites/` and `game-assets/backgrounds/` as an image and throws on the marker. The fix should tolerate exactly this marker on import (empty, dot-prefixed, never served as media) while keeping the image validation for everything else. Reported on Discord by TheMoochingHobo (thread: "profile backup import fails after Termux reset"), 2026-08-29. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:59:42 +07:00
Author
Owner

@Romuromylus commented on GitHub (Aug 29, 2026):

Fixed by PR #5587, squash-merged into staging as 04bf2d110. Profile import now tolerates exactly the game-asset seeder's empty .native directory markers under game-assets/ while still rejecting any non-empty file using the marker name, so a stock profile export restores cleanly on a fresh install. Covered by new cases in the profile-import-asset-security regression. The reporter's backup should import on the next staging build.

<!-- gh-comment-id:5459706096 --> @Romuromylus commented on GitHub (Aug 29, 2026): Fixed by PR #5587, squash-merged into staging as 04bf2d110. Profile import now tolerates exactly the game-asset seeder's empty `.native` directory markers under `game-assets/` while still rejecting any non-empty file using the marker name, so a stock profile export restores cleanly on a fresh install. Covered by new cases in the profile-import-asset-security regression. The reporter's backup should import on the next staging build.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3113
No description provided.