You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong IP address in docker swarm join command generated in "Add Node" #4517
Note: i also checked dokploy container env, ADVERTISE_ADDR is correct there
Current vs. Expected behavior
Current behavior:
The UI generates the docker swarm join command using an IP address determined by getLocalServerIp() (for the local server) or server.ipAddress from the database (for a remote server). getLocalServerIp() runs ip addr show and returns the first private IP address found on any network interface, which may not match the actual Docker Swarm advertise address. This produces an incorrect join command that will fail when the worker tries to connect to the manager.
Expected behavior:
The UI should generate the docker swarm join command using the IP address that Docker Swarm itself is already advertising. This information is available from docker.swarmInspect() (already called in the same addWorker/addManager procedure in cluster.ts). The IP should be taken from the swarm inspect result (e.g., RemoteAddr or ListenAddr) instead of being independently re-determined by a separate method.
Affected code:
apps/dokploy/server/api/routers/cluster.ts, procedures addWorker and addManager (lines ~80–141).
Provide environment information
Dokploy version: v0.29.5
Ubuntu 22
Which area(s) are affected? (Select all that apply)
Local Development, Installation
Are you deploying the applications where Dokploy is installed or on a remote server?
This is a duplicate of #4504[1]. The root cause is confirmed: getLocalServerIp() runs ip addr showinside the Dokploy container, so it picks up the overlay network IP (e.g., 10.0.1.x) rather than the host's actual Swarm advertise address.
The fix should replace the IP detection in apps/dokploy/server/api/routers/cluster.ts (~line 100) with one of:
process.env.ADVERTISE_ADDR — already set correctly in the Dokploy service spec (simplest option).
docker.swarmInspect() — already called in the same procedure; manager addresses are available in the result.
Parse output of docker swarm join-token worker via the Docker socket.
Workaround for now: manually replace the IP in the generated command with the correct one (visible via docker swarm join-token worker on the host).
@rem-aster This bug appears to still be present. A previous PR (#2650) attempted a fix by updating getLocalServerIp(), but the current implementation still runs ip addr showinside the Dokploy container[1] — which is exactly the problem you're hitting. It grabs the first private IP from any interface, which inside the container ends up being the overlay network IP rather than the host's actual swarm advertise address.
Your issue is a duplicate of #4504, which reported the same root cause and symptoms.
A PR would definitely be welcome! The cleanest fix would likely be to use process.env.ADVERTISE_ADDR (already available in the container) as the preferred source for the IP in the addWorker/addManager procedures in cluster.ts, falling back to the current detection only if that env var isn't set. Alternatively, extracting the manager address from the docker.swarmInspect() result (which is already called in those procedures) would also work reliably.
Activity
dosubot commentedon May 30, 2026
This is a duplicate of #4504 [1]. The root cause is confirmed:
getLocalServerIp()runsip addr showinside the Dokploy container, so it picks up the overlay network IP (e.g.,10.0.1.x) rather than the host's actual Swarm advertise address.The fix should replace the IP detection in
apps/dokploy/server/api/routers/cluster.ts(~line 100) with one of:process.env.ADVERTISE_ADDR— already set correctly in the Dokploy service spec (simplest option).docker.swarmInspect()— already called in the same procedure; manager addresses are available in the result.docker swarm join-token workervia the Docker socket.Workaround for now: manually replace the IP in the generated command with the correct one (visible via
docker swarm join-token workeron the host).To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
rem-aster commentedon May 30, 2026
@dosu what is the current status of this bug? Should i submit a PR?
dosubot commentedon May 30, 2026
@rem-aster This bug appears to still be present. A previous PR (#2650) attempted a fix by updating
getLocalServerIp(), but the current implementation still runsip addr showinside the Dokploy container [1] — which is exactly the problem you're hitting. It grabs the first private IP from any interface, which inside the container ends up being the overlay network IP rather than the host's actual swarm advertise address.Your issue is a duplicate of #4504, which reported the same root cause and symptoms.
A PR would definitely be welcome! The cleanest fix would likely be to use
process.env.ADVERTISE_ADDR(already available in the container) as the preferred source for the IP in theaddWorker/addManagerprocedures incluster.ts, falling back to the current detection only if that env var isn't set. Alternatively, extracting the manager address from thedocker.swarmInspect()result (which is already called in those procedures) would also work reliably.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.