Vault Plugin: Fix incorrect error logging#21590
Open
prashantkumar1982 wants to merge 2 commits intodevelopfrom
Open
Vault Plugin: Fix incorrect error logging#21590prashantkumar1982 wants to merge 2 commits intodevelopfrom
prashantkumar1982 wants to merge 2 commits intodevelopfrom
Conversation
Contributor
|
I see you updated files related to
|
Contributor
|
✅ No conflicts with other open PRs targeting |
cedric-cordenier
previously approved these changes
Mar 18, 2026
|
cedric-cordenier
approved these changes
Mar 18, 2026
jmank88
approved these changes
Mar 19, 2026
| return | ||
| } | ||
|
|
||
| l.Errorw(msg, keysAndValues...) |
Contributor
There was a problem hiding this comment.
Logging from a helper can be problematic because the caller info is wrong. There is a logger func Helper to offset the stack though
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.





Vault plugin request validation paths were logging expected user input failures as errors. In particular, observeGetSecretsRequest() can return newUserError("key does not exist"), but the caller logged it with Errorw, which creates noisy error logs for normal user mistakes.
This change downgrades userError cases to debug logs while preserving error-level logging for actual internal failures. The same behavior is now applied consistently across get/create/update/delete handling in both observation and state-transition code paths, so user-facing validation failures still propagate back in responses but no longer appear as server errors in logs.
I used Codex for the fix.
My prompt:
`In folder chainlink, file core/services/ocr2/plugins/vault/plugin.go, line 526 is error log saying this:
failed to observe get secret request item
However the method that returns error, observeGetSecretsRequest() could return a user error too.
We want to not log an error log if the return was a user error. Instead do a debug log.
Specifically the error returned is this: newUserError("key does not exist")
Could you fix that, and also fix other similar pattern in this same file?`