Cronjob /etc/cron.daily/update-notifier-common sends too many e-mail messages

Bug #1641671 reported by Jonathan Kamens
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Confirmed
High
Unassigned
update-notifier (Ubuntu)
Fix Released
High
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Artful
Fix Released
Undecided
Unassigned
Bionic
Fix Released
High
Unassigned

Bug Description

[Impact]
Noisy cron job for no-change processing

[Test case]
1. Install ttf-mscorefonts-installer, deny license
2. Run /etc/cron.daily/update-notifier-common

Should not show a processing message for it.

[Regression potential]
Error messages might be a bit harder to read.

[Original bug report]
I'm getting this over and over and over in email:

Subject: Anacron job 'cron.daily' on [hostname]

/etc/cron.daily/update-notifier-common:
ttf-mscorefonts-installer: processing...

That's the whole message.

Please make it stop. ;-)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ttf-mscorefonts-installer 3.4+nmu1ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-47.68-generic 4.4.24
Uname: Linux 4.4.0-47-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Nov 14 12:04:53 2016
InstallationDate: Installed on 2016-01-16 (303 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
PackageArchitecture: all
SourcePackage: msttcorefonts
UpgradeStatus: Upgraded to xenial on 2016-04-28 (200 days ago)

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

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

Changed in msttcorefonts (Ubuntu):
status: New → Confirmed
Revision history for this message
mk (mk.pmb) wrote :

I tried to debug it, but the coding style of /usr/lib/msttcorefonts/update-ms-fonts lead me to decide I'll rather uninstall the ttf-mscorefonts-installer after initial system setup. I'll uninstall it now and expect the mail messages will end then.

Revision history for this message
mk (mk.pmb) wrote :

PS: Uninstalling the installer also removed the fonts from
/usr/share/fonts/truetype/msttcorefonts , so make backup
before you uninstall it.

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

The processing message actually comes from update-notifier-common which is provided by update-notifier.

affects: msttcorefonts (Ubuntu) → update-notifier (Ubuntu)
Revision history for this message
Roman Odaisky (to-roma-from-lp) wrote :

I suggest removing the print() call that outputs the message in question from /usr/lib/update-notifier/package-data-downloader. This script isn’t meant to be run interactively anyway.

Changed in update-notifier (Ubuntu):
importance: Undecided → High
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Lithi (lithi) wrote :

Confirmed also have this bug on a 16.04 system. Installed the <a href="https://packages.debian.org/sid/all/ttf-mscorefonts-installer/download">Debian package</a> as a fix as per recommendation.

Revision history for this message
Adrien Beau (adrienbeau) wrote :

The core issue is that ttf-mscorefonts-installer files are repeatedly failing to download, so you are repeatedly emailed about it. (The email sure could be improved.)

update-notifier handles the downloads, but the actual downloads are performed by apt-helper, and that program has trouble following redirects with spaces in the URL and handling files that already exist on the target machine.

Have a look at the following bug report about that: https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1655431

Revision history for this message
Jonathan Kamens (jik) wrote :

That's not actually the core issue at this point. The core issue at this point is that the end-user license hasn't been accepted and there's no way to accept it. See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1655431/comments/12 .

Revision history for this message
Roman Odaisky (to-roma-from-lp) wrote :

That is not the core issue either. I, for example, have declined to accept the license on purpose (I dislike the fonts and I prefer them not to be installed even if some package suggests this one as a dependency), yet I get the message.

As I said above, both print() statements in the /usr/lib/update-notifier/package-data-downloader script make no sense unless the script is run interactively.

Attaching a patch.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "upd-not-shut-up.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
tags: added: rls-bb-incoming
Steve Langasek (vorlon)
tags: removed: rls-bb-incoming
Revision history for this message
Sjors Gielen (sgielen) wrote :

Am also experiencing this from about 30 Ubuntu 16.04 machines in our office. We get very regular e-mails that the flash plugin was updated, and there's no "normal" way to silence them. As a workaround, we change /etc/cron.daily/update-notifier-common to send its output to `/dev/null`, but this will be rolled back with an change of update-notifier.

I think that the last patch, posted by Roman Odaisky, will fix part of the issue. However, for the Flash player, at some point, `apt` is called which also produces output that is e-mailed in cron. It might be best to just change the cronjob to redirect its output (perhaps also stderr) to some log file.

summary: - "ttf-mscorefonts-installer: processing..." email message repeatedly from
- /etc/cron.daily/update-notifier-common
+ Cronjob /etc/cron.daily/update-notifier-common sends too many e-mail
+ messages
Revision history for this message
Sjors Gielen (sgielen) wrote :

Here's some example output from the cronjob regarding installation of the flash plugin:

flashplugin-installer: processing...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_20180206.1.orig.tar.gz
Get:1 http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_20180206.1.orig.tar.gz [30,5 MB]
Fetched 30,5 MB in 6s (4798 kB/s)
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/adobe-flashplugin_20180206.1.orig.tar.gz' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
Installing from local file /var/lib/update-notifier/package-data-downloads/partial/adobe-flashplugin_20180206.1.orig.tar.gz
Flash Plugin installed.

tags: added: id-5ab94cc95a45b83e2515fe9c
Revision history for this message
Juancho (juan-baptiste-0) wrote :

Still see it on 17.10.

Revision history for this message
Juancho (juan-baptiste-0) wrote :

Sorry, wrong version, it is 16.04.4, but the curious thing is that this happens only on one (the latest installed one a month ago, the other 7 have months online) of 8 16.04 servers, the other 7 don't send these notifications. What could be different between servers ?

Revision history for this message
Julian Andres Klode (juliank) wrote :

Roman: I think that installing an installer package and not accepting its license is not a valid combination. Either accept the license or remove the installer package. There's no point having an installer package installed and not accepting its license.

Sjors: Having notifications about scripts that actually download anything seems useful to me. That said, you can of course also directly install the adobe-flashplugin package from the partner repo instead.

I can see the argument for not printing "processing" lines if we don't actually do anything; but if we actually do anything, I think we should print that - I'd want to know if third-party files are downloaded and installed somewhere in my system.

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

This bug was fixed in the package update-notifier - 3.192.5

---------------
update-notifier (3.192.5) cosmic; urgency=medium

  * Fix PEP8 errors

update-notifier (3.192.4) cosmic; urgency=medium

  * package-data-downloader: Only print processing messages if we
    should download stuff, or if an expected exception occured
    (LP: #1641671)

 -- Julian Andres Klode <email address hidden> Tue, 29 May 2018 09:38:23 +0200

Changed in update-notifier (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sjors Gielen (sgielen) wrote :

Julian - That sounds fair. Thanks for your solution!

Changed in update-notifier (Ubuntu Bionic):
status: Confirmed → In Progress
description: updated
Changed in update-notifier (Ubuntu Artful):
status: New → Triaged
Changed in update-notifier (Ubuntu Xenial):
status: New → Triaged
Revision history for this message
Robie Basak (racb) wrote :

During SRU verification, could you please also verify the code path that leads to "print_maybe("%s: Error processing!" % (relfile))"?

Changed in update-notifier (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Jonathan, or anyone else affected,

Accepted update-notifier into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.1.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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, details of your testing will help us make a better decision.

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

Changed in update-notifier (Ubuntu Artful):
status: Triaged → Fix Committed
tags: added: verification-needed-artful
Revision history for this message
Robie Basak (racb) wrote :

Hello Jonathan, or anyone else affected,

Accepted update-notifier into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.186.3 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-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

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

Changed in update-notifier (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Robie Basak (racb) wrote :

Hello Jonathan, or anyone else affected,

Accepted update-notifier into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.168.9 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, details of your testing will help us make a better decision.

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

Revision history for this message
Julian Andres Klode (juliank) wrote :

bionic (3.192.1->3.192.1.1) validated OK:

+ lxc launch -e ubuntu:bionic lp1641671-bionic
Creating lp1641671-bionic
Starting lp1641671-bionic
+ lxc exec lp1641671-bionic -- sh -c 'add-apt-repository multiverse && sleep 10 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -q -y install ttf-mscorefonts-installer'
+ lxc exec lp1641671-bionic -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.192.1
ttf-mscorefonts-installer: processing...
+ lxc exec lp1641671-bionic -- sh -c 'echo deb http://archive.ubuntu.com/ubuntu bionic-proposed main >> /etc/apt/sources.list && apt-get update && apt-get install update-notifier-common'
dpkg-preconfigure: unable to re-open stdin: No such file or directory
+ lxc exec lp1641671-bionic -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.192.1.1
+ lxc stop lp1641671-bionic

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Julian Andres Klode (juliank) wrote :

artful (3.186.2 -> 3.186.3) and xenial (3.168.8->3.189.9) too

$ bash rep artful
+ lxc launch -e ubuntu:artful lp1641671-artful
Creating lp1641671-artful
Starting lp1641671-artful
+ lxc exec lp1641671-artful -- sh -c 'add-apt-repository multiverse && sleep 10 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -q -y install ttf-mscorefonts-installer'
+ lxc exec lp1641671-artful -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.186.2
ttf-mscorefonts-installer: processing...
+ lxc exec lp1641671-artful -- sh -c 'echo deb http://archive.ubuntu.com/ubuntu artful-proposed main >> /etc/apt/sources.list && apt-get update && apt-get install update-notifier-common'
dpkg-preconfigure: unable to re-open stdin: No such file or directory
+ lxc exec lp1641671-artful -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.186.3
+ lxc stop lp1641671-artful
$ bash rep xenial
+ lxc launch -e ubuntu:xenial lp1641671-xenial
Creating lp1641671-xenial
Starting lp1641671-xenial
+ lxc exec lp1641671-xenial -- sh -c 'add-apt-repository multiverse && sleep 10 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -q -y install ttf-mscorefonts-installer'
+ lxc exec lp1641671-xenial -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.168.8
ttf-mscorefonts-installer: processing...
+ lxc exec lp1641671-xenial -- sh -c 'echo deb http://archive.ubuntu.com/ubuntu xenial-proposed main >> /etc/apt/sources.list && apt-get update && apt-get install update-notifier-common'
dpkg-preconfigure: unable to re-open stdin: No such file or directory
+ lxc exec lp1641671-xenial -- sh -c 'apt-cache policy update-notifier-common | grep Installed && /etc/cron.daily/update-notifier-common'
  Installed: 3.168.9
+ lxc stop lp1641671-xenial

tags: added: verification-done verification-done-artful verification-done-xenial
removed: verification-needed verification-needed-artful verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.1.1

---------------
update-notifier (3.192.1.1) bionic; urgency=medium

  * package-data-downloader: Only print processing messages if we
    should download stuff, or if an expected exception occured
    (LP: #1641671)

 -- Julian Andres Klode <email address hidden> Mon, 18 Jun 2018 16:11:40 +0200

Changed in update-notifier (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for update-notifier has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package update-notifier - 3.186.3

---------------
update-notifier (3.186.3) artful; urgency=medium

  * package-data-downloader: Only print processing messages if we
    should download stuff, or if an expected exception occured
    (LP: #1641671)

 -- Julian Andres Klode <email address hidden> Mon, 18 Jun 2018 16:40:54 +0200

Changed in update-notifier (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.168.9

---------------
update-notifier (3.168.9) xenial; urgency=medium

  * package-data-downloader: Only print processing messages if we
    should download stuff, or if an expected exception occured
    (LP: #1641671)

 -- Julian Andres Klode <email address hidden> Mon, 18 Jun 2018 16:40:54 +0200

Changed in update-notifier (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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