From 75e921157bb7b63642648fabeeac7f9795a1940f Mon Sep 17 00:00:00 2001 From: Jan Jansky Date: Wed, 11 Dec 2019 12:47:18 +0100 Subject: [archive] handle OSErrors If file/folder will be present during file list creation, but will be missing during collection OSError will throw exception FileNotFoundError: [Errno 2] No such file or directory Added handling of OSError into sos/archive.py and new log message with info level to sos_logs/sos.log Resolves: #1890 Signed-off-by: Jan Jansky Signed-off-by: Bryn M. Reeves --- sos/archive.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sos/archive.py b/sos/archive.py index 28578570..b53e50ba 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -348,6 +348,9 @@ class FileCacheArchive(Archive): pass else: self.log_info("caught '%s' copying '%s'" % (e, src)) + except OSError as e: + self.log_info("File not collected: '%s'" % e) + # copy file attributes, skip SELinux xattrs for /sys and /proc try: stat = os.stat(src) -- cgit