[GH-ISSUE #4668] [Issue]: Deleted character avatar files remain in storage #2556

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

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Character avatar files remain in data/avatars after their characters are deleted. This causes orphaned files and unnecessary storage usage.

Expected behavior

Deleting characters, either individually or through Settings > Advanced > Danger Zone, should also remove their associated avatar files from data/avatars.

Actual behavior

Characters are removed from Marinara Engine, but their avatar files remain in data/avatars. The user currently has 103 characters listed in Marinara Engine but 1,101 files in the avatar directory.

Steps to reproduce

  1. Import a character with an avatar.
  2. Delete the imported character.
  3. Inspect the data/avatars directory.
  4. Observe that the deleted character's avatar file remains.
  5. Alternatively, delete all characters through Settings > Advanced > Danger Zone and inspect data/avatars for lingering files.

Environment

  • Marinara Engine version: v2.4.1
  • Install type: docker
  • OS + version: Ubuntu 24.04.4
  • Browser or app shell: Not provided

Logs, screenshots, or video

No logs, screenshots, or video provided.

Additional context

The user initially imported approximately 1,000 characters using the importer while using v2.3.4, then deleted all characters through the Danger Zone. The issue is consistently reproducible with newly imported characters that are immediately deleted.

Discord thread: Character avatar files linger in storage after supposedly being 'deleted'
Discord thread link: https://discord.com/channels/1417099416812392641/1534850503668662414
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (1 message)
[2026-08-06T09:07:56.218Z] Mylan: I was recently browsing my `data` folder to check on storage usage, and found that files in the `data/avatars` directory contains images from characters that are supposed to be deleted already.

When I started using ME with v2.3.4, I initially imported ~1000 characters using your importer. But later I changed my mind and decided I wanted to start fresh, so I deleted all the characters via `Settings > Advanced > Danger Zone`. Now looking into the `data/avatars` directory, I see all of these characters that I thought were deleted, but were lingering instead.

This is not exclusive to deleting via `Danger Zone`. I found that simply importing a new character and immediately deleting it also causes the file to linger. I'm able to reproduce this consistently.

Currently I have 103 characters listed in ME, yet the `data/avatars` directory has 1101 files.

OS: Ubuntu 24.04.4
Install method: Docker
Version: v2.5.1
[Discord message: https://discord.com/channels/1417099416812392641/1534850503668662414/1534850503668662414]

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 @SpicyMarinara on GitHub (Aug 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4668 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Character avatar files remain in `data/avatars` after their characters are deleted. This causes orphaned files and unnecessary storage usage. ## Expected behavior Deleting characters, either individually or through `Settings > Advanced > Danger Zone`, should also remove their associated avatar files from `data/avatars`. ## Actual behavior Characters are removed from Marinara Engine, but their avatar files remain in `data/avatars`. The user currently has 103 characters listed in Marinara Engine but 1,101 files in the avatar directory. ## Steps to reproduce 1. Import a character with an avatar. 2. Delete the imported character. 3. Inspect the `data/avatars` directory. 4. Observe that the deleted character's avatar file remains. 5. Alternatively, delete all characters through `Settings > Advanced > Danger Zone` and inspect `data/avatars` for lingering files. ## Environment - Marinara Engine version: v2.4.1 - Install type: docker - OS + version: Ubuntu 24.04.4 - Browser or app shell: Not provided ## Logs, screenshots, or video No logs, screenshots, or video provided. ## Additional context The user initially imported approximately 1,000 characters using the importer while using v2.3.4, then deleted all characters through the Danger Zone. The issue is consistently reproducible with newly imported characters that are immediately deleted. Discord thread: Character avatar files linger in storage after supposedly being 'deleted' Discord thread link: https://discord.com/channels/1417099416812392641/1534850503668662414 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (1 message)</summary> ```text [2026-08-06T09:07:56.218Z] Mylan: I was recently browsing my `data` folder to check on storage usage, and found that files in the `data/avatars` directory contains images from characters that are supposed to be deleted already. When I started using ME with v2.3.4, I initially imported ~1000 characters using your importer. But later I changed my mind and decided I wanted to start fresh, so I deleted all the characters via `Settings > Advanced > Danger Zone`. Now looking into the `data/avatars` directory, I see all of these characters that I thought were deleted, but were lingering instead. This is not exclusive to deleting via `Danger Zone`. I found that simply importing a new character and immediately deleting it also causes the file to linger. I'm able to reproduce this consistently. Currently I have 103 characters listed in ME, yet the `data/avatars` directory has 1101 files. OS: Ubuntu 24.04.4 Install method: Docker Version: v2.5.1 [Discord message: https://discord.com/channels/1417099416812392641/1534850503668662414/1534850503668662414] ``` </details> ## 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:50:06 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 6, 2026):

Codex is taking this issue on behalf of @SpicyMarinara. Implementation is tracked in draft PR #4669; the fix is scoped to deleting only unreferenced local avatar files from individual and Danger Zone character/persona deletion paths.

<!-- gh-comment-id:5202738069 --> @SpicyMarinara commented on GitHub (Aug 6, 2026): Codex is taking this issue on behalf of @SpicyMarinara. Implementation is tracked in draft PR #4669; the fix is scoped to deleting only unreferenced local avatar files from individual and Danger Zone character/persona deletion paths.
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#2556
No description provided.