#704087 unattended-upgrades: Crashes on codename matching

#704087#5
Date:
2013-03-27 18:02:38 UTC
From:
To:
Dear Maintainer,

Recently, unattended-upgrades has started crashing with:

Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1011, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 793, in main
    allowed_origins=allowed_origins)
  File "/usr/bin/unattended-upgrade", line 75, in __init__
    self.adjust_candidate_versions()
  File "/usr/bin/unattended-upgrade", line 92, in adjust_candidate_versions
    if is_allowed_origin(pkg.candidate, self.allowed_origins):
  File "/usr/bin/unattended-upgrade", line 364, in is_allowed_origin
    if match_whitelist_string(allowed, origin):
  File "/usr/bin/unattended-upgrade", line 272, in match_whitelist_string
    what, token))
__main__.UnknownMatcherError: Unknown whitelist entry for macher 'n'
(token 'n=wheezy')


I haven't touched the configuration at all, so I'm pretty sure
this is a regression.

This might be related to #703401, where codename matching also results
in a crash (but with a different exception).

#704087#10
Date:
2013-03-28 06:38:47 UTC
From:
To:
Thanks for your bugreport.
 - unattended-upgrades does not support codename based matching (n=)
   because python-apt does not export this (fixed in experimental)
 - unattended-upgrades silently ignored codenames it did not know
   about which makes a matcher like "o=Debian,n=wheezy" to "o=Debian"
   internally

The new version now complains on unknown matchers and the combination
with the old config file where n=wheezy was part of the example config
is now casing this problem.

I wonder what I can do to help avoiding this confusion? Instead of a
error, just log a warning maybe? This could lead to overly broad
matching.

Cheers,
 Michael

#704087#15
Date:
2013-04-24 15:10:56 UTC
From:
To:
I've also encountered the same issue:

/etc/cron.daily/apt:
Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1011, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 793, in main
    allowed_origins=allowed_origins)
  File "/usr/bin/unattended-upgrade", line 75, in __init__
    self.adjust_candidate_versions()
  File "/usr/bin/unattended-upgrade", line 92, in adjust_candidate_versions
    if is_allowed_origin(pkg.candidate, self.allowed_origins):
  File "/usr/bin/unattended-upgrade", line 364, in is_allowed_origin
    if match_whitelist_string(allowed, origin):
  File "/usr/bin/unattended-upgrade", line 272, in match_whitelist_string
    what, token))
__main__.UnknownMatcherError: Unknown whitelist entry for macher 'n' (token 
'n=wheezy')

#704087#20
Date:
2013-04-26 12:31:26 UTC
From:
To:
Thanks for your bugreport.

Could you please check your configuration and remove the "n=wheezy"
line(s) in there? I'm sorry, but this line is not supported in
debian/unstable right now, it will need a new version of python-apt to
work.

#704087#25
Date:
2013-05-03 11:01:39 UTC
From:
To:
I got this workaround on debian wheezy when using distribution codename:

Get "python-apt" and "unattended-upgrades" packages from experimental
and install them manually.

When I typed this they were python-apt_0.8.9~exp2_amd64.deb and
unattended-upgrades_0.80~exp2_all.deb

#704087#30
Date:
2013-05-30 10:57:34 UTC
From:
To:
My wheezy stable system starts to have this recently after I put the
appropriate stuff in the configuration file:

/etc/cron.daily/apt:
Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1011, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 793, in main
    allowed_origins=allowed_origins)
  File "/usr/bin/unattended-upgrade", line 75, in __init__
    self.adjust_candidate_versions()
  File "/usr/bin/unattended-upgrade", line 92, in adjust_candidate_versions
    if is_allowed_origin(pkg.candidate, self.allowed_origins):
  File "/usr/bin/unattended-upgrade", line 364, in is_allowed_origin
    if match_whitelist_string(allowed, origin):
  File "/usr/bin/unattended-upgrade", line 272, in match_whitelist_string
    what, token))
__main__.UnknownMatcherError: Unknown whitelist entry for macher 'n' (token 
'n=wheezy')

In my opinion, this bug makes this package unusable by most wheezy users,
because suite matching will cause the system to silently break at the point
when jessie is released.

#704087#35
Date:
2013-05-31 05:48:25 UTC
From:
To:
Thanks for your bugreport.

Fixing this is not hard, but it requires a (small) change to
python-apt to export the information and a small patch to
unattended-upgrade itself (both are already in unstable). If there is
a chance that this might get accepted, I would love to get it in.

Cheers,
 Michael

#704087#40
Date:
2015-02-28 07:34:46 UTC
From:
To:
Hi!

Can you please tell what is the current status of this bug now?

Are there any ways to prevent automatic upgrade to jessie when jessie is
released?

What unattended-upgrades will really do if jessie is not listed in
/etc/apt/sources.list ? Just stops upgrading or what?

I'm little bit worried about this jessie issue...

Can you please fix this bug, before it's too late...

#704087#45
Date:
2015-08-28 13:42:05 UTC
From:
To:
Hi,

Since Jessie, I have no automatic update too. Could you help us to maintain Wheezy whith an automatic way ?

My configuration :
unattended-upgrades:
  Installé : 0.79.5+wheezy2
  Candidat : 0.79.5+wheezy2
 Table de version :
 *** 0.79.5+wheezy2 0
        990 http://security.debian.org/ wheezy/updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.79.5+wheezy1 0
        990 http://ftp2.fr.debian.org/debian/ wheezy/main amd64 Packages
// Distribution
APT::Default-Release "wheezy";

// consider Recommends, Suggests as important dependencies that should
// be installed by default
APT::Install-Recommends "true";
APT::Get::Assume-Yes "true";
// Automatically upgrade packages from these origin patterns
Unattended-Upgrade::Origins-Pattern {
        "o=${distro_id},n=${distro_codename}"8;
};


Whith this configuration, I have always :
Initial blacklisted packages: kernel* linux-image* linux-server*
Starting unattended upgrades script
Allowed origins are: ['o=Debian,n=wheezy']
Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1016, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 798, in main
    allowed_origins=allowed_origins)
  File "/usr/bin/unattended-upgrade", line 75, in __init__
    self.adjust_candidate_versions()
  File "/usr/bin/unattended-upgrade", line 92, in adjust_candidate_versions
    if is_allowed_origin(pkg.candidate, self.allowed_origins):
  File "/usr/bin/unattended-upgrade", line 364, in is_allowed_origin
    if match_whitelist_string(allowed, origin):
  File "/usr/bin/unattended-upgrade", line 272, in match_whitelist_string
    what, token))
__main__.UnknownMatcherError: Unknown whitelist entry for macher 'n' (token 'n=wheezy')


How to solve this problem or to find an other solution to update Wheezy ?

Thanks for your help.

Randy11

#704087#50
Date:
2015-09-01 07:44:20 UTC
From:
To:
There is a TEMPORARY solution. 'Temporary' because the update of Wheezy is done, but Wheezy is seen as "oldstable", so for the few weeks is not a problem, but if in my job you keep many versions active, it's a big problem.

First, you must have '/etc/apt/apt.conf' :
~~~~
// Definition de la distribution.
APT::Default-Release "wheezy";

// consider Recommends, Suggests as important dependencies that should
// be installed by default
APT::Install-Recommends "true";
APT::Get::Assume-Yes "true";
~~~~

And '/etc/apt/apt.conf.d/50unattended-upgrades' with 'Unattended-Upgrade::Origins-Pattern' :
~~~~
Unattended-Upgrade::Origins-Pattern{
        "origin=Debian";
        "origin=Debian,label=Debian-Security";
        "o=Debian,a=proposed-updates";
};
~~~~

With this setup, the command 'unattended-upgrade --debug --dry-run' give :
~~~
Paquets initialement sur la liste noire : kernel* linux-image* linux-server*
Démarrage du script de mise à niveau automatique
Les origines permises sont : ['origin=Debian', 'origin=Debian,label=Debian-Security', 'o=Debian,a=updates', 'o=Debian,a=proposed-updates']
Checking: apache2 (["<Origin component:'main' archive:'oldstable' origin:'Debian' label:'Debian-Security' site:'security.debian.org' isTrusted:True>"])
Checking: apache2-mpm-worker (["<Origin component:'main' archive:'oldstable' origin:'Debian' label:'Debian-Security' site:'security.debian.org' isTrusted:True>"])
...
~~~

The update is done, but the archive is forced at 'oldstable'.

#704087#55
Date:
2017-01-25 03:20:38 UTC
From:
To:
Dear Customer,

We can not deliver your parcel arrived at January 22.

Please review delivery label in attachment!

Thank you for making business with us,
Alex Giles,
USPS Parcels Delivery Agent.

#704087#60
Date:
2017-02-07 05:58:55 UTC
From:
To:
Dear Customer,



Your item has arrived at February 03, but our courier was not able to deliver the parcel.



Review the document that is attached to this e-mail!



Thank you for your assistance in this matter,

Shane Crane,

UPS Station Manager.

#704087#65
Date:
2026-07-31 12:36:07 UTC
From:
To:
n=... is supported in 0.80 and newer. Older versions did not get the
necessary changes. As none of those versions are supported anymore,
I'm closing this bug.