Skip to content

Reduce ERROR log spam for expected NoSuchKey responses - #9965

Open
VershaAgrawal wants to merge 1 commit into
noobaa:masterfrom
VershaAgrawal:bugfix-log-flooding
Open

Reduce ERROR log spam for expected NoSuchKey responses#9965
VershaAgrawal wants to merge 1 commit into
noobaa:masterfrom
VershaAgrawal:bugfix-log-flooding

Conversation

@VershaAgrawal

@VershaAgrawal VershaAgrawal commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Describe the Problem

Expected missing-object lookups (e.g. Thanos marker GETs) were treated like failures. Every NoSuchKey / NO_SUCH_OBJECT was logged at ERROR with a full stack.

Explain the Changes

  1. Demote expected missing-object outcomes to quiet dbg.log1 (no stack): NoSuchKey on GET/HEAD in s3_rest.js, and NO_SUCH_OBJECT in rpc.js (_request and _on_request). S3/RPC responses are unchanged (still 404 NoSuchKey); all other errors (auth, NoSuchBucket, internal failures, etc.) continue to log at ERROR with stack.

Issues: Fixed #xxx / Gap #xxx

  1. https://redhat.atlassian.net/browse/DFBUGS-9093

Testing Instructions:

  • Doc added/updated
  • Tests added

Summary by CodeRabbit

  • Bug Fixes
    • Reduced unnecessary error logging for expected missing-object responses from storage and RPC requests.
    • Missing-object errors are now recorded as informational or debug messages without detailed request data or stack traces.
    • Other errors continue to receive detailed logging for troubleshooting.

Signed-off-by: VershaAgrawal <vershaagrawal98@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c65e4d99-a3ae-49ed-b121-363e2a6494ee

📥 Commits

Reviewing files that changed from the base of the PR and between fcb149f and 1c608df.

📒 Files selected for processing (2)
  • src/endpoint/s3/s3_rest.js
  • src/rpc/rpc.js

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change reduces log detail for expected missing-object errors. S3 GET and HEAD NoSuchKey errors use informational logs. RPC NO_SUCH_OBJECT errors use concise debug logs. Other errors keep detailed logging.

Changes

Expected missing-object logging

Layer / File(s) Summary
S3 missing-key logging
src/endpoint/s3/s3_rest.js
S3 XML and HTML handlers log NoSuchKey errors for GET and HEAD requests at informational level. Other errors retain detailed logging.
RPC missing-object logging
src/rpc/rpc.js
RPC request and server handlers log NO_SUCH_OBJECT errors without request parameters or stack traces. Other errors retain detailed logging.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1c608

This localized change reduces noisy error logging for expected missing-object responses while preserving response behavior and error logging for other failures; no actionable merge-blocking risk remains.

Suggested reviewers: naveenpaul1, liranmauda, aayushchouhan09

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: reducing error-log noise for expected NoSuchKey responses.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VershaAgrawal VershaAgrawal changed the title demoted log level log1 instead of error for no such key and object Reduce ERROR log spam for expected NoSuchKey responses Aug 20, 2026
err.stack || err,
err.context ? `- context: ${err.context?.trim()}` : '',
);
if (s3err.code === 'NoSuchKey' && (req.method === 'GET' || req.method === 'HEAD')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to include NO_SUCH_OBJECT also?

err.context ? `- context: ${err.context?.trim()}` : '',
);
if (s3err.code === 'NoSuchKey' && (req.method === 'GET' || req.method === 'HEAD')) {
dbg.log1('S3 NoSuchKey', req.method, req.originalUrl, req.request_id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add JSON.stringify(req.headers) too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants