Skip to content

fix(traefik): skip empty service reconnect - #5160

Open
bestmaa wants to merge 1 commit into
Dokploy:canaryfrom
bestmaa:codex/fix-5145-traefik-empty-reconnect
Open

fix(traefik): skip empty service reconnect#5160
bestmaa wants to merge 1 commit into
Dokploy:canaryfrom
bestmaa:codex/fix-5145-traefik-empty-reconnect

Conversation

@bestmaa

@bestmaa bestmaa commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • return early when Traefik reconnect finds no isolated Compose deployments
  • avoid calling the local or remote command executor with an empty command
  • add regression coverage for empty and non-empty local/remote reconnect paths

Before

When the Compose query returned [], the existing truthiness guard did not return. The function built an empty command and called:

execAsync("")
execAsyncRemote("server-id", "")

In the Docker regression run, both empty-deployment tests failed and showed those exact calls. In production this surfaces as The argument 'file' cannot be empty while updating the Traefik environment.

After

The function now returns when composeResult.length === 0. Existing local and remote reconnect commands are unchanged when isolated deployments exist.

Test Files  1 passed (1)
Tests       4 passed (4)

Validation

  • Docker focused regression tests: 4 passed
  • Docker unit/integration suite: 98 files, 884 tests passed (the external real-deployment test file was excluded)
  • monorepo TypeScript check: passed
  • Biome check on changed files: passed
  • official Dockerfile build target on Node 24.4.0: passed

Fixes #5145

Greptile Summary

The PR prevents Traefik reconnection from invoking local or remote command executors when no isolated Compose deployments exist.

  • Replaces an ineffective array truthiness check with an explicit empty-result check.
  • Adds regression coverage for empty and populated local and remote reconnect paths.

Confidence Score: 5/5

The PR appears safe to merge, with the empty-result failure corrected while preserving populated local and remote reconnect behavior.

The relational query returns an array, and the new explicit length check prevents empty command execution without changing command generation or executor selection when isolated deployments exist.

Reviews (1): Last reviewed commit: "fix(traefik): skip empty service reconne..." | Re-trigger Greptile

@bestmaa
bestmaa requested a review from Siumauricio as a code owner August 22, 2026 08:03
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

settings.writeTraefikEnv fails when there are no isolated Compose deployments

1 participant