Ticket: 502 Error on Docker Container Registration Submission

@nahtnam Just created a ticket
Question: I am trying to install the docker container. I can load up the UI and I see the registration page, but when I try to submit, I get a 502 error. Anyone else experiencing this?
Attempted: Scrolling through the logs I get this error: Error: listen EADDRINUSE: address already in use :::5000] Backend failed to start on port 5000, just not sure how to fix it
Working On: Docker
Using Postiz On: docker image + separate postgres + redis, no errors connecting to both
Take it from here @Postiz
3 Replies
nahtnam
nahtnam2w ago
It's weird that the UI loads with no problem. I see the next.js server starting in the logs, as well as the logs for nestjs which is what fails to start. These are my env vars
BACKEND_INTERNAL_URL=http://localhost:3000
DATABASE_URL=...
FRONTEND_URL=https://postiz.mydomain.com
IS_GENERAL=true
JWT_SECRET=...
MAIN_URL=https://postiz.mydomain.com
NEXT_PUBLIC_BACKEND_URL=https://postiz.mydomain.com/api
NEXT_PUBLIC_UPLOAD_DIRECTORY=/uploads
REDIS_URL=...
STORAGE_PROVIDER=local
UPLOAD_DIRECTORY=/uploads
BACKEND_INTERNAL_URL=http://localhost:3000
DATABASE_URL=...
FRONTEND_URL=https://postiz.mydomain.com
IS_GENERAL=true
JWT_SECRET=...
MAIN_URL=https://postiz.mydomain.com
NEXT_PUBLIC_BACKEND_URL=https://postiz.mydomain.com/api
NEXT_PUBLIC_UPLOAD_DIRECTORY=/uploads
REDIS_URL=...
STORAGE_PROVIDER=local
UPLOAD_DIRECTORY=/uploads
Nevo David
Nevo David2w ago
LimeWire
Download 2025-01-24 07-20-30.mp4 | LimeWire
Download 2025-01-24 07-20-30.mp4 on LimeWire
nahtnam
nahtnam2w ago
Thanks I will watch it Confirmed: - My backend is running, /api redirects to /auth - I only expose 5000 - No CORS error, the endpoint is actually failing I wonder if maybe it's trying to somehow connect to postiz.mydomain.com:3000? But I don't think the env vars are configured like that https://postiz.mydomain.com/api/auth returns bad gateway {"level":"error","ts":1737796170.2270298,"logger":"http.log.error","msg":"dial tcp [::1]:3000: connect: connection refused","request":... I do see
2025-01-25T03:00:27.020904720Z [Nest] 152 - 01/25/2025, 3:00:27 AM LOG ;5;3m[NestFactory] Starting Nest application...
...
2025-01-25T03:00:29.607593485Z [Nest] 153 - 01/25/2025, 3:00:29 AM LOG ;5;3m[NestApplication] Nest application successfully started;5;3m +103ms
2025-01-25T03:00:29.611574744Z [Nest] 153 - 01/25/2025, 3:00:29 AM ERROR ;5;3m[NestApplication] Error: listen EADDRINUSE: address already in use :::5000;5;3m +4ms
2025-01-25T03:00:29.611588910Z [Nest] 153 - 01/25/2025, 3:00:29 AM ERROR ;5;3m[Error: listen EADDRINUSE: address already in use :::5000] Backend failed to start on port 5000
2025-01-25T03:00:27.020904720Z [Nest] 152 - 01/25/2025, 3:00:27 AM LOG ;5;3m[NestFactory] Starting Nest application...
...
2025-01-25T03:00:29.607593485Z [Nest] 153 - 01/25/2025, 3:00:29 AM LOG ;5;3m[NestApplication] Nest application successfully started;5;3m +103ms
2025-01-25T03:00:29.611574744Z [Nest] 153 - 01/25/2025, 3:00:29 AM ERROR ;5;3m[NestApplication] Error: listen EADDRINUSE: address already in use :::5000;5;3m +4ms
2025-01-25T03:00:29.611588910Z [Nest] 153 - 01/25/2025, 3:00:29 AM ERROR ;5;3m[Error: listen EADDRINUSE: address already in use :::5000] Backend failed to start on port 5000
@Nevo David I fixed it by setting the env var PORT=3000, for some reason nestjs was starting on port 5000 (could be a coolify default or something)

Did you find this page helpful?