Merge lp:~bryce/apport/bug-1831802 into lp:~apport-hackers/apport/trunk

Proposed by Bryce Harrington
Status: Work in progress
Proposed branch: lp:~bryce/apport/bug-1831802
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 32 lines (+8/-2)
1 file modified
data/general-hooks/generic.py (+8/-2)
To merge this branch: bzr merge lp:~bryce/apport/bug-1831802
Reviewer Review Type Date Requested Status
Apport upstream developers Pending
Review via email: mp+368415@code.launchpad.net

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

Description of the change

If package installation failed due to out-of-disk-space, it isn't necessary to file a bug report about it, so filter these.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Googling a bit more, this error message may be originating from mysql, in which case an alternative approach might be to parse Df.txt for 100% usage on /.

I don't know how prevalent this particular type of bug report is. There is already code to check disk space at bug filing time, which may catch most of these, but won't catch if the system ran out of space during installation.

Revision history for this message
Brian Murray (brian-murray) wrote :

The error message does in fact come from mysql as we can in the presint:

167 # checking disc space
168 if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
169 echo "ERROR: There's not enough space in $DATADIR/" 1>&2
170 db_stop
171 exit 1
172 fi

So the string checking you've added would make more sense in the mysql apport package hook, that being said it is curious that the referenced bug report got reported to Launchpad at all. I'd have expected there to be an UnreportableReason regarding the partition not having enough free space.

Unmerged revisions

3255. By Bryce Harrington

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.

3254. By Bryce Harrington

data/general-hooks/generic.py: Fix misspelled variable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/general-hooks/generic.py'
2--- data/general-hooks/generic.py 2018-02-13 00:50:36 +0000
3+++ data/general-hooks/generic.py 2019-06-05 21:17:15 +0000
4@@ -28,13 +28,13 @@
5 home = os.getenv('HOME')
6 if home:
7 mounts[home] = 'home'
8- treshold = 50
9+ threshold = 50
10
11 for mount in mounts:
12 st = os.statvfs(mount)
13 free_mb = st.f_bavail * st.f_frsize / 1000000
14
15- if free_mb < treshold:
16+ if free_mb < threshold:
17 report['UnreportableReason'] = 'Your %s partition has less than \
18 %s MB of free space available, which leads to problems using applications \
19 and installing updates. Please free some space.' % (mounts[mount], free_mb)
20@@ -81,6 +81,12 @@
21 in_gl = '/usr/lib/libGL.so' in (report.get('StacktraceTop') or '\n').splitlines()[0]
22 if in_gl and 'Loading extension GLX' not in apport.hookutils.read_file('/var/log/Xorg.0.log'):
23 report['UnreportableReason'] = 'The X.org server does not support the GLX extension, which the crashed program expected to use.'
24+
25+ # filter out package install failures due to insufficient disk space
26+ if 'ERROR: There\'s not enough space in' in report.get('DpkgTerminalLog')
27+ and report['ProblemType'] == 'Package':
28+ 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.'
29+
30 # filter out package install failures due to a segfault
31 if 'Segmentation fault' in report.get('ErrorMessage', '') \
32 and report['ProblemType'] == 'Package':

Subscribers

People subscribed via source and target branches