From 8ce3b7ca6c5400060aadae867290527a40014188 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 14 Aug 2026 15:23:11 +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 610dfc4..daff7dd 100644 --- a/cmd/cli/cli.go +++ b/cmd/cli/cli.go @@ -855,7 +855,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 {