From 93c0456159a87bb9c28b9b60998baeba1600af5f Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Thu, 8 Dec 2022 11:09:16 +1100 Subject: [PATCH 1/2] qa/workunits/rados/test_crash: chown crash files to ceph user Fixes: https://tracker.ceph.com/issues/58098 Signed-off-by: Tim Serong --- qa/workunits/rados/test_crash.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qa/workunits/rados/test_crash.sh b/qa/workunits/rados/test_crash.sh index 6608d7872e232..26a4c9bdc151f 100755 --- a/qa/workunits/rados/test_crash.sh +++ b/qa/workunits/rados/test_crash.sh @@ -24,6 +24,11 @@ for f in $(find $TESTDIR/archive/coredump -type f); do fi done +# ceph-crash runs as the unprivileged "ceph" user, but when under test +# the ceph osd daemons are running as root, so their crash files aren't +# readable. let's chown them so they behave as they would in real life. +sudo chown -R ceph:ceph /var/lib/ceph/crash + # let daemon find crashdumps on startup sudo systemctl restart ceph-crash sleep 30 From d139f6d112e6118f0f458dbfff9550b3ce312d20 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Thu, 8 Dec 2022 11:54:17 +1100 Subject: [PATCH 2/2] ceph-crash: log warning if crash directory unreadable This is to aid in debugging in case crashes aren't posted as expected (see https://tracker.ceph.com/issues/58098 for discussion). Signed-off-by: Tim Serong --- src/ceph-crash.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ceph-crash.in b/src/ceph-crash.in index 6e816a80134af..0e02837fadd4d 100755 --- a/src/ceph-crash.in +++ b/src/ceph-crash.in @@ -66,6 +66,9 @@ def post_crash(path): def scrape_path(path): for p in os.listdir(path): crashpath = os.path.join(path, p) + if not os.access(crashpath, os.R_OK): + log.warning('unable to read crash path %s' % (crashpath)) + continue metapath = os.path.join(crashpath, 'meta') donepath = os.path.join(crashpath, 'done') if os.path.isfile(metapath):