From a77b47eeeb5770eeefcf4619ab2105ee7a6a003e Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 28 Jun 2021 18:49:15 +0200 Subject: [PATCH] src/ceph-crash.in: print stderr if available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is not perfect, but we have seen cases where the CLI returns 0 even on failure. For instance: ```sh [root@rook-ceph-crashcollector-compute-1-66bdfbd886-d2zcd /]# ceph -n client.crash crash post -i /var/lib/ceph/crash/2021-06-28T07\:47\:37.859766Z_6ffb119c-930e-4047-9cfa-a92af783cdd0/meta malformed crash metadata: time data '2021-06-28T07:47:37.859766' does not match format '%Y-%m-%d %H:%M:%S.%f' [root@rook-ceph-crashcollector-compute-1-66bdfbd886-d2zcd /]# echo $? 0 ``` So until we find the root cause, let's mitigate and perhaps accomodate for futur similar issues. Signed-off-by: Sébastien Han --- src/ceph-crash.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph-crash.in b/src/ceph-crash.in index 9e1e11181fbc..ae0e4f516464 100755 --- a/src/ceph-crash.in +++ b/src/ceph-crash.in @@ -51,7 +51,7 @@ def post_crash(path): stderr = pr.communicate(input=f.read()) rc = pr.wait() f.close() - if rc != 0: + if rc != 0 or stderr != "": log.warning('post %s as %s failed: %s' % (path, n, stderr)) if rc == 0: break -- 2.47.3