screen became locked during release upgrade

Bug #1968607 reported by Brian Murray
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
Critical
Unassigned
Focal
Fix Released
Critical
Unassigned
Impish
Fix Released
Critical
Unassigned
Jammy
Fix Released
Critical
Unassigned

Bug Description

[Impact]

This bug prevents the screen lock inhibitor logic when the Gtk3 or KDE
frontends are used for release upgrades. This leaves users at risk of
encountering an issue where the lock screen cannot be unlocked, if it was
locked during upgrade.

This is needed in the stable releases because it affects upgrades to jammy.

[Test Plan]

To reproduce on impish or focal, do the following:

* For ease of testing, set your screen lock timeout to 1 minute.
* Start an upgrade to jammy using the Gtk3 frontend:

  $ do-release-upgrade -d -f DistUpgradeViewGtk3

* Click the 'Upgrade' button when the release notes are displayed. When
  prompted, click 'Start Upgrade'. Observe that there is no information message
  indicating the screen lock has been disabled (nor is there a message
  indicating that we failed to disable the screen lock).
* Idle long enough to allow the screen lock to kick in.

Note: dbus-monitor "interface=org.freedesktop.ScreenSaver" can also be used to
monitor any attempts to disable the screen lock.

[Where problems could occur]

This patch introduces new environment variables to the upgrade that were not
previously set when the KDE or Gtk3 frontends were used. Regressions could
occur if any existing code (besides the screen lock inhibitor code) had
different behavior based on these variables.

[Original Description]

I was upgrading from Ubuntu 21.10 to Ubuntu 22.04 this morning when my lock screen became enabled. My screen is set to blank after 5 minutes. Looking at the main release upgrade log file I noticed the following:

2022-04-11 06:55:10,389 INFO release-upgrader version '22.04.7' started
...
2022-04-11 06:58:10,297 DEBUG inhibit screensaver

Then in /var/log/auth.log I found:

Apr 11 07:06:24 godspeed gdm-password]: gkr-pam: unlocked login keyring

I don't recall when I last responded to a dialog from ubuntu-release-upgrader but I would guess it was around here:

2022-04-11 06:56:18,259 DEBUG About to apply the following changes

So that would only be a couple of minutes of inactivity before the screensaver was inhibited, so I don't think it worked. Additionally, I never saw a message about the screen lock being disabled.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-release-upgrader-core 1:22.04.8
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
CasperMD5CheckResult: pass
CrashDB: ubuntu
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 11 11:07:56 2022
InstallationDate: Installed on 2022-01-07 (94 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: ubuntu-release-upgrader
UpgradeStatus: Upgraded to jammy on 2022-04-11 (0 days ago)
VarLogDistupgradeTermlog:

Related branches

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

I have tested this with both the DistUpgradeViewGtk3 and DistUpgradeViewText frontends. Using Gtk3, the screen lock prevention code fails, and no failure is reported in the logs. Using the text frontend, the screen lock prevention code works as expected.

I believe the issue is that for the Gtk3 and KDE frontends, the dist-upgrade script is not invoked in a way that preserves the user's environment variables [1], namely `DBUS_SESSION_BUS_ADDRESS` etc. So, the DBus call fails and the failure is not reported because `XDG_SESSION_TYPE` is not set either [2].

[1] https://git.launchpad.net/ubuntu-release-upgrader/tree/do-release-upgrade#n221
[2] https://git.launchpad.net/ubuntu-release-upgrader/tree/DistUpgrade/DistUpgradeController.py#n2079

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

Per a conversation with Nick this will need to be fixed in `do-release-upgrade` which is shipped with the version of ubuntu-release-upgrader for the release from which you are upgrading and not in the dist-upgrader tarball. Subsequently, I'm opening tasks for Impish and Jammy as well.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Triaged
importance: Undecided → Critical
Changed in ubuntu-release-upgrader (Ubuntu Impish):
status: New → Triaged
Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: New → Triaged
tags: added: fr-2244
Changed in ubuntu-release-upgrader (Ubuntu Focal):
importance: Undecided → Critical
Changed in ubuntu-release-upgrader (Ubuntu Impish):
importance: Undecided → Critical
Changed in ubuntu-release-upgrader (Ubuntu Jammy):
milestone: none → ubuntu-22.04
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:22.04.9

---------------
ubuntu-release-upgrader (1:22.04.9) jammy; urgency=medium

  [ Nick Rosbrook ]
  * do-release-upgrade: Preserve env vars needed for screen lock prevention (LP: #1968607).
  * DistUpgrade/DistUpgradeController.py: Do not make UI dialog calls while
    EUID != 0.

  [ Brian Murray ]
  * Run pre-build.sh: updating mirrors, demotions, and translations.

 -- Brian Murray <email address hidden> Wed, 13 Apr 2022 14:30:37 -0700

Changed in ubuntu-release-upgrader (Ubuntu Jammy):
status: Triaged → Fix Released
Nick Rosbrook (enr0n)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted ubuntu-release-upgrader into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:21.10.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, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-release-upgrader (Ubuntu Impish):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-impish
Revision history for this message
Nick Rosbrook (enr0n) wrote :

I tested ubuntu-release-upgrader 1:21.10.9 from impish-proposed using the test plan above, and verified the fix works as expected.

tags: added: verification-done-impish
removed: verification-needed-impish
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted ubuntu-release-upgrader into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:20.04.38 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Nick Rosbrook (enr0n) wrote :

I tested ubuntu-release-upgrader 1:20.04.38 from focal-proposed using the test plan above, and verified the fix works as expected.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:21.10.9

---------------
ubuntu-release-upgrader (1:21.10.9) impish; urgency=medium

  * do-release-upgrade: Preserve env vars needed for screen lock prevention (LP: #1968607).
  * Run pre-build.sh: updating mirrors, demotions, and translations.

 -- Nick Rosbrook <email address hidden> Thu, 14 Apr 2022 12:56:05 -0400

Changed in ubuntu-release-upgrader (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ubuntu-release-upgrader has completed successfully and the package is now being 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 ubuntu-release-upgrader - 1:20.04.38

---------------
ubuntu-release-upgrader (1:20.04.38) focal; urgency=medium

  * do-release-upgrade: Preserve env vars needed for screen lock prevention (LP: #1968607).
  * Run pre-build.sh: updating translations.
  * Manually run utils/update_mirrors.py to update mirrors.

 -- Nick Rosbrook <email address hidden> Thu, 14 Apr 2022 13:21:35 -0400

Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Oli Wade (olithered) wrote :

To workaround (using loginctl) see this post: https://askubuntu.com/a/921726

Revision history for this message
pabouk (pabouk) wrote :

The bug does not seem to be fixed.

Today my screen locked (and could not have been unlocked) during a release upgrade from fully updated 20.04 to 22.04.1. After locking I was not allowed to enter my password.

From the text console I killed the GTK session process to be able to login to the system but only later I noticed that the jammy / dpkg processes did not finish yet and are hanging at prompt about what to do with changed /etc/sysctl.conf :(

I have not figured out yet how to successfully finish the upgrade.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I think it would be best to file a new bug for this.

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.