Repository navigation
cmd: colored error message in WrapCommandFuncForCobra (#7760) - #7768
Merged
Merged
Conversation
Signed-off-by: Y.Horie <u5.horie@gmail.com>
Member
|
I think this is probably fine but it does sorta mean the error message is a bit less machine readable since it's not just plain text on the final line, but I think that's probably not a big deal. Do you mind taking a screenshot of how it looks for you before and after? Thanks! |
francislavoie
approved these changes
Jun 5, 2026
This was referenced Sep 30, 2026
earthlingdavey
added a commit
to smallhoursorg/motel
that referenced
this pull request
Oct 2, 2026
Caddy v2.11.6 (caddyserver/caddy#7768) routes a command's error through its logger instead of cobra's plain "Error:" line, so off a terminal the message arrives as JSON with its quotes escaped and the fixed-string match missed it. The box still refused the push for the right reason; only the assertion's spelling changed.
cplieger
added a commit
to cplieger/docker-caddy
that referenced
this pull request
Oct 3, 2026
Moves both Caddy pins (the xcaddy builder and the runtime donor) to v2.11.6 together, since the build refuses a version mismatch between them. Caddy v2.11.5 changed how startup errors reach the log (caddyserver/caddy#7768, open bug #7962): a config that fails to load now logs a JSON record instead of a plain "Error:" line, and a file that cannot be read or adapted prints nothing. CaddyStartupFailed matches both shapes. certmagic v0.25.6 changed how many lines a failed attempt logs, which silently moved CaddyCertIssuanceFailed's count threshold. Both cert rules are replaced by CaddyCertManagementFailing, which fires when a subject has a certmagic error and no success for it within an hour, held 15 minutes. The smoke tests read each rule's selector from alerts/logql.yaml and run it against real Caddy output, and the certmagic pin moves to v0.25.6.
jfilter
added a commit
to civico-de/civicrm-standalone-compose
that referenced
this pull request
Oct 12, 2026
Since Caddy 2.11.6, `caddy run` exits 1 on a config error without printing it: CLI errors go through the default logger, which during `run` still points at the startup buffer (caddyserver/caddy#7768; fixed on master by #8180, not yet released). The `caddy:2` tag moved to 2.11.6 on 2026-10-02, so a misspelt name in PUBLIC_PROFILES stopped Caddy with no hint why, and the weekly test failed with "unknown profile stops Caddy: expected '1', got ''" because it looked for Caddy's own "File to import not found" line. The startup script now checks that each profile has a file and names the missing one on stderr before exiting 1, independent of Caddy's logging. The test asserted only the log line, never the exit code. Under `docker compose up` the restart policy hides it: compose reports the crash-looping container as healthy, exits 0, and `compose ps` shows exit code 0 while `docker inspect` shows 1. The check now runs the service once with `docker compose run` and asserts both exit 1 and the message. Measured with the check lines from tests/run.sh against the caddy service: - old check: passes on caddy:2.11.4, fails on caddy:2 (2.11.7) as in CI - new check: passes on caddy:2.11.4 and caddy:2 (2.11.7) - guard removed: fails on both ("unknown profile is named") - guard skips the profile instead of exiting: fails on both ("stops Caddy": exit 124 from the timeout) - valid profiles (all five, and none) still start; shellcheck clean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Assistance Disclosure
I consulted Claude code for the issue, but I coded it myself because it is easy to fix, but Claude helped me to generate some code comments.
Fixes: #7760
WrapCommandFuncForCobra has not colored error messages. So We should wrap error messages with caddy.Log().Error.