]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/ceph-crash.in: print stderr if available 45381/head
authorSébastien Han <seb@redhat.com>
Mon, 28 Jun 2021 16:49:15 +0000 (18:49 +0200)
committerAdam King <adking@redhat.com>
Mon, 14 Mar 2022 15:31:00 +0000 (11:31 -0400)
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 <seb@redhat.com>
(cherry picked from commit a77b47eeeb5770eeefcf4619ab2105ee7a6a003e)

src/ceph-crash.in

index 9e1e11181fbc67138de65b380d9beb7846e810c8..ae0e4f516464fd4d63a96d497cfe3d7545f89eda 100755 (executable)
@@ -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