should collect /etc/default/grub from package install failures due to update-grub failing

Bug #1006633 reported by Brian Murray
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Brian Murray
Precise
Fix Released
High
Brian Murray

Bug Description

[Impact]
Apport does not inclue an important configuration file for determining the root cause of errors for some package installation failures. Since the majority of our bug reports come from stable releases it would be good to release the update to apport to Precise. Additionally, if we ask people to manually add /etc/default/grub they would have to manually remove any username and password infromation from it. Instead with the apport hook it is done automatically.

[Test Case]
1) Modify /etc/default/grub by removing the final " from the quiet splash line so you have "quiet splash instead of "quiet splash".
2) Execute apt-get install --reinstall memtest86+
3) Observe package installation failure

With the version from -proposed there should be an attachment called EtcDefaultGrub which contains the contents of your /etc/default/grub file. You will see this in the resulting apport dialog.

[Regression Potential]
Its possible that something is wrong with the regular expression that searches DpkgTerminalLog and we won't actually receive /etc/default/grub. However, this is working in Quantal so is unlikely.

Package installation failures frequently happen due to configuration errors in /etc/default/grub which are encountered when running update-grub. It'd be good if apport would to collect /etc/default/grub using attach_default_grub from hookutils.py to collect this file so we can see what Ubuntu users are doing wrong.

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

Here's a patch to add in the information for precise's version of apport.

Changed in apport (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: New → In Progress
Changed in apport (Ubuntu Precise):
status: New → In Progress
Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Changed in apport (Ubuntu Precise):
assignee: nobody → Brian Murray (brian-murray)
importance: Undecided → High
Changed in apport (Ubuntu):
importance: Undecided → High
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.1.1-0ubuntu2

---------------
apport (2.1.1-0ubuntu2) quantal; urgency=low

  [ Martin Pitt ]
  * data/general-hooks/automatix.py: Fix whitespace according to PEP-8.
  * data/general-hooks/ubuntu.py: Fix whitespace according to PEP-8.
  * data/package-hooks/source_{linux,ubiquity}.py: Fix whitespace according to
    PEP-8.
  * debian/control: Add pep8 build dependency, to ensure folks test-build with
    that.
  * etc/apport/crashdb.conf: Re-enable Launchpad crash reporting again.

  [ Brian Murray ]
  * data/general-hooks/ubuntu.py: collect /etc/default/grub on systems where a
    package failed to install during update-grub (LP: #1006633)
 -- Martin Pitt <email address hidden> Fri, 01 Jun 2012 15:44:54 +0200

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
description: updated
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

While writing the test case for the SRU of this bug I discovered an error in the regular expression I wrote.

+ # for packages that run update-grub include /etc/default/grub
+ UPDATE_BOOT = ['memtest86+', 'linux', 'ubuntu-meta',
+ 'virtualbox-ose']
+ ug_failure = 'User post(inst|rm) hook script \[(/usr)?/sbin/update-grub\] exited with value [1-9]+'
+ if re.search(ug_failure, termlog):
+ if report['SourcePackage'] in UPDATE_BOOT:
+ attach_default_grub(report, 'EtcDefaultGrub')

The ug_failure regular expression was created by looking at package installation failure log files, DpkgTerminalLog, for the grub2 package. It seems that error message from grub2 is different than that of the one from any of the packages in UPDATE_BOOT. Instead for a memtest86+ failure we'll have the following:

/etc/default/grub: 9: splash: not found^M
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127^M
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.38-13-generic.postinst line 1010.^M
dpkg: error processing linux-image-2.6.38-13-generic (--configure):^M
 subprocess installed post-installation script returned error exit status 2^M
Setting up memtest86+ (4.10-1.1ubuntu1) ...^M

So the ug_failure regular expression needs to be reworked to actually match the errors created by the packages in UPDATE_BOOT.

Changed in apport (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.4-0ubuntu3

---------------
apport (2.4-0ubuntu3) quantal; urgency=low

  * data/general/ubuntu.py: modify regualr expressions for determining which
    package installation failures to gather /etc/default/grub for
    (LP: #1006633)
 -- Brian Murray <email address hidden> Wed, 18 Jul 2012 15:48:49 -0700

Changed in apport (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apport/2.0.1-0ubuntu12 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apport (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

I misconfigured by /etc/default/grub file as indicated and reinstalled memtest86+ with the -proposed version of apport installed and the resulting apport crash report did include my /etc/default/grub. So the verification has passed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.0.1-0ubuntu12

---------------
apport (2.0.1-0ubuntu12) precise-proposed; urgency=low

  [ Martin Pitt ]
  * apport_python_hook: Fix UnicodeEncodeError crash with Python 2 for
    exceptions with non-ASCII characters. Backported from trunk r2426.
    (LP: #972436)

  [ Brian Murray ]
  * data/general-hooks/ubuntu.py: collect /etc/default/grub on systems where a
    package failed to install during when updating grub (LP: #1006633)
 -- Brian Murray <email address hidden> Thu, 19 Jul 2012 10:53:25 -0700

Changed in apport (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.