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

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1006633

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

Status in “apport” package in Ubuntu:
  In Progress
Status in “apport” source package in Precise:
  In Progress

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1006633/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to