Skip to content

fix(ddev-router): only show Traefik ERR (not WRN) as config problems, fixes #8102 - #8125

Merged
rfay merged 3 commits into
ddev:mainfrom
jonesrussell:20250210_fsd42_traefik_wrn_not_errors_8102
Feb 11, 2026
Merged

rfay merged 3 commits into
ddev:mainfrom
jonesrussell:20250210_fsd42_traefik_wrn_not_errors_8102

Conversation

@jonesrussell

Copy link
Copy Markdown
Contributor

The Issue

With debug logging enabled in ~/.ddev/traefik (e.g. static_config.loglevel.yaml), Traefik emits many WRN (warning) lines. These were captured into the router error file and shown as "Warning: There are router configuration problems" on ddev start and "Detected configuration error(s)" on ddev list, which is noisy and misleading.

How This PR Solves The Issue

  • In containers/ddev-traefik-router/monitor-traefik-stderr.sh, only lines containing Traefik ERR (error level) are appended to /tmp/ddev-traefik-errors.txt; WRN (warning) and debug lines are no longer written there (they still appear in ddev logs ddev-router).
  • ERR is matched as a word (\bERR\b) to avoid false positives.
  • Healthcheck-generated "WARNING: ..." lines are unchanged (written by the healthcheck script, not the monitor).
  • Docs updated to state that only ERR is shown as router configuration problems; WRN/debug remain in router logs.

Manual Testing Instructions

  1. Copy ~/.ddev/traefik/static_config.loglevel.yaml.example to ~/.ddev/traefik/static_config.loglevel.yaml to enable debug logging.
  2. Run ddev poweroff && ddev start (and optionally ddev list).
  3. Confirm that Traefik WRN lines (e.g. encoded-characters note, "No domain found in rule" SNI messages) no longer appear under "Warning: There are router configuration problems" / "Detected configuration error(s)".
  4. Confirm WRN lines still appear in ddev logs ddev-router.
  5. Optionally introduce a real Traefik config error and confirm ERR lines still appear as router configuration problems.

Automated Testing Overview

No new tests. Existing Traefik router Bats tests assert on healthcheck-written lines in the error file (e.g. "WARNING: Router count mismatch"), which are unchanged. The monitor script change only affects which Traefik log lines are written to the file.

Release/Deployment Notes

Router image is rebuilt and distributed with DDEV releases; no extra deployment steps. Users with debug logging enabled will see fewer false "router configuration problems" after upgrading.

…dev#8102

## The Issue

- Fixes ddev#8102

With debug logging enabled in ~/.ddev/traefik (e.g. static_config.loglevel.yaml), Traefik emits many WRN (warning) lines. These were captured into the router error file and shown as "Warning: There are router configuration problems" on `ddev start` and "Detected configuration error(s)" on `ddev list`, which is noisy and misleading.

## How This PR Solves The Issue

- In `containers/ddev-traefik-router/monitor-traefik-stderr.sh`, only lines containing Traefik **ERR** (error level) are appended to `/tmp/ddev-traefik-errors.txt`; **WRN** (warning) and debug lines are no longer written there (they still appear in `ddev logs ddev-router`).
- ERR is matched as a word (`\bERR\b`) to avoid false positives.
- Healthcheck-generated "WARNING: ..." lines are unchanged (written by the healthcheck script, not the monitor).
- Docs updated to state that only ERR is shown as router configuration problems; WRN/debug remain in router logs.

## Manual Testing Instructions

1. Copy `~/.ddev/traefik/static_config.loglevel.yaml.example` to `~/.ddev/traefik/static_config.loglevel.yaml` to enable debug logging.
2. Run `ddev poweroff && ddev start` (and optionally `ddev list`).
3. Confirm that Traefik WRN lines (e.g. encoded-characters note, "No domain found in rule" SNI messages) no longer appear under "Warning: There are router configuration problems" / "Detected configuration error(s)".
4. Confirm WRN lines still appear in `ddev logs ddev-router`.
5. Optionally introduce a real Traefik config error and confirm ERR lines still appear as router configuration problems.

## Automated Testing Overview

No new tests. Existing Traefik router Bats tests assert on healthcheck-written lines in the error file (e.g. "WARNING: Router count mismatch"), which are unchanged. The monitor script change only affects which Traefik log lines are written to the file.

## Release/Deployment Notes

Router image is rebuilt and distributed with DDEV releases; no extra deployment steps. Users with debug logging enabled will see fewer false "router configuration problems" after upgrading.

Co-authored-by: Cursor <[email protected]>
@jonesrussell
jonesrussell requested review from a team as code owners February 10, 2026 05:21
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Feb 10, 2026

@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.

Thank you!

I pushed a new image and fixed the non-working check for ERR:

-if echo "$line" | grep -qE '\bERR\b'; then
+if echo "$line" | sed -r 's/\x1B\[[0-9;]*m//g' | grep -qw 'ERR'; then

To check what's actually is going to be ignored:

  1. Go to https://github.dev/traefik/traefik
  2. Search for Warn().Msg

Looks good to me.

@github-actions

Copy link
Copy Markdown

@stasadev stasadev changed the title fix: only show Traefik ERR (not WRN) as router config problems, fixes #8102 fix(ddev-router): only show Traefik ERR (not WRN) as config problems, fixes #8102 Feb 10, 2026

@rfay rfay 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.

It's great, code is good. Manually tested using ~/.ddev/traefik/custom-global-config with broken config and got error output still.

@rfay
rfay merged commit 552990e into ddev:main Feb 11, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traefik debug logging shows up as errors in ddev start and ddev list

3 participants