[GH-ISSUE #5074] Noodle and Character gallery showing broken image icon #2808

Closed
opened 2026-10-21 05:55:58 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Images are in data/gallery/characters/, but only showing broken image icon in Noodle and Character image gallery. NoodleR, RP image generation work as normally as expected.
A bug report write up from professor mari:

Title: Stale dist build — gallery recovery service missing character & persona image recovery
Description

Character gallery images and Noodle timeline images show as broken image icons. The image files exist on disk at data/gallery/characters//, but the serving route (GET /api/characters/:id/gallery/file/:filename) returns 404 because there are no matchingcharacter_imagesDB rows.

The gallery recovery service (gallery-recovery.ts) is supposed to recreate orphaned DB records at startup, and thesourcealready contains the character and persona recovery logic. However, thebuilt distfile is stale and only contains the original chat-image recovery loop.

NoodleR images are unaffected because they use a separate media endpoint (/api/noodle/noodler/posts/:postId/media) that serves directly from its own namespace without DB lookups.
Root cause

Source (src/services/storage/gallery-recovery.ts)
Dist (dist/services/storage/gallery-recovery.js)

Lines
174
54

Chat recovery
✅ lines 22–68
✅ lines 14–45

Character recovery
✅ lines 70–118
❌ missing

Persona recovery
✅ lines 120–168
❌ missing

Schema imports
chatImages, chats, characterImages, characters, personaImages, personas(line 12)
chatImages, chatsonly (line 5)

The dist build was not regenerated after the character and persona recovery loops were added to the source. Sincedist/is gitignored, this is invisible in the repo but affects any install running from a stale build.
Steps to reproduce

  1. Have character gallery image files on disk underdata/gallery/characters//with no correspondingcharacter_imagesDB rows (e.g. after a DB reset, migration, or manual file copy).
  2. Start the server (which runs fromdist/).
  3. Observe that character card gallery and Noodle timeline images show broken image icons.
  4. NoodleR timeline images load fine (separate endpoint, no DB dependency).
    Expected behavior

The startup recovery pass should scandata/gallery/characters/anddata/gallery/personas/, verify the owner entity still exists, and recreate missingcharacter_images/persona_imagesDB rows — matching the logic already present in the source file.
Actual behavior

Onlydata/gallery//directories are scanned. The characters/and personas/subdirectories are ignored, so orphaned character and persona gallery images never get their DB rows recreated. The serving route 404s on every request.

Relevant files
• packages/server/src/services/storage/gallery-recovery.ts— source (correct, 174 lines)
• packages/server/dist/services/storage/gallery-recovery.js— built dist (stale, 54 lines)
• packages/server/src/routes/characters.routes.ts:1596–1619— gallery file serving route (DB lookup → 404 if no row)
• packages/server/src/services/image/gallery-file-lifecycle.ts:80–85—findGalleryRowByFilename(the DB lookup that fails)
• packages/server/src/app.ts:148— whererecoverGalleryImagesis called at startup

Originally created by @ghost on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5074 Originally assigned to: @SpicyMarinara on GitHub. Images are in data/gallery/characters/<character-id>, but only showing broken image icon in Noodle and Character image gallery. NoodleR, RP image generation work as normally as expected. A bug report write up from professor mari: Title: Stale dist build — gallery recovery service missing character & persona image recovery Description Character gallery images and Noodle timeline images show as broken image icons. The image files exist on disk at data/gallery/characters/<character-id>/, but the serving route (GET /api/characters/:id/gallery/file/:filename) returns 404 because there are no matchingcharacter_imagesDB rows. The gallery recovery service (gallery-recovery.ts) is supposed to recreate orphaned DB records at startup, and thesourcealready contains the character and persona recovery logic. However, thebuilt distfile is stale and only contains the original chat-image recovery loop. NoodleR images are unaffected because they use a separate media endpoint (/api/noodle/noodler/posts/:postId/media) that serves directly from its own namespace without DB lookups. Root cause Source (src/services/storage/gallery-recovery.ts) Dist (dist/services/storage/gallery-recovery.js) Lines 174 54 Chat recovery ✅ lines 22–68 ✅ lines 14–45 Character recovery ✅ lines 70–118 ❌ missing Persona recovery ✅ lines 120–168 ❌ missing Schema imports chatImages, chats, characterImages, characters, personaImages, personas(line 12) chatImages, chatsonly (line 5) The dist build was not regenerated after the character and persona recovery loops were added to the source. Sincedist/is gitignored, this is invisible in the repo but affects any install running from a stale build. Steps to reproduce 1. Have character gallery image files on disk underdata/gallery/characters/<character-id>/with no correspondingcharacter_imagesDB rows (e.g. after a DB reset, migration, or manual file copy). 2. Start the server (which runs fromdist/). 3. Observe that character card gallery and Noodle timeline images show broken image icons. 4. NoodleR timeline images load fine (separate endpoint, no DB dependency). Expected behavior The startup recovery pass should scandata/gallery/characters/anddata/gallery/personas/, verify the owner entity still exists, and recreate missingcharacter_images/persona_imagesDB rows — matching the logic already present in the source file. Actual behavior Onlydata/gallery/<chat-id>/directories are scanned. The characters/and personas/subdirectories are ignored, so orphaned character and persona gallery images never get their DB rows recreated. The serving route 404s on every request. Relevant files • packages/server/src/services/storage/gallery-recovery.ts— source (correct, 174 lines) • packages/server/dist/services/storage/gallery-recovery.js— built dist (stale, 54 lines) • packages/server/src/routes/characters.routes.ts:1596–1619— gallery file serving route (DB lookup → 404 if no row) • packages/server/src/services/image/gallery-file-lifecycle.ts:80–85—findGalleryRowByFilename(the DB lookup that fails) • packages/server/src/app.ts:148— whererecoverGalleryImagesis called at startup
Author
Owner

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

Reinstall and restart ME.

<!-- gh-comment-id:5303361455 --> @SpicyMarinara commented on GitHub (Aug 15, 2026): Reinstall and restart ME.
Author
Owner

@ghost commented on GitHub (Aug 15, 2026):

Done, still having issue after, also tried clean install, and same thing. Started happening a couple updates ago

<!-- gh-comment-id:5304294554 --> @ghost commented on GitHub (Aug 15, 2026): Done, still having issue after, also tried clean install, and same thing. Started happening a couple updates ago
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#2808
No description provided.