Skip to content

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

Merged
batrick merged 1 commit into
ceph:squidfrom
rkachach:fix_issue_76077
Jul 27, 2026
Merged

batrick merged 1 commit into
ceph:squidfrom
rkachach:fix_issue_76077

Conversation

@rkachach

Copy link
Copy Markdown
Contributor

Backport of #68392

Fixes: https://tracker.ceph.com/issues/76051 (original ticket)
Fixes: https://tracker.ceph.com/issues/76077 (squid backport ticket)

(cherry picked from commit 7b2a914)

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.

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 (original ticket)
Fixes: https://tracker.ceph.com/issues/76077 (squid backport ticket)
Signed-off-by: Redouane Kachach <[email protected]>
(cherry picked from commit 7b2a914)
@rkachach
rkachach requested review from yuriw and zmc April 17, 2026 13:41
@rkachach
rkachach requested a review from a team as a code owner April 17, 2026 13:41
@github-actions github-actions Bot added this to the squid milestone Apr 17, 2026
@ljflores ljflores changed the title qa: fix misleading "in cluster log" failures during cluster log scan squid: qa: fix misleading "in cluster log" failures during cluster log scan Apr 17, 2026
@rkachach

Copy link
Copy Markdown
Contributor Author

jenkins test api

@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@yuriw

yuriw commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri2-testing-20260602.202206-squid.

@yuriw

yuriw commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri2-testing-20260622.144905-squid.

@yuriw

yuriw commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-yuri2-testing-20260622.144905-squid.

@yuriw

yuriw commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri5-testing-20260623.145428-squid.

@sseshasa

Copy link
Copy Markdown
Contributor

@Naveenaidu

Copy link
Copy Markdown
Contributor

@yuriw yuriw added the TESTED label Jul 24, 2026
@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Jul 27, 2026
@github-actions github-actions Bot removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-fail Release engineering: failed backport verification audit. labels Jul 27, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@batrick batrick removed the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ceph Release Engineering Audit Report

Commit Parity Visualizer

BACKPORT PR #68448 SOURCE PR SOURCE STATUS
62e63fa qa: fix misleading "in cluster log" failures during cluster log scan PR #68392 7b2a914 qa: fix misleading "in cluster log" failures during cluster log scan

Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

This does not necessarily indicate an issue but a maintainer should review.

**Click to expand conflict summaries.**

Deviation in Backport 62e63fa (cherry-pick of 7b2a914)

Affected File(s)

Range Diff

Click to expand
--- Original (7b2a9141)
+++ Backport (62e63faa)
@@ -36,5 +36,7 @@
 - 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
+Fixes: https://tracker.ceph.com/issues/76051 (original ticket)
+Fixes: https://tracker.ceph.com/issues/76077 (squid backport ticket)
 Signed-off-by: Redouane Kachach <[email protected]>
+(cherry picked from commit 7b2a9141053fd639138ab5bc1db09c32e354cf12)

================================================================================
RANGE DIFF
================================================================================

1:  7b2a9141053 ! 1:  62e63faa3df qa: fix misleading "in cluster log" failures during cluster log scan
    @@ Commit message
         - 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
    +    Fixes: https://tracker.ceph.com/issues/76051 (original ticket)
    +    Fixes: https://tracker.ceph.com/issues/76077 (squid backport ticket)
         Signed-off-by: Redouane Kachach <[email protected]>
    +    (cherry picked from commit 7b2a9141053fd639138ab5bc1db09c32e354cf12)
     
      ## qa/tasks/cephadm.py ##
     @@ qa/tasks/cephadm.py: def ceph_log(ctx, config):
    @@ qa/tasks/cephadm.py: def ceph_log(ctx, config):
     -            Find the first occurrence of the pattern specified in the Ceph log,
     -            Returns None if none found.
     +            Find the first occurrence of the pattern specified in the Ceph log.
    ++
    ++            Returns:
    ++                - matching line as a string if found
    ++                - None if the file does not exist or no match is found
      
     -            :param pattern: Pattern scanned for.
     -            :param excludes: Patterns to ignore.
     -            :return: First line of text (or None if not found)
    -+            Returns:
    -+                - matching line as a string if found
    -+                - None if the file does not exist or no match is found
    -+
     +            Raises:
     +                - CommandFailedError if the scan command itself fails unexpectedly
                  """
    @@ qa/tasks/cephadm.py: def ceph_log(ctx, config):
     +
                  args = [
                      'sudo',
    -                 'grep', '-E', pattern,
    +-                'egrep', pattern,
     -                '/var/log/ceph/{fsid}/ceph.log'.format(
     -                    fsid=fsid),
    ++                'grep', '-E', pattern,
     +                log_path,
                  ]
                  if only_match:
    -                 args.extend([run.Raw('|'), 'grep', '-E', '|'.join(only_match)])
    +                 args.extend([run.Raw('|'), 'egrep', '|'.join(only_match)])
     @@ qa/tasks/cephadm.py: def ceph_log(ctx, config):
                  args.extend([
                      run.Raw('|'), 'head', '-n', '1',

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.


🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @batrick.

View workflow run

@batrick
batrick merged commit 9bfa423 into ceph:squid Jul 27, 2026
15 of 20 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.

6 participants