apport package hook for mdadm causes a Traceback

Bug #1583279 reported by Brian Murray on 2016-05-18
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
Medium
Unassigned
Trusty
Medium
Unassigned
Wily
Medium
Unassigned
Xenial
Medium
Unassigned
Yakkety
Medium
Unassigned

Bug Description

As we can see in bug 1581940 (attachment HookError_source_mdadm.py) the apport package hook for mdadm causes a traceback.

Here's the Traceback:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 197, in _run_hook
    symb['add_info'](report, ui)
TypeError: add_info() takes 1 positional argument but 2 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 202, in _run_hook
    symb['add_info'](report)
  File "/usr/share/apport/package-hooks/source_mdadm.py", line 53, in add_info
    report['initrd.files'] = get_initrd_files(initrd_re)
  File "/usr/share/apport/package-hooks/source_mdadm.py", line 30, in get_initrd_files
    out = cpio.communicate(fd.read())[0]
  File "/usr/lib/python3.5/subprocess.py", line 1065, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.5/subprocess.py", line 1681, in _communicate
    self._save_input(input)
  File "/usr/lib/python3.5/subprocess.py", line 1754, in _save_input
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

[Impact]

Makes diagnosing issues around mdadm more difficult, as it won't be shown whether the generated initrd for the running kernel includes the bits relevant to mdadm.

[Test Case]

NOTE: an md device is not needed to reproduce the apport failure, the stacktrace is reproducable without setting up software raid.
1. sudo apt-get install mdadm
2. sudo apport-cli -f -p mdadm

For the failure case, a traceback like the above will be seen. For the successful case, no traceback will be seen, and (V)iewing the report will show a section titled 'initrd.files'

[Regression Potential]

Changes involved are only to the apport hook for mdadm, so the only risk is due to the rebuild of the mdadm package itself, and any toolchain changes that have occurred since it was last rebuilt.

Brian Murray (brian-murray) wrote :

Here are some other bugs with the HookError attachments:

./mdadm/bug-1473654/HookError_source_mdadm.txt
./mdadm/bug-1581940/HookError_source_mdadm.txt
./mdadm/bug-1471625/HookError_source_mdadm.txt
./mdadm/bug-1217344/HookError_source_mdadm.txt

tags: added: xenial yakkety
summary: - apport package hook for mdam causes a Traceback
+ apport package hook for mdadm causes a Traceback
tags: added: apport-hook-error
Steve Beattie (sbeattie) wrote :

Here's a fix for yakkety, will prepare SRU fixes for older releases in a bit.

Steve Beattie (sbeattie) wrote :

Here's a simplified debdiff for a xenial SRU.

Steve Beattie (sbeattie) wrote :

Trusty debdiff

Steve Beattie (sbeattie) wrote :

Wily debdiff.

Steve Beattie (sbeattie) on 2016-05-18
description: updated
tags: added: trusty wily

The attachment "mdadm_3.3-2ubuntu8.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson) on 2016-05-19
Changed in mdadm (Ubuntu Trusty):
importance: Undecided → Medium
Changed in mdadm (Ubuntu Wily):
importance: Undecided → Medium
Changed in mdadm (Ubuntu Xenial):
importance: Undecided → Medium
Changed in mdadm (Ubuntu Yakkety):
importance: Undecided → Medium
Mathew Hodson (mhodson) on 2016-05-20
Changed in mdadm (Ubuntu Trusty):
status: New → Triaged
Changed in mdadm (Ubuntu Wily):
status: New → Triaged
Changed in mdadm (Ubuntu Xenial):
status: New → Triaged
Changed in mdadm (Ubuntu Yakkety):
status: New → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdadm - 3.3-2ubuntu8

---------------
mdadm (3.3-2ubuntu8) yakkety; urgency=medium

  * debian/source_mdadm.py:
    + fix bytes versus strings mismatch that caused the apport hook
      to fail (LP: #1583279)
    + capture grub.cfg for grub2
    + pyflakes and pep8 cleanups

 -- Steve Beattie <email address hidden> Wed, 18 May 2016 13:31:04 -0700

Changed in mdadm (Ubuntu Yakkety):
status: Triaged → Fix Released
Brian Murray (brian-murray) wrote :

This was sponsored to the SRU queues, so unsubscribing sponsors.

Hello Brian, or anyone else affected,

Accepted mdadm into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mdadm/3.3-2ubuntu7.1 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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 mdadm (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Hello Brian, or anyone else affected,

Accepted mdadm into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mdadm/3.3-2ubuntu2.1 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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 mdadm (Ubuntu Wily):
status: Triaged → Fix Committed
Martin Pitt (pitti) wrote :

Hello Brian, or anyone else affected,

Accepted mdadm into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mdadm/3.2.5-5ubuntu4.3 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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 mdadm (Ubuntu Trusty):
status: Triaged → Fix Committed
Steve Beattie (sbeattie) wrote :

I've reproduced the issue with mdadm's apport hook in the current versions of mdadm in trusty, wily, and xenial, and have confirmed that the version of mdadm in each release's -proposed pocket addresses no longer produces a python stacktrace when generating information for apport. Marking verification-done.

Thanks!

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdadm - 3.2.5-5ubuntu4.3

---------------
mdadm (3.2.5-5ubuntu4.3) trusty; urgency=medium

  * debian/source_mdadm.py: fix bytes versus strings mismatch that
    caused the apport hook to fail (LP: #1583279)

 -- Steve Beattie <email address hidden> Wed, 18 May 2016 15:48:46 -0700

Changed in mdadm (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for mdadm 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 regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdadm - 3.3-2ubuntu2.1

---------------
mdadm (3.3-2ubuntu2.1) wily-proposed; urgency=medium

  * debian/source_mdadm.py: fix bytes versus strings mismatch that
    caused the apport hook to fail (LP: #1583279)

 -- Steve Beattie <email address hidden> Wed, 18 May 2016 16:18:51 -0700

Changed in mdadm (Ubuntu Wily):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdadm - 3.3-2ubuntu7.1

---------------
mdadm (3.3-2ubuntu7.1) xenial-proposed; urgency=medium

  * debian/source_mdadm.py: fix bytes versus strings mismatch that
    caused the apport hook to fail (LP: #1583279)

 -- Steve Beattie <email address hidden> Wed, 18 May 2016 15:24:48 -0700

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

Other bug subscribers