Unattended Upgrades fail to parse "${distro_id}:${distro_codename}-security"

Bug #1177318 reported by pheidrias
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Beginning with Ubuntu 13.04 Raring Ringtail, unattended-upgrades seems not to be able to parse /etc/apt/apt.conf.d/50unattended-upgrades anymore. The logfile tells:

cat /var/log/unattended-upgrades/unattended-upgrades.log
2013-05-06 14:57:05,724 INFO Pakete, die anfangs auf die schwarzen Liste standen:
2013-05-06 14:57:05,724 INFO Skript für unbeaufsichtigte Upgrades wird gestartet.
2013-05-06 14:57:05,725 INFO erlaubte Ursprünge sind: ['o=Ubuntu,a=raring-security', 'o=Ubuntu,a=raring-updates']
2013-05-06 14:57:09,114 INFO Es wurden keine Pakete gefunden, von denen ein unbeaufsichtigtes Upgrade durchgeführt werden kann.
2013-05-07 11:33:04,944 INFO Pakete, die anfangs auf die schwarzen Liste standen:
2013-05-07 11:33:04,944 INFO Skript für unbeaufsichtigte Upgrades wird gestartet.
2013-05-07 11:33:04,944 INFO erlaubte Ursprünge sind: ['o=Ubuntu,a=raring-security', 'o=Ubuntu,a=raring-updates']
2013-05-07 11:33:08,398 INFO Es wurden keine Pakete gefunden, von denen ein unbeaufsichtigtes Upgrade durchgeführt werden kann.

which means two times, that allowed sources are ['o=Ubuntu,a=raring-security', 'o=Ubuntu,a=raring-updates'].

I do suspect it is because of the automatic distribution setting in /etc/apt/apt.conf.d/50unattended-upgrades or the setting of the corresponding variables:

"${distro_id}:${distro_codename}-updates"

When this line is set manually to "Ubuntu:raring-updates", it will work.

System: Ubuntu Gnome 13.04, all up-to-date

$ lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04

$ cat /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::Unattended-Upgrade "1";

$ cat /etc/apt/apt.conf.d/50unattended-upgrades
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
 "${distro_id}:${distro_codename}-security";
 "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};

// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
...

Tags: raring
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugrpeort.

What is the ouptut of:
$ sudo unattended-upgrades --debug
?

Mathew Hodson (mhodson)
tags: added: raring
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unattended-upgrades (Ubuntu):
status: New → Confirmed
Revision history for this message
Travis Odom (travis-a-odom) wrote :

Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1255, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 931, in main
    allowed_origins = get_allowed_origins()
  File "/usr/bin/unattended-upgrade", line 298, in get_allowed_origins
    allowed_origins = get_allowed_origins_legacy()
  File "/usr/bin/unattended-upgrade", line 283, in get_allowed_origins_legacy
    (distro_id, distro_codename) = s.split()
ValueError: need more than 0 values to unpack

It is failing to substitute `distro-id` and `distro-codename`, and so the for loop just gets: `['', '', "-security'", "-updates'", "-backports'"]`

Replacing the variable placeholders with the correct literal values fixes it as a workaround.

Revision history for this message
Travis Odom (travis-a-odom) wrote :

Note this also affects 14.04 trusty

Revision history for this message
Brian Murray (brian-murray) wrote :

What does the output of these lsb_release commands return?

67 DISTRO_CODENAME = subprocess.check_output(
68 ["lsb_release", "-c", "-s"], universal_newlines=True).strip()
69 DISTRO_ID = subprocess.check_output(
70 ["lsb_release", "-i", "-s"], universal_newlines=True).strip()

Changed in unattended-upgrades (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Brian Murray (brian-murray) wrote :

Actually, could you show the diff of what you had in the configuration file you modified and what you now have?

Revision history for this message
Jarno Suni (jarnos) wrote :

Here in Ubuntu 14.04.5 LTS it seems to install upgrades fine, even though there is "InstCount=0" in the log.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for unattended-upgrades (Ubuntu) because there has been no activity for 60 days.]

Changed in unattended-upgrades (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.