Invalid UTF-8 characters in dpkg's log crash unattended-upgrade.

Bug #1737635 reported by errors.ubuntu.com bug bridge on 2017-12-11
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned

Bug Description

[Impact]

 * Unattended-upgrades crashes at the end of its run before sending out upgrade report email when dpkg's log contains invalid UTF-8 characters.

[Test Case]

 * Observe https://errors.ubuntu.com/problem/4617feba656f6ec216996b0f1f662ae13904b9f8 not occurring again

[Regression Potential]

 * The fix is minimal, only replacing invalid characters with �. Regressions in u-u are unlikely but tools may break consuming unattended-upgrades output in case they can't handle the replacement marker.

[Original Bug Text]

The Ubuntu Error Tracker has been receiving reports about a problem regarding unattended-upgrades. This problem was most recently seen with package version 0.98ubuntu1, the problem page at https://errors.ubuntu.com/problem/2fa32547e0d8e7186a0a805e3db6f50317c0dafa contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1706, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 1619, in main
    log_content = get_dpkg_log_content(logfile_dpkg, install_start_time)
  File "/usr/bin/unattended-upgrade", line 1229, in get_dpkg_log_content
    for line in fp.readlines():
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 7912-7913: invalid continuation byte

Balint Reczey (rbalint) on 2017-12-11
summary: - /usr/bin/unattended-upgrade:UnicodeDecodeError:/usr/bin/unattended-
- upgrade@1706:main:get_dpkg_log_content:decode
+ Invalid UTF-8 characters in dpkg's log crash unattended-upgrade.
Changed in unattended-upgrades (Ubuntu):
status: New → In Progress
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.99ubuntu2

---------------
unattended-upgrades (0.99ubuntu2) bionic; urgency=medium

  * Run upgrade-between-snapshots only on amd64.
    The test exercises only unattented-upgrade's Python code and uses
    dependencies from the frozen Debian snapshot archive thus running
    it on all architectures would provide little benefit.

 -- Balint Reczey <email address hidden> Tue, 13 Feb 2018 11:41:20 +0700

Changed in unattended-upgrades (Ubuntu):
status: In Progress → Fix Released
Balint Reczey (rbalint) on 2018-11-30
description: updated

Hello errors.ubuntu.com, or anyone else affected,

Accepted unattended-upgrades into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.1ubuntu1.18.04.7~16.04.0 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in unattended-upgrades (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed verification-needed-xenial
Łukasz Zemczak (sil2100) wrote :

Hello errors.ubuntu.com, or anyone else affected,

Accepted unattended-upgrades into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.1ubuntu1.18.04.7~16.04.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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers