From: Kefu Chai Date: Thu, 9 Apr 2026 12:52:57 +0000 (+0800) Subject: ceph-crash: reduce log noise from auth fallback in post_crash() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a0f9ee50995d07e752325d0495ca0e18db0190b;p=ceph.git ceph-crash: reduce log noise from auth fallback in post_crash() post_crash() iterates auth_names trying each identity until one succeeds. Previously it logged a WARNING for every failed attempt, even when the next name succeeds. This is noisy in deployments where only a subset of the auth names have keyrings (e.g. manual deployments with only client.crash, or environments where client.admin is not accessible to ceph-crash). Improve the logging: - For auth failures (EACCES), log at DEBUG level and continue to the next name. - For non-auth failures, log a WARNING and stop immediately — trying other names won't help. - If all names fail authentication, log a single WARNING with the last stderr. Retain the stderr check from a77b47eeeb57 as a safeguard for mgr commands that may return rc=0 with an error on stderr. Signed-off-by: Kefu Chai --- diff --git a/src/ceph-crash.in b/src/ceph-crash.in index 52303c3e8a5f..25d7ca4e0a4e 100755 --- a/src/ceph-crash.in +++ b/src/ceph-crash.in @@ -3,6 +3,7 @@ # vim: ts=4 sw=4 expandtab import argparse +import errno import grp import logging import os @@ -56,10 +57,16 @@ def post_crash(path): stderr = stderr.decode() rc = pr.wait() f.close() - if rc != 0 or stderr != "": + if rc == 0 and stderr == "": + break + if rc == errno.EACCES: + log.debug('post %s as %s failed: %s' % (path, n, stderr)) + else: log.warning('post %s as %s failed: %s' % (path, n, stderr)) - if rc == 0: break + else: + log.warning('post %s failed: unable to authenticate as %s: %s' + % (path, ', '.join(auth_names), stderr)) return rc