← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~bryce/apport/bug-1831802 into lp:apport


Bryce Harrington has proposed merging lp:~bryce/apport/bug-1831802 into lp:apport.

Commit message:
data/general-hooks/generic.py: Don't file bug reports about out-of-space conditions

For package installation problems, if the problem is due to insufficient
disk space then treat it as an unreportable error.

Fixes: LP: #1831802

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1831802 in Apport: "Apport reporting package installation failures when system is out of disk space"

For more details, see:

If package installation failed due to out-of-disk-space, it isn't necessary to file a bug report about it, so filter these.
Your team Apport upstream developers is requested to review the proposed merge of lp:~bryce/apport/bug-1831802 into lp:apport.
=== modified file 'data/general-hooks/generic.py'
--- data/general-hooks/generic.py	2018-02-13 00:50:36 +0000
+++ data/general-hooks/generic.py	2019-06-05 21:17:15 +0000
@@ -28,13 +28,13 @@
     home = os.getenv('HOME')
     if home:
         mounts[home] = 'home'
-    treshold = 50
+    threshold = 50
     for mount in mounts:
         st = os.statvfs(mount)
         free_mb = st.f_bavail * st.f_frsize / 1000000
-        if free_mb < treshold:
+        if free_mb < threshold:
             report['UnreportableReason'] = 'Your %s partition has less than \
 %s MB of free space available, which leads to problems using applications \
 and installing updates. Please free some space.' % (mounts[mount], free_mb)
@@ -81,6 +81,12 @@
     in_gl = '/usr/lib/libGL.so' in (report.get('StacktraceTop') or '\n').splitlines()[0]
     if in_gl and 'Loading extension GLX' not in apport.hookutils.read_file('/var/log/Xorg.0.log'):
         report['UnreportableReason'] = 'The X.org server does not support the GLX extension, which the crashed program expected to use.'
+    # filter out package install failures due to insufficient disk space
+    if 'ERROR: There\'s not enough space in' in report.get('DpkgTerminalLog')
+        and report['ProblemType'] == 'Package':
+        report['UnreportableReason'] = 'The package installation failed because your system did not have enough free space available. Please free some space to avoid problems using applications and installing updates.'
     # filter out package install failures due to a segfault
     if 'Segmentation fault' in report.get('ErrorMessage', '') \
             and report['ProblemType'] == 'Package':

Follow ups