[Help Needed] Upload failures (503) and Traefik routing errors with official docker-compose.override.yml.example configuration #602
Replies: 4 comments 1 reply
-
|
Hi @benmilan26 — first off, apologies for the two-week silence. We didn't see this: we work mostly out of the Issues tab and the Discussions thread slipped past us. Thanks for your patience, and for the detailed report — there are actually two separate things going on here. 1. Traefik routingYou don't route to the backend at all, and you don't need two services. The frontend container (nginx) is the single entry point — it serves the app and already reverse-proxies services:
frontend:
networks: [traefik, default] # must share Traefik's network
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.picpeak.rule=Host(`gallery.example.com`)"
- "traefik.http.routers.picpeak.entrypoints=websecure"
- "traefik.http.routers.picpeak.tls.certresolver=letsencrypt"
- "traefik.http.services.picpeak.loadbalancer.server.port=80"
networks:
traefik:
external: trueRemove all Traefik labels from the backend service and delete the 2. The intermittent 503s after a batch or twoThat part is almost certainly RAM. With 2 vCPU / 2 GB, image processing (sharp/libvips) plus Postgres + Redis + Node can exhaust memory; the backend gets OOM-killed, the health check fails, and Traefik returns 503 until it's back — which matches the "works, then degrades, then recovers" pattern. To confirm: docker stats
docker inspect picpeak-backend --format '{{.State.OOMKilled}}'
dmesg | grep -i oomMitigations: add swap, upload in smaller batches, and ideally bump to ≥4 GB. Could you share |
Beta Was this translation helpful? Give feedback.
-
|
Hi Benedikt — picking this up. Both new failure modes are the same root cause Luca named (RAM), just presenting as 400 in one window and 503 in the other. Nothing else is going on. Why 400 in batch A, 503 in batch BBoth come from the backend getting OOM-killed by the upload-processor. The difference is when relative to the request:
So both halves point to memory headroom during sharp/libvips decode, not request shape or upload size. Confirming this in 30 secondsLuca already gave you the three commands; can you run them on the next failure? They're conclusive — no guessing: # 1 = backend was killed by the kernel
docker inspect picpeak-backend --format '{{.State.OOMKilled}}'
# kernel ring buffer — "out of memory" / "Killed process" lines
sudo dmesg | grep -i -E 'killed|out of memory'
# watch this while uploading a batch
docker stats picpeak-backendIf What to do right now (still on stable v3.44)In your UPLOAD_PROCESSOR_CONCURRENCY=1Restart with Additionally:
What's coming on the next stablePR #630 (merged to beta yesterday, currently
Release-please will cut the next stable from beta shortly — at that point an upgrade plus the env var will give you the same behaviour automatically. If you can run those three diagnostic commands once and confirm Closing the doc gap on the Traefik side too — your report is going to be the example case in the deployment guide. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @the-luap, I completed a diagnostic cycle comparing behavior with and without UPLOAD_PROCESSOR_CONCURRENCY=1. 1. Test Without CONCURRENCY=1 (Default)Symptom: Uploads frequently failed with 400 Bad Request on batches >15-30 images dependig image size. Thumbnails returned massive 503 errors. $ docker inspect picpeak-backend --format '{{.State.OOMKilled}}'
false
$ sudo dmesg | grep -i "killed"
(no output)Observation: The backend did not crash or restart. It became unresponsive (SSH timeouts, hanging requests), but the process remained alive. 2. Test With UPLOAD_PROCESSOR_CONCURRENCY=1Symptom: Stability improved significantly. I successfully uploaded 200+ images across multiple batches. Intermittent 503 errors still occurred at the very end of heavy loads, but no total system freeze. $ docker inspect picpeak-backend --format '{{.State.OOMKilled}}'
falseResource Usage: Peak RAM usage was ~1.3GB (~33% of limit) when issues persisted, confirming we are not hitting a hard memory ceiling that triggers a kill. ConclusionHigh concurrency = Event loop starvation → Timeouts (503) / Rejections (400) without crashing. Best regards, |
Beta Was this translation helpful? Give feedback.
-
|
Hi Benedikt — excellent diagnostic. You're right and I was wrong about the mechanism. Where my fix still helps + what I got wrong
For reference: #630 is currently in beta ( The residual 503s at the end of heavy loadsEven with 1.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
networking, docker and selfhosting itself are unfamiliar fields for myself. I came so far with trial and error and some help of a LLM (lumo by proton and qwen 2.5). Installation and this report are coauthored by AI.
I am experiencing reaccuring issues with my picpeak installation and need some help on how to proceed. I followed the official documentation as far as my understanding allowed me to.
My Environment:
OS: Ubuntu (Infomaniak VPS 2vCPU 2GB RAM, latest version)
Docker Compose: v5.1.4
Traefik: v3.6 (external proxy in network traefik_proxy)
PicPeak: Stable Channel (ghcr.io/the-luap/picpeak/backend:stable)
The Problem:
Configuration Used:
I followed the official documentation and used docker-compose.override.yml.example as a template for my docker-compose.override.yml. This includes:
Traefik Errors:
Frontend Errors:
What I Have Verified:
My Questions:
Is the port 3001 in the documentation correct, or should it be 3000 for traefik service labels? (suggested by Lumo and qwen)
Is defining two separate services (picpeak-api and picpeak-media) in the docker-compose.override.yml.example intended for a single backend container setup? (added suggestion bei lumo by proton)
What is the recommended configuration for Traefik v3.6 with the PicPeak stable channel?
Should I modify the docker-compose.override.yml to use a different service structure, or is there a configuration issue I am missing?
Attached Files:
I appreciate any guidance on how to proceed. Thank you for your help!
Benedikt
added:
Observed Behavior (Intermittent Failure): The issue is not consistent; it follows a distinct pattern:
Initial Success: Immediately after starting the containers or after a period of inactivity, the first few upload attempts succeed, and thumbnails load correctly.
Degradation: After a short period (usually after processing 1-2 batches of images), the system begins to fail.
Failure Mode: Subsequent uploads result in the browser error "Some files could not be uploaded," and thumbnail requests return 503 Service Unavailable.
Temporary Recovery: Sometimes, waiting a few minutes or refreshing the page temporarily restores functionality for a short time, but the cycle repeats.
docker-compose.production.yml
docker-compose.override.yml
traefik_error_logs.txt
verification_logs.txt
frontend logs.txt
backend_logs.txt
Beta Was this translation helpful? Give feedback.
All reactions