Skip to content

fix(docker): tolerate Docker 403 on network connect when already connected#114

Open
rdemeritt wants to merge 2 commits into
mainfrom
fix/network-connect-already-connected
Open

fix(docker): tolerate Docker 403 on network connect when already connected#114
rdemeritt wants to merge 2 commits into
mainfrom
fix/network-connect-already-connected

Conversation

@rdemeritt
Copy link
Copy Markdown
Member

Summary

  • Docker Desktop returns HTTP 403 (not 409) with "endpoint with name ... already exists in network" when a container is already a member of the target network
  • dockerNetworkConnect only tolerated 409, so the 403 propagated and aborted route provisioning — causing every deploy to fail with Docker proxy error 403
  • Fix: detect the specific 403 message and treat it as the existing 409 no-op (container already connected → continue)
  • Real proxy-denied 403s (different message or no message) still propagate as errors

Root cause trace

Deploy triggered
→ provisionTraefikRouteForCompose discovers container
→ dockerNetworkConnect('coolify', containerId)
  → Docker returns 403 {"message":"endpoint … already exists in network coolify"}
  → was thrown → route file never written → deploy error shown in UI

Test plan

  • Deploy cantaconmigo from localhost:9080/sites/d6cbjlrcw092dfy5fwx4p0md — no error
  • API logs show already on coolify network — OK then route written
  • cantaconmigo.hh still resolves after re-deploy
  • Proxy-denied 403 (unmanaged container) still propagates as error

rdemeritt added 2 commits May 9, 2026 22:48
127.0.0.1:9080:9080 causes ERR_EMPTY_RESPONSE on macOS Docker Desktop —
TCP handshake completes but data transfer silently drops. Binding to all
interfaces (9080:9080) resolves host-level access to the HermitHost UI.
…ected

Docker Desktop returns 403 with 'already exists in network' when a
container is already a member of the target network. Previously this was
treated as a proxy denial and the whole route provision aborted. Detect
this specific message and treat it as the existing 409 no-op path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant