dbus was stopped during today's jammy update, breaking desktop

Bug #1962036 reported by Julian Andres Klode
70
This bug affects 13 people
Affects Status Importance Assigned to Milestone
dbus (Ubuntu)
Fix Released
Critical
Dave Jones
Jammy
Fix Released
Critical
Dave Jones

Bug Description

Impact: logind stopped, so desktop stopped, ssh stopped, got no getty. Had to hard reset.

Today's jammy upgrade stopped dbus at 19:46:27

Feb 23 19:46:27 jak-t480s systemd[1]: Stopping D-Bus System Message Bus...

This should not happen. I don't know which package caused this, but presumably dbus should not be stoppable in the first place.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: dbus 1.12.20-2ubuntu3
ProcVersionSignature: Ubuntu 5.15.0-22.22-generic 5.15.19
Uname: Linux 5.15.0-22-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu78
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Wed Feb 23 20:03:41 2022
InstallationDate: Installed on 2018-03-14 (1442 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180313)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: dbus
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

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

dpkg.log from that run

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

The attached /var/log/apt/term.log does not show anything suspicious

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

I did not find interesting journalctl, maybe someone else is luckier.

Revision history for this message
Paul White (paulw2u) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in dbus (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Murray (alexmurray) wrote :

I hit this too - just reported https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1962127 from the associated gnome-shell crash.

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

Removing the duplicate, because while the other bugs focus on the crashes, this one focuses on dbus stopping. I don't think the crashes matter, fwiw, dbus should not be stopping in the first place, there's no way to gracefully recover from that.

Changed in dbus (Ubuntu):
importance: Undecided → Critical
tags: added: rls-jj-incoming
Changed in dbus (Ubuntu):
milestone: none → ubuntu-22.04
status: Confirmed → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

Testing impish to jammy upgrades the graphical session closes just after having the dbus packages updated, same with xubuntu. The different segfaults in graphical components are probably side effects of dbus or xorg going away under their feet

tags: added: fr-2162
Revision history for this message
Sebastien Bacher (seb128) wrote (last edit ):

The issue seems to be due to the dbus package

$ cat /var/lib/dpkg/info/dbus.preinst
...
# Automatically added by dh_installsystemd/13.6ubuntu1
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
 deb-systemd-invoke stop 'dbus.service' 'dbus.socket' >/dev/null || true
fi
# End automatically added section

shouldn't have that been resolved by https://launchpad.net/ubuntu/+source/dbus/1.12.20-2ubuntu3 ?

Dave Jones (waveform)
Changed in dbus (Ubuntu Jammy):
assignee: nobody → Dave Jones (waveform)
Revision history for this message
Dave Jones (waveform) wrote :

Attaching debdiff which I believe should prevent the service from being stopped on upgrade. Test packages are currently building in ppa:waveform/dbus (https://launchpad.net/~waveform/+archive/ubuntu/dbus) but I've already built locally and verified that the offending portion of the preinst maintscript is gone.

Ultimately this is down to a mis-understanding of debhelper's start/restart options (which are unfortunately named, and in my opinion insufficiently documented -- something I'll try and post a patch for upstream):

In Ubuntu (several releases back) we'd altered the dh_installsystemd options for dbus (in d/rules) to "--no-start" intending the service to be activated solely via dbus.socket. Unfortunately, just specifying "--no-start" tells debhelper you don't want the service started, but it still implies that you wish the service to be *restarted* (if it's running) during upgrade. You must *additionally* specify "--no-stop-on-upgrade" (formerly known as "--no-restart-on-upgrade", and not to be confused with "--no-restart-after-upgrade") if you do not want it restarted.

Debian have also (more recently) adjusted their dh_installsystemd options for dbus (for different reasons), so this will also need patching upstream (I'll try and open a bug for this and associate it with this one as it's all the same options affected at the end of the day).

Revision history for this message
Dave Jones (waveform) wrote :

Some additional info:

"dh_installsystemd --no-start" on its own is *not* equivalent to "--no-start --restart-after-upgrade" as one might imagine ("--restart-after-upgrade" is *usually* the dh_installsystemd default). Instead "--no-start" adjusts the restart default to "--no-restart-after-upgrade" (I'm now *fairly* convinced this is actually a bug). Unfortunately "--no-restart-after-upgrade" cannot work with "--no-start" because, whilst the preinst script will always stop the service, the postinst script won't attempt to start it again because "--no-start" is specified.

Even if dh_installsystemd did try to be more intelligent, I'm not convinced this combination can ever work in all circumstances: the postinst maintscript cannot know whether the service was running prior to the preinst script stopping it because the idempotency requirement for maintscripts implies that postinst is not necessarily running immediately after preinst.

In other words, "--no-start --no-restart-after-upgrade" (or "--no-start" on its own which is equivalent) is a broken combination which does not (and probably cannot, at least with the current design) work.

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

I sponsored this, thanks!

tags: removed: rls-jj-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dbus - 1.12.20-2ubuntu4

---------------
dbus (1.12.20-2ubuntu4) jammy; urgency=medium

  * Prevent dbus from being restarted on upgrade (LP: #1962036)

 -- Dave Jones <email address hidden> Fri, 01 Apr 2022 18:02:54 +0100

Changed in dbus (Ubuntu Jammy):
status: Triaged → Fix Released
Revision history for this message
DLCBurggraaff (burdi) wrote :

With this fix my upgrade Xubuntu 20.04.4 => 22.04 completed.
There was a non-fatal hiccup for Firefox converting to snap.
Reviewing the new instance ...
:D

Revision history for this message
Paul Szabo (psz-maths) wrote :

I wonder whether my problem is this bug 1962036, or something else.
Problem while upgrading impish to jammy: screen showing just
background (no windows), moving/clicking mouse eliciting the
"wait" cursor momentarily.
Fixed by hard reset, boot to "recovery" console, and used:
  dpkg --configure -a
  apt dist-upgrade
  shutdown -r now

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1962036

tags: added: iso-testing
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.