Bug 7947 - false positive on detecting PyGObject on Debian/Ubuntu
Summary: false positive on detecting PyGObject on Debian/Ubuntu
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.15.0
Assignee: Pierre Ossman
URL:
Keywords: prosaic, wilsj_tester
Depends on:
Blocks:
 
Reported: 2022-06-13 14:02 CEST by Pierre Ossman
Modified: 2022-06-21 10:56 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2022-06-13 14:02:03 CEST
It's unfortunately possible to get Ubuntu (and Debian?) in to a state where our code incorrectly detects that PyGObject is installed. The installer then proceeds incorrectly, preventing the user from easily proceeding with the installation.

This is what it looks like running the installation:

> $ ./tl-4.14.0-server/install-server 
> Traceback (most recent call last):
>   File "<stdin>", line 9, in <module>
> AttributeError: module 'gi' has no attribute 'require_version'
> 
> Error: GTK+ not found.
> 
> GTK+ 3.20 is required for ThinLinc's graphical installer.
> To install GTK+ and its introspection binding, please run this command:
> 
>     sudo apt install gir1.2-gtk-3.0
> 
> Would you like to run this command now?
> 
> Alternatively, run this program from a terminal without the
> DISPLAY environment variable set to get the text mode fallback.
> 
> (Y/n)? y
> 
> $ sudo apt install gir1.2-gtk-3.0
> [sudo] password for cendio: 
> Reading package lists... Done
> Building dependency tree... Done
> Reading state information... Done
> gir1.2-gtk-3.0 is already the newest version (3.24.33-1ubuntu2).
> ...

The cause of this is that there are some PyGObject overrides installed¹, but they lack a Depends: on PyGObject itself. This causes Python to treat "import gi" as a namespace, rather than a package.

¹ gir1.2-dee-1.0 and gir1.2-unity-7.0

This is a regression in 4.13.0, caused by our upgrade to Python 3 and switching PyGTK to PyGObject.

In theory, this could happen on any system, not just Ubuntu.

Seen on Ubuntu 22.04.
Comment 1 Pierre Ossman cendio 2022-06-14 10:47:01 CEST
This code got removed as part of bug 7904, so this is no longer an issue as described.

However, the same thing might happen in tl-setup's or tlgtk's code. Need to have a look there as well.
Comment 2 Pierre Ossman cendio 2022-06-14 10:54:25 CEST
Yup:

> ERROR:root:Traceback (most recent call last):
> ERROR:root:  File "/home/cendio/tl-4.14.0post-server/libs/tlinstaller", line 755, in <module>
> ERROR:root:    i1111 ( )
> ERROR:root:  File "/home/cendio/tl-4.14.0post-server/libs/tlinstaller", line 627, in i1111
> ERROR:root:    if not tlgtk . init ( wmclass = iIIIII1i111i ) :
> ERROR:root:  File "/home/cendio/tl-4.14.0post-server/libs/modules/thinlinc/tlgtk/__init__.py", line 60, in init
> ERROR:root:    gi . require_version ( "Gtk" , "3.0" )
> ERROR:root:AttributeError: module 'gi' has no attribute 'require_version'

And:

> 2022-06-14 08:53:45,829: Traceback (most recent call last):
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 317, in <module>
> 2022-06-14 08:53:45,829:     oOoO00 ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 273, in oOoO00
> 2022-06-14 08:53:45,829:     IiiI1III1iI = Iioo0Oo0oO0 . run ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 108, in run
> 2022-06-14 08:53:45,829:     return self . _run_text ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 126, in _run_text
> 2022-06-14 08:53:45,829:     iI1iI ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/modules/thinlinc/tlsetup/system_check.py", line 45, in Iio0
> 2022-06-14 08:53:45,829:     ii1iI1I ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/modules/thinlinc/tlsetup/system_check.py", line 22, in ii1iI1I
> 2022-06-14 08:53:45,829:     i11IiIIiii1II ( )
> 2022-06-14 08:53:45,829:   File "/opt/thinlinc/modules/thinlinc/tlsetup/gtk.py", line 74, in iIIiii1iI
> 2022-06-14 08:53:45,829:     gi . require_version ( 'Gtk' , '3.0' )
> 2022-06-14 08:53:45,829: AttributeError: module 'gi' has no attribute 'require_version'
Comment 4 Pierre Ossman cendio 2022-06-14 11:19:35 CEST
Works well now. No crash in either tlgtk, nor tl-setup's gtk module. Tested on Ubuntu 22.04.
Comment 5 William Sjöblom cendio 2022-06-21 10:56:30 CEST
I have reproduced the issue using ThinLinc 4.14.0 while server build #2708 is seemingly well behaved, both in terms of tlgtk and tl-setup's gtk module.

Closing!

Note You need to log in before you can comment on or make changes to this bug.