Skip to content

[Docker] Some uploads return 500 error when viewing the image URL #116

@BenAChilds

Description

@BenAChilds

Hi there,
Love the project. It's exactly what I was looking for to suit my needs.

However, I spun it up in Docker and began uploading images which I needed to embed elsewhere. I found that, while the images uploaded successfully and were viewable in the Picsur UI, some refused to load on the remote website (while others were fine).
Today, I began to look into this. I found that the ones which were not loading on the remote website would throw an error when I attempted to download them from the Picsur UI. When I copied their Image URLs to a new tab, the server threw a 500 error:

{"success":false,"statusCode":500,"timestamp":"2025-03-25T22:58:55.214Z","timeMs":727,"data":{"type":"internal","message":"Worker closed"}}

I went back and looked at the browser Console, after refreshing and trying again, these errors populated:

Image

I updated the container to use PICSUR_PRODUCTION: false environment var as I found in another issue, but this yielded no further logging. the following was output to the Docker logs:

[Nest] 18  - 03/25/2025, 11:20:45 PM VERBOSE [SharpWrapper28352] Worker 28352 initialized with 15000ms timeout and 512MB memory limit
[Nest] 18  - 03/25/2025, 11:20:45 PM    WARN [SharpWrapper28352] Worker error: Error: VipsJpeg: Insufficient memory (case 4)
    at Sharp.toBuffer (/picsur/node_modules/.pnpm/sharp@0.33.5/node_modules/sharp/lib/output.js:163:17)
    at UniversalSharpOut (file:///picsur/backend/dist/workers/sharp/universal-sharp.js:49:18)
    at SharpWorker.finish (file:///picsur/backend/dist/workers/sharp/sharp.worker.js:62:34)
    at SharpWorker.messageHandler (file:///picsur/backend/dist/workers/sharp/sharp.worker.js:34:18)
    at process.emit (node:events:519:28)
    at emit (node:internal/child_process:951:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
[Nest] 18  - 03/25/2025, 11:20:45 PM VERBOSE [SharpWrapper28352] Worker 28352 exited with code 1 and signal null
[Nest] 18  - 03/25/2025, 11:20:45 PM   ERROR [MainExceptionFilter] (192.168.1.124 -> GET /i/da6929ba-8151-4ada-8613-11513cddd5e0.jpg) InternalFailure: Worker closed
[Nest] 18  - 03/25/2025, 11:20:45 PM   DEBUG [MainExceptionFilter] Error: Worker closed
    at Fail (file:///picsur/shared/dist/types/failable.js:165:46)
    at SharpWrapper.finish (file:///picsur/backend/dist/workers/sharp.wrapper.js:112:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ImageConverterService.convertStill (file:///picsur/backend/dist/managers/image/image-converter.service.js:98:24)
    at async file:///picsur/backend/dist/managers/image/image.service.js:112:35

I'm running Picsur in Docker on TrueNAS, with a Ryzen 3600X and 64GB RAM (the latter of which is not the issue - there is plenty available for the container, and it's the exact same images every time that fail).

I hope we can get to the bottom of this, because I'd love to contribute to this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions