not all package install failures generate a crash report

Bug #1196740 reported by Brian Murray on 2013-07-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
High
Unassigned

Bug Description

I was trying to install the package crash-in-postinst package from the following PPA, https://launchpad.net/~daisy-pluckers/+archive/daisy-seeds/+packages. This package is specifically designed to fail during the post installation due to a maintainer script error. I was surprised to discover that software-center did not create a package install failure crash file in this case. I did receive an error message from aptdaemon that said the "Package operation failed". Digging into the software-center code I found the following:

        # lintian errors are ignored and not send to apport_recoverable_error
        # and dpkg errors as well as they will already be recorded separately
        # by apt itself
        if error_code in (enums.ERROR_INVALID_PACKAGE_FILE,
                                enums.ERROR_PACKAGE_MANAGER_FAILED):
            return

For some reason these errors are not being recorded when the package manager has failed. However, if one uses 'apt-get install' or 'aptdcon' to install the same package you will get a crash report. So I believe it is something with software-center itself that is preventing these crash reports from being generated.

Apport provides a package_hook script, /usr/share/apport/package_hook, for creating package install failures so we could call that from software-center. I've written a patch that does just that.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: software-center 13.05-0ubuntu1 [modified: usr/share/software-center/softwarecenter/backend/installbackend_impl/aptd.py usr/share/software-center/softwarecenter/paths.py]
ProcVersionSignature: Ubuntu 3.10.0-1.8-generic 3.10.0-rc7
Uname: Linux 3.10.0-1-generic x86_64
ApportVersion: 2.10.2-0ubuntu3
Architecture: amd64
CheckboxSubmission: 2e6ecd139611830c78226ad04ff4c093
CheckboxSystem: bb422ca46d02494cdbc459927a98bc2f
Date: Mon Jul 1 15:47:33 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2010-11-17 (956 days ago)
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: software-center
UpgradeStatus: Upgraded to saucy on 2013-06-04 (27 days ago)

Brian Murray (brian-murray) wrote :
Brian Murray (brian-murray) wrote :

Here is a log from a failed installation of the package:

2013-07-01 11:59:54,742 - softwarecenter.backend - WARNING - _on_trans_error: 'TransactionFailed(u'error-package-manager-failed: (Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 649694 files and directories currently installed.)\r\nPreparing to replace crash-in-postinst 2 (using .../crash-in-postinst_2_all.deb) ...\r\nUnpacking replacement crash-in-postinst ...\r\nSetting up crash-in-postinst (2) ...\r\ndpkg: error processing crash-in-postinst (--install):\r\n subprocess installed post-installation script returned error exit status 1\r\nErrors were encountered while processing:\r\n crash-in-postinst\r\n',)' '<AptTransaction object at 0x76f41e0 (aptdaemon+client+AptTransaction at 0x7564280)>' 'crash-in-postinst'
2013-07-01 12:03:57,327 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2013-07-01 12:03:59,780 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
2013-07-01 12:03:59,832 - softwarecenter.plugin - INFO - activating plugin '<module 'webapps_activation' from '/usr/share/software-center/softwarecenter/plugins/webapps_activation.pyc'>'
2013-07-01 12:04:01,363 - softwarecenter.db.pkginfo_impl.aptcache - INFO - aptcache.open()
2013-07-01 12:04:10,679 - softwarecenter.db.utils - INFO - software-center-agent finished with status 0
2013-07-01 12:04:15,764 - softwarecenter.backend.spawn_helper - WARNING - exit code 1 from helper for '['/usr/share/software-center/piston_generic_helper.py', '--datadir', '/usr/share/software-center/', 'SoftwareCenterRecommenderAPI', 'recommend_app', '{"pkgname": "crash-in-postinst"}']'
2013-07-01 12:04:15,766 - softwarecenter.backend.spawn_helper - WARNING - got error from helper: 'WARNING:__main__:404: {'status': '404', 'content-length': '66', 'via': '1.1 papeda.canonical.com:3128 (squid/2.7.STABLE7)', 'x-cache': 'MISS from papeda.canonical.com', 'x-cache-lookup': 'HIT from papeda.canonical.com:3128', 'strict-transport-security': 'max-age=2592000', 'vary': 'Accept-Encoding', 'server': 'Apache/2.2.22 (Ubuntu)', 'etag': '"63f0274927b9669d1d133c5b07318e05"', 'cache-control': 'max-age=300', 'date': 'Mon, 01 Jul 2013 19:04:11 GMT', 'content-type': 'text/html; charset=utf-8', '-content-encoding': 'gzip'}
'

Brian Murray (brian-murray) wrote :

Here is an incomplete patch using the package_hook utility to create .crash files. However, there is an issue with the naming of attachments and code in the general Ubuntu hook (ubuntu.py) for handling dpkg log files. The issue being that the log file will be called VarLogAptTermlog and not DpkgTerminalLog like ubuntu.py expects.

Changed in software-center (Ubuntu):
importance: Undecided → High
status: New → Confirmed
tags: added: patch
Matthew Paul Thomas (mpt) wrote :

If fixing this is likely to change the reported error rate without changing the actual error rate, these particular error reports should include the DetectedSince key.

dino99 (9d9) wrote :

That version is no more maintained

Changed in software-center (Ubuntu):
status: Confirmed → Invalid
Brian Murray (brian-murray) wrote :

This still affects recent versions of Ubuntu.

Changed in software-center (Ubuntu):
status: Invalid → Triaged
tags: added: trusty vivid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers