Skip to content

Network Sync relies only on Network Name #5179

Closed

Description

@HPaulson

To Reproduce

  1. Create a new network, and sync Dokploy from the Docker->Networks tab
  2. From command line, delete the network just created
  3. From command line, create a new network with an identical name as the first, but change some option (for example, add --driver overlay --attachable)
  4. In Dokploy, Sync and Verify features pass, even though the network has changed to an overlay, causing key attributes of the network in the Dokploy DB to be incorrect

Example:

hpaulson@home:~$ docker network create example-net
(Sync on Dokploy -> Works as expected)
hpaulson@home:~$ docker network rm example-net
example-net
hpaulson@home:~$ docker network create   --driver overlay   --attachable   example-net
cwwfv5yzidng35xps0pzc7hws
(Sync on Dokploy -> Nothing to sync. Keeps old attributes)

To Fix:
hpaulson@home:~$ docker network rm example-net
example-net
(Sync on Dokploy -> Works as expected, deletes network)
hpaulson@home:~$ docker network create   --driver overlay   --attachable   seismiccore-com-directus
59xc5ojgkl3tdculdd7if9rfw
(Sync on Dokploy -> Works as expected, net network with correct attributes)

Current vs. Expected behavior

Currently: The network attributed are not updated in the Dokploy DB, because the name has been unchanged, and Dokploy did not know it was deleted

Expected: When using the Verify button, Dokploy checks the network IDs, rather than names, to catch delete/re-create

Provide environment information

Linux Ubuntu 24, Dokploy v30.2

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

Docker

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Maybe, need to investigate

Activity

  1. linear-code commented on Aug 24, 2026

    @linear-code
  2. dosubot commented on Aug 24, 2026

    @dosubot

    Hi @HPaulson! I'm Dosu and I'm helping the Dokploy team.

    You've identified the issue correctly. The findNetworksToSync function compares Docker and the DB entirely by name:

    const existingNames = new Set(existing.map((row) => row.name));
    const dockerNames  = new Set(dockerNetworks.map((d) => d.Name));

    A network that was deleted and recreated under the same name won't appear in either the importable or missing sets, so the sync dialog reports everything as in sync even though driver, attachable flag, subnets, etc. may have changed [1].

    The DockerNetworkInfo type also does not include Docker's Id field [2], so there's currently no way to detect a delete/recreate.

    To fix this, the most robust approach would be to compare by Docker network ID — Docker assigns a unique Id to every network. Store that ID in the DB on import, then during sync check whether the stored ID matches the live Docker ID. A name match with an ID mismatch means the network was replaced. The key files involved would be:

    An alternative would be to diff key attributes (driver, attachable, internal, subnets, MTU) on name match, but comparing by Docker ID is more reliable since it catches replacements even when all attributes happen to be identical.

    Happy to help dig into any of those pieces if you decide to send a PR.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dokploy Share Dosu with your team

  3. added a commit that references this issue on Aug 27, 2026
    63efbff
  4. added a commit that references this issue on Oct 24, 2026
    1c66cbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions