unattended-upgrade-shutdown crashes with apt_pkg.Error: E:Syntax error /etc/apt/apt.conf:2: Extra junk at end of file

Bug #1737717 reported by errors.ubuntu.com bug bridge on 2017-12-12
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Undecided
Balint Reczey
Xenial
Undecided
Unassigned

Bug Description

[Impact]

 * Unattended-upgrades-shutdown service fails to start printing a crash
 * The fix would not warrant an SRU itself but it is part of the full backport SRU tracked in LP: #1702793.

[Test Case]

 * Buggy version:
root@x2:~# echo extra-junk >> /etc/apt/apt.conf.d/50unattended-upgrades
root@x2:~# /usr/share/unattended-upgrades/unattended-upgrade-shutdown
Traceback (most recent call last):
  File "/usr/share/unattended-upgrades/unattended-upgrade-shutdown", line 119, in <module>
    apt_pkg.init_config()
SystemError: E:Syntax error /etc/apt/apt.conf.d/50unattended-upgrades:67: Extra junk at end of file
root@x2:~#

 * Fixed version:
# /usr/share/unattended-upgrades/unattended-upgrade-shutdown ; echo $?
1
root@bb-lp-1806076:~# tail /var/log/unattended-upgrades/unattended-upgrades-shutdown.log
2018-11-30 18:05:56,515 ERROR - Apt returned an error, exiting
2018-11-30 18:05:56,515 ERROR - error message: 'E:Syntax error /etc/apt/apt.conf.d/50unattended-upgrades:93: Extra junk at end of file'

[Regression Potential]

 * U-u-s used to exit crashing, now it exits with an error code, just logging the error. There is little chance for regressing here, but users may have harder time to figure out why u-u-s exited, they need to check the log file.
 * There is also an enhancement request tracked to start u-u-s with a default config when parsing the config fails to be able to act on shutdown:
https://github.com/mvo5/unattended-upgrades/issues/161

[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/b1c4cd0c858e1c3c6c86f938397e8d5d4208242b 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/share/unattended-upgrades/unattended-upgrade-shutdown", line 136, in <module>
    apt_pkg.init_config()
apt_pkg.Error: E:Syntax error /etc/apt/apt.conf:2: Extra junk at end of file

Balint Reczey (rbalint) on 2017-12-12
Changed in unattended-upgrades (Ubuntu):
status: New → In Progress
assignee: nobody → Balint Reczey (rbalint)
description: updated
summary: - /usr/share/unattended-upgrades/unattended-upgrade-
- shutdown:apt_pkg.Error:/usr/share/unattended-upgrades/unattended-
- upgrade-shutdown@136
+ unattended-upgrade-shutdown crashes with apt_pkg.Error: E:Syntax error
+ /etc/apt/apt.conf:2: Extra junk at end of file
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.

Other bug subscribers