Skip to content

fix(traefik): Attempt to fix possible fsnotify problems with traefik and config#8116

Merged
rfay merged 5 commits into
mainfrom
20260206_rename_test
Feb 9, 2026
Merged

fix(traefik): Attempt to fix possible fsnotify problems with traefik and config#8116
rfay merged 5 commits into
mainfrom
20260206_rename_test

Conversation

@rfay

@rfay rfay commented Feb 7, 2026

Copy link
Copy Markdown
Member

The Issue

Since DDEV v1.25.0, Traefik configuration changes were not reliably detected on Rancher Desktop and occasionally on other Docker providers, causing intermittent test failures. The root may have been cross-container fsnotify propagation issues: when a temporary container copied files into a Docker volume that the router container was watching, Traefik's fsnotify would not reliably detect the changes.

How This PR Solves The Issue

1. Direct Copy to Router Container

Instead of using a temporary container to copy Traefik configuration files into a Docker volume, this PR copies files directly to the running router container using CopyIntoContainer(). This ensures file changes happen inside the container that's watching, making Traefik's fsnotify reliably detect the changes.

2. Test Improvements

Enhanced TestCustomProjectTraefikConfig to handle port conflict situation, as in https://buildkite.com/ddev/macos-rancher-desktop/builds/2220#019c35c7-6a58-4806-87ee-7811d76558bf/L12162

  • Added PowerOff() before test to ensure clean port state
  • Checks actual assigned ports after app start
  • Skips test if ephemeral ports (33000+) are assigned due to conflicts (common on Rancher Desktop)
  • This prevents test failures when standard ports 80/443 are unavailable

4. Test Renaming

Renamed test from TestCustomProjectConfig to TestCustomProjectTraefikConfig for clarity.

Automated Testing Overview

Modified Tests:

  • TestCustomProjectTraefikConfig - Now handles port conflicts gracefully with PowerOff() and port detection
  • Added skip logic for when ephemeral ports are assigned

@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown

rfay and others added 4 commits February 6, 2026 20:28
…y issues

Instead of using a temporary container to copy Traefik configuration files
into a Docker volume (which the router container watches), copy files
directly to the running router container using CopyIntoContainer.

This solves fsnotify propagation issues where Traefik doesn't reliably
detect configuration changes written by a different container, particularly
on Rancher Desktop and sometimes Docker Desktop. By copying directly to the
router, file changes happen inside the container that's watching, ensuring
Traefik's fsnotify reliably detects the changes.

Benefits:
- Fixes intermittent test failures on Rancher Desktop
- More reliable across all Docker providers
- Faster (no temporary container creation/destruction)
- Simpler (no need for marker files, sleep delays, or API polling)

Falls back to the volume copy approach if the router isn't running yet.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ts are used

When port conflicts occur (common on Lima-based Docker providers like Rancher
Desktop, Colima), DDEV allocates ephemeral ports instead of standard 80/443.
This test assumes standard ports when modifying Traefik configuration, so it
should skip when non-standard ports are detected.

The test now checks the actual router ports after starting the app and skips
if they're not 80/443, avoiding failures when port conflicts force ephemeral
port allocation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rfay rfay changed the title test(rename): Better test name and skip on Rancher fix(traefik): Attempt to fix possible fsnotify problems with traefik and config Feb 7, 2026
@rfay rfay changed the title fix(traefik): Attempt to fix possible fsnotify problems with traefik and config fix(traefik): Attempt to fix possible fsnotify problems with traefik and config Feb 7, 2026
@rfay rfay marked this pull request as ready for review February 7, 2026 14:38
@rfay rfay requested a review from a team as a code owner February 7, 2026 14:38
@rfay rfay requested a review from stasadev February 7, 2026 14:38

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I tested it with Podman locally (because it's sensitive to UID permissions).

@rfay rfay merged commit 4a08a2c into main Feb 9, 2026
52 of 54 checks passed
@rfay rfay deleted the 20260206_rename_test branch February 9, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants