Skip to content

qa: fix misleading "in cluster log" failures during cluster log scan - #68392

Merged
rkachach merged 1 commit into
ceph:mainfrom
rkachach:fix_issue_cepahdm_qa_task
Apr 17, 2026
Merged

rkachach merged 1 commit into
ceph:mainfrom
rkachach:fix_issue_cepahdm_qa_task

Conversation

@rkachach

@rkachach rkachach commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix misleading failure reasons reported as "… in cluster log" when no such log entry actually exists.

The cephadm task currently treats grep errors from the cluster log scan as if they were actual log matches. This produces bogus failure summaries when ceph.log is missing — especially after early failures such as image pull or bootstrap problems.


Problem

first_in_ceph_log() currently:

  • returns stdout if a match is found
  • otherwise returns stderr

The caller then treats any non-None return value as a real cluster log hit and formats it as:

"<match>" in cluster log

That means a grep error like:

grep: /var/log/ceph/<fsid>/ceph.log: No such file or directory

gets silently misreported as if it were a line found in the cluster log completely masking the real root cause (e.g. a failed image pull).


Fix

This change makes cluster log scanning robust and accurate by:

  • checking whether /var/log/ceph/<fsid>/ceph.log exists before attempting to scan
  • using check_status=False on the grep pipeline to avoid spurious exceptions on no-match (exit 1)
  • treating only stdout as a real log match
  • treating non-empty stderr as a scan execution error, not log content
  • avoiding overwriting a more accurate pre-existing failure_reason
  • reporting scan failures separately with a clear 'cluster log scan failed' reason

Fixes: https://tracker.ceph.com/issues/76051

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@rkachach
rkachach marked this pull request as ready for review April 16, 2026 08:04
@rkachach
rkachach requested a review from a team as a code owner April 16, 2026 08:04
Summary:

Fix misleading failure reasons reported as `"… in cluster log"` when
no such log entry actually exists.

The cephadm task currently treats `grep` errors from the cluster log
scan as if they were actual log matches. This can produce bogus
failure summaries when `ceph.log` is missing, especially after early
failures such as image pull or bootstrap problems.

Problem:

first_in_ceph_log() currently:

- returns stdout if a match is found
- otherwise returns stderr

The caller then treats any non-None value as a real cluster log hit and formats it as:

"<value>" in cluster log

That means an error like:

  grep: /var/log/ceph/<fsid>/ceph.log: No such file or directory

can be misreported as if it came from the cluster log.

This change makes cluster log scanning robust and accurate by:

- checking whether /var/log/ceph/<fsid>/ceph.log exists before scanning
- using check_status=False for the grep pipeline
- treating only stdout as a real log match
- treating stderr as a scan error instead of log content
- avoiding overwrite of a more accurate pre-existing failure_reason
- reporting scan failures separately as cluster log scan failed

Fixes: https://tracker.ceph.com/issues/76051
Signed-off-by: Redouane Kachach <[email protected]>
@rkachach
rkachach force-pushed the fix_issue_cepahdm_qa_task branch from 1125c4c to 7b2a914 Compare April 16, 2026 08:05

@zmc zmc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great to me

@rkachach rkachach changed the title [WIP] qa: fix misleading "in cluster log" failures during cluster log scan qa: fix misleading "in cluster log" failures during cluster log scan Apr 17, 2026
@rkachach

Copy link
Copy Markdown
Contributor Author

@rkachach
rkachach merged commit 42f4291 into ceph:main Apr 17, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants