unattended-upgrades triggers reboot despite configuration

Bug #1887655 reported by Philip Couling
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I've been having problems with my Ubuntu machine suddenly rebooting without any warning. To my knowledge Ubuntu Desktop is not supposed to reboot without warning by default.

I believe this is being triggered by unattended-upgrades

unattended-upgrades 2.3 (amd64)

Ubuntu Desktop:
Description: Ubuntu 20.04 LTS
Release: 20.04

One pattern that emerges is that the reboot happens right after unattended-upgrades completes successfully. There are multiple examples in my /var/log/syslog, but all show "unattended-upgrades.service: Succeeded." the same second everything begins to shut down, with nothing for a minute or two prior. Example:

Jul 15 11:17:01 pc systemd[2065]: Starting Notification regarding a new release of Ubuntu...
Jul 15 11:17:14 pc charon: 08[IKE] sending keep alive to 10.10.10.10[4500]
Jul 15 11:17:22 pc check-new-release-gtk[71843]: /usr/lib/ubuntu-release-upgrader/check-new-release-gtk:30: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk'
, '3.0') before import to ensure that the right version gets loaded.
Jul 15 11:17:22 pc check-new-release-gtk[71843]: from gi.repository import Gtk
Jul 15 11:17:22 pc check-new-release-gtk[71843]: WARNING:root:timeout reached, exiting
Jul 15 11:17:22 pc systemd[2065]: update-notifier-release.service: Succeeded.
Jul 15 11:17:22 pc systemd[2065]: Finished Notification regarding a new release of Ubuntu.
Jul 15 11:17:48 pc mysql-workbench[33350]: gtk_tree_view_unref_tree_helper: assertion 'node != NULL' failed
Jul 15 11:17:54 pc charon: 09[IKE] sending keep alive to 10.10.10.10[4500]
Jul 15 11:18:03 pc systemd[1]: unattended-upgrades.service: Succeeded.
Jul 15 11:18:03 pc systemd[1]: Stopping Session 3 of user philip.
Jul 15 11:18:03 pc systemd[1]: Removed slice system-clean\x2dmount\x2dpoint.slice.
Jul 15 11:18:03 pc systemd[1]: Removed slice system-getty.slice.
Jul 15 11:18:03 pc systemd[1]: Removed slice system-modprobe.slice.
Jul 15 11:18:03 pc systemd[1]: Stopped target Block Device Preparation for /dev/mapper/ubuntu.
Jul 15 11:18:03 pc systemd[2065]: Stopped target GNOME Wayland Session (session: gnome).

From memory I've never edited the contents of /etc/apt/apt.conf.d/ and the configuration for unattended upgrades claims to be default (NOT to reboot):

$ grep -irnC4 reboot /etc/apt/apt.conf.d/
/etc/apt/apt.conf.d/50unattended-upgrades-88-// Do automatic removal of unused packages after the upgrade
/etc/apt/apt.conf.d/50unattended-upgrades-89-// (equivalent to apt-get autoremove)
/etc/apt/apt.conf.d/50unattended-upgrades-90-//Unattended-Upgrade::Remove-Unused-Dependencies "false";
/etc/apt/apt.conf.d/50unattended-upgrades-91-
/etc/apt/apt.conf.d/50unattended-upgrades:92:// Automatically reboot *WITHOUT CONFIRMATION* if
/etc/apt/apt.conf.d/50unattended-upgrades:93:// the file /var/run/reboot-required is found after the upgrade
/etc/apt/apt.conf.d/50unattended-upgrades:94://Unattended-Upgrade::Automatic-Reboot "false";
/etc/apt/apt.conf.d/50unattended-upgrades-95-
/etc/apt/apt.conf.d/50unattended-upgrades:96:// Automatically reboot even if there are users currently logged in
/etc/apt/apt.conf.d/50unattended-upgrades:97:// when Unattended-Upgrade::Automatic-Reboot is set to true
/etc/apt/apt.conf.d/50unattended-upgrades:98://Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
/etc/apt/apt.conf.d/50unattended-upgrades-99-
/etc/apt/apt.conf.d/50unattended-upgrades:100:// If automatic reboot is enabled and needed, reboot at the specific
/etc/apt/apt.conf.d/50unattended-upgrades-101-// time instead of immediately
/etc/apt/apt.conf.d/50unattended-upgrades-102-// Default: "now"
/etc/apt/apt.conf.d/50unattended-upgrades:103://Unattended-Upgrade::Automatic-Reboot-Time "02:00";
/etc/apt/apt.conf.d/50unattended-upgrades-104-
/etc/apt/apt.conf.d/50unattended-upgrades-105-// Use apt bandwidth limit feature, this example limits the download
/etc/apt/apt.conf.d/50unattended-upgrades-106-// speed to 70kb/sec
/etc/apt/apt.conf.d/50unattended-upgrades-107-//Acquire::http::Dl-Limit "70";

journalctl -u unattended-upgrades

Jul 10 07:52:31 PC systemd[1]: Started Unattended Upgrades Shutdown.
Jul 14 10:03:03 PC systemd[1]: unattended-upgrades.service: Succeeded.
-- Reboot --
Jul 14 10:04:11 PC systemd[1]: Started Unattended Upgrades Shutdown.
Jul 15 11:18:03 PC systemd[1]: unattended-upgrades.service: Succeeded.
-- Reboot --
Jul 15 11:19:10 PC systemd[1]: Started Unattended Upgrades Shutdown.

It's not clear to me what other information I can offer to help.

Philip Couling (couling)
description: updated
summary: - unattended-upgrades triggers reboot without configuration
+ unattended-upgrades triggers reboot despite configuration
description: updated
description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

What is the output of:

apt-config dump | grep Reboot

?

Changed in unattended-upgrades (Ubuntu):
status: New → Incomplete
Revision history for this message
Philip Couling (couling) wrote :

sudo apt-config dump | grep -i reboot

Yielded no lines.

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
Revision history for this message
Andy Kasp (ipandka) wrote :
Download full text (4.9 KiB)

Hi, why this has expired without any confirmation/non-confirmation? This sounds like a terrible way to resolve bugs?!

I just had the same on a pretty vanilla 20.04 server which kernel was/is compiled Nov 13 11:40:37 UTC 2020.

below command returns nothing:
apt-config dump | grep Reboot

also:
fgrep -i reboot /etc/apt/apt.conf.d/50unattended-upgrades
// Automatically reboot *WITHOUT CONFIRMATION* if
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false";
// Automatically reboot even if there are users currently logged in
// when Unattended-Upgrade::Automatic-Reboot is set to true
//Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
// If automatic reboot is enabled and needed, reboot at the specific
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";

The only way I found out about this reboot was by looking into /var/log/syslog
Mar 5 12:57:44 ip-192-168-141-181 systemd[1]: unattended-upgrades.service: Succeeded.

After reboot I see packages are still pending so unlikely have updated anything:

The following NEW packages will be installed:
  amd64-microcode intel-microcode iucode-tool linux-aws-headers-5.4.0-1038 linux-headers-5.4.0-1038-aws linux-image-5.4.0-1038-aws linux-modules-5.4.0-1038-aws microcode-initrd python3-pexpect python3-ptyprocess
The following packages will be upgraded:
  alsa-ucm-conf apt apt-utils base-files bind9-dnsutils bind9-host bind9-libs bolt bsdutils busybox-initramfs busybox-static cloud-init containerd cryptsetup cryptsetup-bin cryptsetup-initramfs cryptsetup-run dirmngr docker.io ec2-hibinit-agent ec2-instance-connect
  fdisk finalrd friendly-recovery gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grub-common grub-pc grub-pc-bin grub2-common initramfs-tools initramfs-tools-bin initramfs-tools-core jq language-selector-common
  libapt-pkg6.0 libasound2 libasound2-data libblkid1 libc-bin libc6 libcryptsetup12 libdrm-common libdrm2 libefiboot1 libefivar1 libfdisk1 libglib2.0-0 libglib2.0-bin libglib2.0-data libjq1 libmount1 libnetplan0 libnss-systemd libpam-systemd libparted2 libplymouth5
  libruby2.7 libsmartcols1 libsystemd0 libudev1 libuuid1 linux-aws linux-headers-aws linux-image-aws locales lshw lsof mdadm motd-news-config mount netplan.io open-vm-tools parted plymouth plymouth-theme-ubuntu-text pollinate python-apt-common python3-apt
  python3-distupgrade python3-software-properties python3-twisted python3-twisted-bin python3-update-manager ruby2.7 software-properties-common sosreport systemd systemd-sysv systemd-timesyncd ubuntu-release-upgrader-core udev update-manager-core
  update-notifier-common util-linux uuid-runtime zlib1g
105 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 142 MB of archives.
After this operation, 172 MB of additional disk space will be used.

/var/log/dpkg.log empty today (05-Mar-2021)
latest entries
2021-02-26 06:04:04 trigproc install-info:amd64 6.7.0.dfsg.2-5 <none>
2021-02-26 06:04:04 status half-configured install-info:amd64 6.7.0.dfsg.2-5
2021-02-26 06:04:04 status installed install-info:amd64 6.7.0.dfsg.2-5
2021-02-26 06:04:04 trigproc syst...

Read more...

Revision history for this message
Andy Kasp (ipandka) wrote :

As this is server such thing is quite unbelievably bad, is then the only way in production to remove this package altogether. Its not ideal for Ubuntu reputation for servers indeed.

Changed in unattended-upgrades (Ubuntu):
status: Expired → New
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
Matt Andrews (moybius) wrote :

Confirming that we see this behaviour on Ubuntu 20.04 servers (reboots happening even though `Unattended-Upgrade::Automatic-Reboot` is set to false).

Revision history for this message
Roman Smid (smid-v) wrote :

I can confirm this behavior on our server with Ubuntu Server 20.04. The occurence is random and the symptoms and log information is the same.

Revision history for this message
Michael Redstall (mredst) wrote (last edit ):

Also seeing this issue on 20.04. Same behaviour as above (occurence is random and the symptoms and log information is the same).

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.