check-new-release-gtk crashed with ValueError in require_version(): Namespace Gtk is already loaded with version 4.0

Bug #1936698 reported by Brian Murray
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
Medium
Brian Murray
Hirsute
Fix Released
High
Brian Murray

Bug Description

Impact
------
check-new-release-gtk is crashing on Ubuntu 21.04 if gir1.2-gtk-4.0 is installed on the system and based off the number of crashes at the Ubuntu Error Tracker that seems to be a rather popular package. The crash would prevent users from being notified about Ubuntu 21.10 when it becomes available.

Test Case
---------
On an Ubuntu 21.04 system
1) sudo apt-get install gir1.2-gtk-4.0
2) Run /usr/lib/ubuntu-release-upgrader/check-new-release-gtk

Observe a Traceback with the contents

"check-new-release-gtk crashed with ValueError in require_version(): Namespace Gtk is already loaded with version 4.0"
or
"AttributeError(\"%r object has no attribute %r\" % (\nAttributeError: ''gi.repository.Gtk'' object has no attribute ''Container''"

Where Problems May Occur
------------------------
check-new-release-gtk could crash entirely if the additional code is incorrectly written (i.e. there's a syntax error) however the test case does cover that.

[Original Description]
ProblemType: Crash
DistroRelease: Ubuntu 21.10
Package: ubuntu-release-upgrader-gtk 1:21.10.4
ProcVersionSignature: Ubuntu 5.11.0-22.23-generic 5.11.21
Uname: Linux 5.11.0-22-generic x86_64
ApportVersion: 2.20.11-0ubuntu67
Architecture: amd64
CasperMD5CheckResult: unknown
CrashCounter: 1
CrashDB: ubuntu
CurrentDesktop: ubuntu:GNOME
Date: Fri Jul 16 14:19:22 2021
ExecutablePath: /usr/lib/ubuntu-release-upgrader/check-new-release-gtk
InstallationDate: Installed on 2016-01-22 (2002 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Alpha amd64 (20160117)
InterpreterPath: /usr/bin/python3.9
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/lib/ubuntu-release-upgrader/check-new-release-gtk
Python3Details: /usr/bin/python3.9, Python 3.9.6, python3-minimal, 3.9.4-1
PythonArgs: ['/usr/lib/ubuntu-release-upgrader/check-new-release-gtk']
PythonDetails: N/ASourcePackage: ubuntu-release-upgrader
Title: check-new-release-gtk crashed with ValueError in require_version(): Namespace Gtk is already loaded with version 4.0
UpgradeStatus: Upgraded to impish on 2021-07-16 (0 days ago)
UserGroups: adm cdrom dip libvirt libvirtd lpadmin lxd plugdev sambashare sudo
VarLogDistupgradeTermlog:

Revision history for this message
Brian Murray (brian-murray) wrote :
information type: Private → Public
tags: removed: need-duplicate-check
Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Brian Murray (brian-murray) wrote :

This will also produce a Traceback on Ubuntu 21.04 if gir1.2-gtk-4.0 is installed. In addition to the Traceback in comment #1 it can also produce the following one:

"Traceback (most recent call last):\n File \"/usr/lib/ubuntu-release-upgrader/check-new-release-gtk\", line 30, in <module>\n from gi.repository import Gtk\n File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 664, in _load_unlocked\n File \"<frozen importlib._bootstrap>\", line 627, in _load_backward_compatible\n File \"/usr/lib/python3/dist-packages/gi/importer.py\", line 145, in load_module\n dynamic_module = load_overrides(introspection_module)\n File \"/usr/lib/python3/dist-packages/gi/overrides/__init__.py\", line 118, in load_overrides\n override_mod = importlib.import_module(override_package_name)\n File \"/usr/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"/usr/lib/python3/dist-packages/gi/overrides/Gtk.py\", line 168, in <module>\n class Container(Gtk.Container, Widget):\n File \"/usr/lib/python3/dist-packages/gi/module.py\", line 123, in __getattr__\n raise AttributeError(\"%r object has no attribute %r\" % (\nAttributeError: ''gi.repository.Gtk'' object has no attribute ''Container''\n"

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → In Progress
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * check-new-release-gtk: use gi.require_version('Gtk', '3.0') to ensure we
    load the right version. (LP: #1936698)
  * Run pre-build.sh: updating mirrors, demotions, and translations.

 -- Brian Murray <email address hidden> Fri, 16 Jul 2021 16:01:02 -0700

Changed in ubuntu-release-upgrader (Ubuntu):
status: In Progress → Fix Released
description: updated
Changed in ubuntu-release-upgrader (Ubuntu Hirsute):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted ubuntu-release-upgrader into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:21.04.16 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-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. 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 Hirsute):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Brian Murray (brian-murray) wrote :

I tested this via an ssh connection and received the AttributeError from the description. I then installed the version of ubuntu-release-upgrader from -proposed and no longer received a traceback.

Do you want to continue? [Y/n] Y
Get:1 http://192.168.10.7/ubuntu hirsute-proposed/main amd64 ubuntu-release-upgrader-gtk all 1:21.04.16 [9,460 B]
Get:2 http://192.168.10.7/ubuntu hirsute-proposed/main amd64 ubuntu-release-upgrader-core all 1:21.04.16 [23.6 kB]
Get:3 http://192.168.10.7/ubuntu hirsute-proposed/main amd64 python3-distupgrade all 1:21.04.16 [102 kB]
Fetched 135 kB in 0s (1,792 kB/s)
(Reading database ... 194561 files and directories currently installed.)
Preparing to unpack .../ubuntu-release-upgrader-gtk_1%3a21.04.16_all.deb ...
Unpacking ubuntu-release-upgrader-gtk (1:21.04.16) over (1:21.04.11) ...
Preparing to unpack .../ubuntu-release-upgrader-core_1%3a21.04.16_all.deb ...
Unpacking ubuntu-release-upgrader-core (1:21.04.16) over (1:21.04.11) ...
Preparing to unpack .../python3-distupgrade_1%3a21.04.16_all.deb ...
Unpacking python3-distupgrade (1:21.04.16) over (1:21.04.11) ...
Setting up python3-distupgrade (1:21.04.16) ...
Setting up ubuntu-release-upgrader-core (1:21.04.16) ...
Setting up ubuntu-release-upgrader-gtk (1:21.04.16) ...
Processing triggers for man-db (2.9.4-2) ...
bdmurray@clean-hirsute-amd64:~$ /usr/lib/ubuntu-release-upgrader/check-new-release-gtk
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
WARNING:root:timeout reached, exiting

The "Unable to init server" message is due to the fact that I was connected via ssh.

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

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

---------------
ubuntu-release-upgrader (1:21.04.16) hirsute; urgency=medium

  * DistUpgrade/ReleaseAnnouncement, DistUpgrade/EOLReleaseAnnouncement:
    Update the irc channel server reference to Libera.Chat (LP: #1937852)
  * Run pre-build.sh: updating mirrors, demotions, and translations.

ubuntu-release-upgrader (1:21.04.15) hirsute; urgency=medium

  * check-new-release-gtk: use gi.require_version('Gtk', '3.0') to ensure we
    load the right version. (LP: #1936698)
  * tests/test_sources_list.py: use distro_info to set releases when
    performing some upgrade tests which fixes test failures when precise
    was moved to old-releases, additionally fix some tests for ports.
  * Run pre-build.sh: updating mirrors, demotions, and translations.

 -- Brian Murray <email address hidden> Mon, 26 Jul 2021 13:18:23 -0700

Changed in ubuntu-release-upgrader (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) 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.

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.