[Bug 2003543] Re: /usr/lib/update-notifier/package-data-downloader:KeyError:/usr/lib/update-notifier/package-data-downloader at 351:process_download_requests:trigger_update_notifier:substitute:convert
Andreas Hasenack
2003543 at bugs.launchpad.net
Thu Feb 2 17:48:53 UTC 2023
I verified the attached logs and am satisfied that they show the
executed planned test case, and that the results are correct.
The package built correctly in all architectures and Ubuntu releases it
was meant for.
There are no DEP8 regressions.
There is no SRU freeze ongoing at the moment.
There is a halted phasing on the previous update, which this upload here
is fixing.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/2003543
Title:
/usr/lib/update-notifier/package-data-
downloader:KeyError:/usr/lib/update-notifier/package-data-
downloader at 351:process_download_requests:trigger_update_notifier:substitute:convert
Status in update-notifier package in Ubuntu:
Fix Released
Status in update-notifier source package in Xenial:
Fix Committed
Status in update-notifier source package in Bionic:
Fix Committed
Status in update-notifier source package in Focal:
Fix Committed
Status in update-notifier source package in Jammy:
Fix Committed
Status in update-notifier source package in Kinetic:
Fix Committed
Bug description:
[Original Description]
The Ubuntu Error Tracker has been receiving reports about a problem regarding update-notifier. This problem was most recently seen with package version 3.192.60, the problem page at https://errors.ubuntu.com/problem/09c9352b62a3d0ae149fb2c93dbd80a2a84d4053 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/
[Impact]
If there is an error on the package-data-downloader script and the
user is using an affected locale, this traceback will appear and
prevent the user from seeing the real issue that is affecting the
script.
[Test Case]
You can replicate this issue by running the following script:
---------------------------------
#!/bin/bash
set -e
series=$1
name=$series-dev
cleanup () {
lxc delete $name --force
}
on_err () {
echo -e "Test Failed"
cleanup
exit 1
}
trap on_err ERR
lxc launch ubuntu-daily:$series $name
sleep 10
echo "#########################################"
echo "Installing latest version of update-notifier"
lxc exec $name -- apt-get update > /dev/null
lxc exec $name -- sudo apt-get install update-notifier-common -y > /dev/null
lxc exec $name -- apt-cache policy update-notifier-common
echo -e "#########################################\n"
echo "#########################################"
echo "Change locales to welsh"
lxc exec $name -- sh -c "DEBIAN_FRONTEND=noninteractive sudo apt-get install language-pack-cy -y > /dev/null"
lxc exec $name -- sudo update-locale LANG=cy_GB.UTF-8
lxc exec $name -- sudo reboot
sleep 5
lxc config set $name environment.LC_ALL=cy_GB.UTF-8
echo -e "#########################################\n"
echo "#########################################"
echo "Installing fonts package (verify stacktrace)"
lxc exec $name -- apt-get update > /dev/null
lxc exec $name -- apt-get -y --download-only install ttf-mscorefonts-installer
lxc config device add $name eth0 none
pkg_name=$(lxc exec $name -- ls /var/cache/apt/archives/ | grep ttf)
lxc exec $name -- sh -c "cd /var/cache/apt/archives; echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections"
lxc exec $name -- sh -c "dpkg -i /var/cache/apt/archives/$pkg_name || true"
lxc exec $name -- apt purge ttf-mscorefonts-installer -y > /dev/null
echo -e "#########################################\n"
lxc config device remove $name eth0
lxc exec $name -- sudo reboot
sleep 5
echo "#########################################"
echo "Update update-notifier package to proposed version"
lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list"
lxc exec $name -- sudo apt-get update > /dev/null
lxc exec $name -- sudo apt-get install update-notifier-common -y > /dev/null
lxc exec $name -- apt-cache policy update-notifier-common
echo -e "#########################################\n"
echo "#########################################"
echo "Installing fonts package (verify no error)"
lxc config device add $name eth0 none
lxc exec $name -- sh -c "cd /var/cache/apt/archives; echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections"
lxc exec $name -- sh -c "dpkg -i /var/cache/apt/archives/$pkg_name || true"
echo -e "#########################################\n"
echo "#########################################"
echo "Verify that file created by package-data-downloader has the \$package variable replaced"
if lxc exec $name -- grep -Fq "\$package" /var/lib/update-notifier/user.d/data-downloads-failed; then
echo "FAILURE: \$package variable found"
else
echo "SUCCESS: No \$package variable found"
fi
if lxc exec $name -- grep -Fq "ttf-mscorefonts-installer" /var/lib/update-notifier/user.d/data-downloads-failed; then
echo "SUCCESS: ttf-mscorefonts-installer appears in the file"
else
echo "FAILURE: ttf-mscorefonts-installer does not appear in the file"
fi
echo -e "#########################################\n"
cleanup
--------------------------------------------
Once the new package is in proposed, we can re-use this script to
verify that the traceback is no longer appearing.
[Discussion]
This error is being caused by an incorrectly translated variable in a template file. This template file is being used by the package-data-downloader script, which is delivered by the update-notifier-common
package. If the user is using one of the affected locales (i.e. cy_GB.UTF-8) and the user installs a package that triggers it (i.e. ttf-mscorefonts-installer) and the script fail somehow, the user will be presented with this stacktrace error.
The fix for this is to simply not translate the variable name in the
template file.
[Changelog]
* po/*.po: do not translate template variable needed for
package-data-downloader script
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2003543/+subscriptions
More information about the foundations-bugs
mailing list