From 0db5ee44be340e8c59d045e6c523c1dc9aa8ceba Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 12 Aug 2026 15:43:40 +0700 Subject: [PATCH] cmd/cli: log the config error that rejected a custom config The warning reported err, the resolver-config fetch error, which is nil on every path that reaches it - so a rejected custom config was logged with no reason attached. cfgErr holds the validation failure. --- cmd/cli/cli.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/cli/cli.go b/cmd/cli/cli.go index c1127f5..7dbcbcf 100644 --- a/cmd/cli/cli.go +++ b/cmd/cli/cli.go @@ -903,7 +903,10 @@ func processCDFlags(ctx context.Context, cfg *ctrld.Config) (*controld.ResolverC return resolverConfig, nil } } - mainLog.Load().Warn().Err(err).Msg("Disregarding invalid custom config") + // cfgErr, not err: err is the resolver-config fetch error from above, which is + // nil on every path that reaches here, so logging it said nothing about why the + // custom config was rejected. + mainLog.Load().Warn().Err(cfgErr).Msg("Disregarding invalid custom config") } bootstrapIP := func(endpoint string) string {