From bda6c29f3ec0d811136c2496d81bb5e9d3ac9398 Mon Sep 17 00:00:00 2001 From: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com> Date: Sat, 24 Oct 2026 12:17:01 +0000 Subject: [PATCH] config: clarify the 'no matching creation rules found' error Fixes #1061 When a subcommand is mistyped (e.g. 'sops updateKeys' instead of 'updatekeys'), the argument is treated as a file path and the user only sees 'error loading config: no matching creation rules found', which suggests a config problem even though the config was parsed successfully. State that the config was parsed fine, include the file path, and hint that a mistyped subcommand is treated as a file path. Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com> --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 511df1bc15..6a141a970c 100644 --- a/config/config.go +++ b/config/config.go @@ -599,7 +599,7 @@ func parseCreationRuleForFile(conf *configFile, confPath, filePath string, kmsEn } if rule == nil { - return nil, fmt.Errorf("error loading config: no matching creation rules found") + return nil, fmt.Errorf("error loading config: no matching creation rules found for file %q; the config file was parsed successfully, so check whether the path is correct and matches a creation rule (a mistyped subcommand, e.g. 'updateKeys' instead of 'updatekeys', is treated as a file path)", filePath) } config, err := configFromRule(rule, kmsEncryptionContext)