Subject: apt-listchanges: apt update hangs if no mail system
Package: apt-listchanges
Version: 3.10
Tags: patch
Justification: breaks unrelated software
Severity: critical



-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-listchanges depends on:
ii  apt                    1.4.8
ii  debconf [debconf-2.0]  1.5.61
ii  debianutils            4.8.1.1
ii  python3                3.5.3-1
ii  python3-apt            1.4.0~beta3
ii  ucf                    3.0036

apt-listchanges recommends no packages.

Versions of packages apt-listchanges suggests:
ii  citadel-server [mail-transport-agent]  902-4
pn  python3-gi                             <none>
pn  www-browser                            <none>
pn  x-terminal-emulator                    <none>

-- debconf information:
  apt-listchanges/frontend: pager
  apt-listchanges/which: news
  apt-listchanges/confirm: false
  apt-listchanges/email-address: root
  apt-listchanges/save-seen: true


-- Desription of problem:
When performing a apt update today (Monday, September 10, 2018) there was a news bit about the Apache/2 package that required reading and confirmation. Upon confirmation the apt-listchanges script returned to attempt to send mail to the configured user email (which is just 'root' in this case.)

IF a system either does not have a mail service installed or is impropery configured, apt-listchanges will hang while attempting to send an email before it allows the update process to continue.

Ctrl-c breaks the hang as expected but also breaks the update process leaving the system in a broken state, unable to update itself.

--BEGIN console output --

Get:70 http://ftp.us.debian.org/debian stretch/main amd64 libapache2-mod-php7.0 amd64 7.0.30-0+deb9u1 [1,225 kB] Get:71 http://ftp.us.debian.org/debian stretch/main amd64 php7.0-common amd64 7.0.30-0+deb9u1 [877 kB] Get:72 http://ftp.us.debian.org/debian stretch/main amd64 patch amd64 2.7.5-1+deb9u1 [112 kB] Get:73 http://ftp.us.debian.org/debian stretch/main amd64 php7.0 all 7.0.30-0+deb9u1 [53.4 kB] Get:74 http://ftp.us.debian.org/debian stretch/main amd64 shared-mime-info amd64 1.8-1+deb9u1 [731 kB]
Fetched 73.6 MB in 22s (3,309 kB/s)
Reading changelogs... Done
apt-listchanges: Mailing root: apt-listchanges: news for GX520



^CE: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 received signal 2.
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10

--END console output --


** I was able to work around this by editing the apt-listchanges script file by commenting out the offending Mail section as follows:

-- BEGIN snippet --

    if news or changes:
        apt_listchanges.confirm_or_exit(config, frontend)

        hostname = subprocess.getoutput('hostname')

#        if apt_listchanges.can_send_emails(config):
#            if changes:
#                subject = _("apt-listchanges: changelogs for %s") % hostname
#                apt_listchanges.mail_changes(config, changes, subject)

#            if news:
#                subject = _("apt-listchanges: news for %s") % hostname
#                apt_listchanges.mail_changes(config, news, subject)

---END snippet --

Running apt update after this change still allows the News flash and confirm dialog, and then continues / completes the system updates as normal.

As with the other related 'Wishlist' bug reports for apt-listchanges, there should be additional prompts added to this file to:

(1) Ask if the user wants to mail a report (default N). - Also notify user that the process may hang if no mail subsystem exists (which I believe is now the case starting with stretch) or is improperly configured. (Just 'root')

(2) See other 3 reports related to MAIL for additional prompt suggestions.


- Thank you -

Reply via email to