setting XDG RUNTIME to not 'tty' and SUDO_UID and PKEXEC_UID being unset causes TypeError traceback

Bug #2038900 reported by Tim Andersson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
Critical
Tim Andersson
Mantic
Fix Released
Critical
Tim Andersson

Bug Description

Running do-release-upgrade in an environment with XDG_RUNTIME set to something other than tty, and also in an environment where SUDO_UID and PKEXEC_UID are unset (e.g. ssh'd straight into a root session, no sudo) causes a TypeError traceback in the upgrade logs.

Reproducer:
lxc launch images:ubuntu/lunar --vm
lxc exec vmname bash
apt update
apt upgrade
export XDG_RUNTIME=unspecified
do-release-upgrade -d -f -f DistUpgradeViewNonInteractive

None will eventually be printed, then you can go to the upgrade log and find the traceback.

Revision history for this message
Tim Andersson (andersson123) wrote :
Changed in ubuntu-release-upgrader (Ubuntu Mantic):
milestone: none → ubuntu-23.10
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Tim Andersson (andersson123)
Revision history for this message
Tim Andersson (andersson123) wrote :
Changed in ubuntu-release-upgrader (Ubuntu Mantic):
status: In Progress → Fix Committed
Revision history for this message
Nick Rosbrook (enr0n) wrote :

This looks fine for the mantic release, but for future development can you please share the actual traceback you observed?

Revision history for this message
Nick Rosbrook (enr0n) wrote :

Oh nevermind, I see it now. FWIW, the "correct" fix for this is to just extend the try/except block that converts uid to int. It should also catch "TypeError", or the getenv call for PKEXEC_UID should have a fallback of '', which would trigger ValueError instead.

Revision history for this message
Tim Andersson (andersson123) wrote :

I had initially implemented that but there were disagreements that this was the best approach. Either way we can potentially amend for the naughty release

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

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

---------------
ubuntu-release-upgrader (1:23.10.10) mantic; urgency=medium

  * Fix failing autopkgtest due to PEP8 line to long issue.
  * Run pre-build.sh: updating po files, mirrors, and demotions.

ubuntu-release-upgrader (1:23.10.9) mantic; urgency=medium

  [ Tim Andersson ]
  * fix: stop TypeError traceback in DistUpgradeQuirks:_set_generic_font
    (LP: #2038900)

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

  [ Gunnar Hjalmarsson ]
  * Temporary font for Ubuntu MATE (LP: #2034986)

 -- Brian Murray <email address hidden> Wed, 11 Oct 2023 04:48:13 -0700

Changed in ubuntu-release-upgrader (Ubuntu Mantic):
status: Fix Committed → Fix Released
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.