Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
8.58k stars 424 forks source link

service dokploy-postgres already exists #597

Open isaced opened 1 week ago

isaced commented 1 week ago

To Reproduce

Install through the official docker-compose script

Current vs. Expected behavior

When I restart the server, the dokploy container cannot start properly.

The dokploy-postgres container actually exists, but an error is reported: Main Server Error Error: (HTTP code 409) unexpected - rpc error: code = AlreadyExists desc = name conflicts with an existing object: service dokploy-postgres already exists

docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS         PORTS                                                                      NAMES
cf9cfe52ace5   traefik:v3.1.2           "/entrypoint.sh trae…"   2 minutes ago   Up 2 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   dokploy-traefik.1.lhyp7yowa3f48miclt0y476jh
97012415530d   postgres:16              "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:32769->5432/tcp, [::]:32769->5432/tcp                              dokploy-postgres.1.kjfyqkvgf13j48k06fptq26jb
4906c1aebb80   dokploy/dokploy:latest   "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                  dokploy.1.mwzblqgxj17yj64hgcn6h47sx
1324a013bc9b   redis:7                  "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:32768->6379/tcp, [::]:32768->6379/tcp                              dokploy-redis.1.livj7oywjs190q1clo0zltgiy
docker logs 4906c1aebb80

> dokploy@v0.10.2 start /app
> node -r dotenv/config dist/server.mjs

Default middlewares already exists
Network is already initilized
Main config already exists
Default traefik config already exists
Main Server Error Error: (HTTP code 409) unexpected - rpc error: code = AlreadyExists desc = name conflicts with an existing object: service dokploy-postgres already exists
    at /app/node_modules/.pnpm/docker-modem@5.0.3/node_modules/docker-modem/lib/modem.js:382:17
    at getCause (/app/node_modules/.pnpm/docker-modem@5.0.3/node_modules/docker-modem/lib/modem.js:417:7)
    at Modem.buildPayload (/app/node_modules/.pnpm/docker-modem@5.0.3/node_modules/docker-modem/lib/modem.js:378:5)
    at IncomingMessage.<anonymous> (/app/node_modules/.pnpm/docker-modem@5.0.3/node_modules/docker-modem/lib/modem.js:346:16)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  reason: undefined,
  statusCode: 409,
  json: {
    message: 'rpc error: code = AlreadyExists desc = name conflicts with an existing object: service dokploy-postgres already exists'
  }
}

Provide environment information

Operating System:
  OS: Ubuntu 24.04
  Arch: x86_64

Dokploy version: v0.10.2
VPS Provider: Alibaba Cloud

Which area(s) are affected? (Select all that apply)

Docker / Application

Additional context

I had to execute docker service rm dokploy-postgres, and I had to delete dokploy-postgres/dokploy-redis/dokploy-traefik, and then restart the dokploy container for it to work properly.

Siumauricio commented 1 week ago

I did the same steps and I didn't have any issue the containers restarted well and dokploy is accessible again, can you create a video to reproduce?

isaced commented 1 week ago

GitHub cannot upload video files larger than 10MB, so I uploaded the screen recording here.

https://streamable.com/nca1yx

Siumauricio commented 1 week ago

What resources does your machine have?

isaced commented 1 week ago

A 2-core 2G machine with nothing else installed except docker.

Siumauricio commented 1 week ago

is weird, I did the same steps from the video and for me is working,

Siumauricio commented 1 week ago

looking closely it seems that there was a race condition, I do not know if it is due to the performance of your vps, in the video it looks a little slow 🤔