[SRU] pychess is broken in Jammy

Bug #1959523 reported by Nicholaus Shupe
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pychess (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

pychess is completely unusable as it will fail to start and will give error while trying to start the splash screen.

The error:

/usr/games/pychess:17: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk
Failed to create splash screen
ERROR: Not all dependencies installed! You can find them in INSTALL
Namespace Gdk is already loaded with version 4.0

[ Test Plan ]

* Execute pychess, which will fail to start if its not fixed.
* With the fixed package, pychess will start and we can play a small game of chess to verify it works.

[ Where problems could occur ]

This is an upstream patch and is not changing any part of the code. Its only specifying the Gtk version that should be loaded. Since the screen is displayed with this change the chances of regression are very small.

[ Other Info ]

 * It has been fixed by upstream in v1.0.1 and so later releases after Jammy are not affected.

[ Original Bug Description ]

Running from the command-line:

/usr/games/pychess:17: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk
Failed to create splash screen
ERROR: Not all dependencies installed! You can find them in INSTALL
Namespace Gdk is already loaded with version 4.0

Really quick, just adding that line results in a situation where pychess just won't work with Python 3.9 that's installed. I tried adding Python 3.7 with deadsnakes to try that out, but their jammy repo isn't up yet.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: pychess 1.0.0-1.2
ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
Uname: Linux 5.15.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu76
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Jan 30 12:51:37 2022
InstallationDate: Installed on 2022-01-27 (2 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: pychess
UpgradeStatus: Upgraded to jammy on 2022-01-28 (2 days ago)

Revision history for this message
Nicholaus Shupe (nicholaus-shupe) wrote :
Revision history for this message
Nicholaus Shupe (nicholaus-shupe) wrote :

Should probably pull in the latest version from here: https://github.com/pychess/pychess/releases

python3-pychess_1.0.3-1_all.deb seems to work fine.

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

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

Changed in pychess (Ubuntu):
status: New → Confirmed
Revision history for this message
RavanH (ravanhagen) wrote :

> python3-pychess_1.0.3-1_all.deb seems to work fine.

After installing stockfish manually, yes :)

Looking at the (other) dependency differences:

 $ dpkg -I /var/cache/apt/archives/pychess_1.0.0-1.2_all.deb
 ...
 Depends: python3:any, gnome-icon-theme, python3-cairo, python3-gi, python3-gi-cairo, python3-pexpect, python3-sqlalchemy, python3-psutil, python3-websockets, gobject-introspection, gir1.2-glib-2.0, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-rsvg-2.0, gir1.2-gdkpixbuf-2.0, gir1.2-gtksource-3.0, gir1.2-gstreamer-1.0, gir1.2-gst-plugins-base-1.0, libgaviotatb1, gaviotatb
 ...

Versus:

 $ dpkg -I ~/Downloads/python3-pychess_1.0.0-1_all.deb
 ...
 Depends: python3:any (>= 3.4~), gnome-icon-theme, python3-gi, python3-gi-cairo, gobject-introspection, gir1.2-glib-2.0, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-rsvg-2.0, gir1.2-gdkpixbuf-2.0, gir1.2-gtksource-3.0, python3-cairo, python3-sqlalchemy, python3-pexpect, python3-psutil, python3-websockets, stockfish
 ...

And:

 $ dpkg -I ~/Downloads/python3-pychess_1.0.3-1_all.deb
 ...
 Depends: python3:any (>= 3.4~), gnome-icon-theme, python3-gi, python3-gi-cairo, gobject-introspection, gir1.2-glib-2.0, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-rsvg-2.0, gir1.2-gdkpixbuf-2.0, gir1.2-gtksource-3.0, python3-cairo, python3-sqlalchemy, python3-pexpect, python3-psutil, python3-websockets, stockfish
 ...

Only thing other than stockfish (which is not the missing dependency that solves the issue) I only notice the Ubuntu package is asking for gaviotatb and libgaviotatb1 (but still fails) while the github package works fine without those.

Revision history for this message
Andrew Davis (glneo) wrote :

When multiple versions of Gtk are available you must specify the required version before importing. In this case when it is first imported it is not specified so PyGI picks 4.0 and warns you.

Then later the program imports Gtk again when checking dependencies, but this time specifying the needed version (3.0), which fails as 4.0 was already loaded. This patch fixes the warning and the subsequent failure:

https://github.com/pychess/pychess/commit/e6091ea11ef4164c9cf14180d782eecba1b6bfcc

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can reproduce the bug in Jammy, and have also tested and confirmed that Focal, Mantic and Noble are not affected.

Changed in pychess (Ubuntu):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in pychess (Ubuntu Jammy):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in pychess (Ubuntu):
status: Confirmed → Fix Released
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Jammy attached.

summary: - pychess is broken in Jammy
+ [SRU] pychess is broken in Jammy
description: updated
Changed in pychess (Ubuntu Jammy):
status: In Progress → Confirmed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Julian Andres Klode (juliank) wrote :

Sponsored, thank you

Changed in pychess (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Nicholaus, or anyone else affected,

Accepted pychess into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pychess/1.0.0-1.2ubuntu0.1 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 pychess (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the pychess package in jammy-proposed has fixed the bug for me.

Test done:

1. Install pychess from jammy-proposed
2. Execute pychess, the startup dialogue box with hints opens.
3. start a new game, choose computer as opponent and play

Test result: the errors with pychess has been fixed.

Package tested:

$ dpkg -l | grep pychess
ii pychess 1.0.0-1.2ubuntu0.1 all Fully featured, nice looking, easy to use Chess Client

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

This bug was fixed in the package pychess - 1.0.0-1.2ubuntu0.1

---------------
pychess (1.0.0-1.2ubuntu0.1) jammy; urgency=medium

  * Fix crash on startup (LP: #1959523)

 -- Sudip Mukherjee <email address hidden> Thu, 08 Feb 2024 23:57:49 +0000

Changed in pychess (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for pychess 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.