[SRU] safeeyes crashed with ModuleNotFoundError in /usr/lib/python3/dist-packages/safeeyes/utility.py: No module named 'distutils'

Bug #2075269 reported by Sudip Mukherjee
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
safeeyes (Debian)
New
Unknown
safeeyes (Ubuntu)
Fix Released
Medium
Unassigned
Noble
Fix Committed
Undecided
Unassigned

Bug Description

[ Impact ]

safeeyes is completely unusable. It will fail immediately when the user tries to start the application and will crash with the error:

$ safeeyes --help
Traceback (most recent call last):
  File "/usr/bin/safeeyes", line 33, in <module>
    sys.exit(load_entry_point('safeeyes==2.1.5', 'console_scripts', 'safeeyes')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/safeeyes", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 32, in <module>
    from safeeyes import utility
  File "/usr/lib/python3/dist-packages/safeeyes/utility.py", line 35, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

[ Test Plan ]

install safeeyes

1) quick test:
open a terminal and use the command "safeeyes --help"

If the package is not fixed it will crash with the above error.

2) Detailed test:
start safeeyes from the launcher menu.
click on the safeeyes icon in the status bar to open the menu and then click on setting in the menu.

Change the time limits for intervals. ( I used 1 minute for interval between short breaks and interval between long breaks)
Select the "Plugins" tab and disable "Smart Pause".
close the settings.

After the time interval is over "safeeyes" will lock the screen with a message.

[ Where problems could occur ]

This upstream patch is changing the way it compares versions of the plugins at startup. As a worst case scenario if the changed code does not work then safeeyes will not start. But considering the fact the safeeyes is unusable now, the user should not see any new regression than what already exists.

[ Other Info ]

1. An extra runtime dependency on python3-packaging was added.
2. This has been fixed in Oracular.
3. In the Debian bug, the upstream co-maintainer mentioned something about a build problem. But I am not sure what problem they saw. There was no build problem in Oracular and the package in Oracular works as expected. I have built the SRU upload in a PPA and there was no build problem in Noble either. The PPA build log can be seen at: https://launchpad.net/~sudipmuk/+archive/ubuntu/test-ppa1/+build/28725597

[ Original Bug Description ]

safeeyes crashes immediately when executed.

$ safeeyes
Traceback (most recent call last):
  File "/usr/bin/safeeyes", line 33, in <module>
    sys.exit(load_entry_point('safeeyes==2.1.9', 'console_scripts', 'safeeyes')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/safeeyes", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 32, in <module>
    from safeeyes import utility
  File "/usr/lib/python3/dist-packages/safeeyes/utility.py", line 35, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

ProblemType: Crash
DistroRelease: Ubuntu 24.10
Package: safeeyes 2.1.9-1
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
ApportVersion: 2.28.1-0ubuntu4
Architecture: amd64
CasperMD5CheckResult: pass
CrashCounter: 1
CurrentDesktop: ubuntu:GNOME
Date: Tue Jul 30 21:37:42 2024
ExecutablePath: /usr/bin/safeeyes
InstallationDate: Installed on 2024-06-17 (43 days ago)
InstallationMedia: Ubuntu 24.10 "Oracular Oriole" - Daily amd64 (20240617)
InterpreterPath: /usr/bin/python3.12
JournalErrors:
 Jul 30 21:37:38 hostname org.gnome.Characters[11690]: MESA: error: ZINK: failed to choose pdev
 Jul 30 21:37:38 hostname org.gnome.Characters[11690]: libEGL warning: egl: failed to create dri2 screen
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/safeeyes
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
Python3Details: /usr/bin/python3.12, Python 3.12.4, python3-minimal, 3.12.3-0ubuntu1
PythonArgs: ['/usr/bin/safeeyes']
PythonDetails: N/A
SourcePackage: safeeyes
Title: safeeyes crashed with ModuleNotFoundError in /usr/lib/python3/dist-packages/safeeyes/utility.py: No module named 'distutils'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sudo users

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :
tags: removed: need-duplicate-check
Changed in safeeyes (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
Changed in safeeyes (Debian):
status: Unknown → New
Changed in safeeyes (Ubuntu):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package safeeyes - 2.1.9-1ubuntu1

---------------
safeeyes (2.1.9-1ubuntu1) oracular; urgency=medium

  * Fix crash by removing use of distutils. (LP: #2075269)
    - Add dependency on python3-packaging.

 -- Sudip Mukherjee <email address hidden> Thu, 01 Aug 2024 19:18:50 +0100

Changed in safeeyes (Ubuntu):
status: In Progress → Fix Released
Changed in safeeyes (Ubuntu Noble):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in safeeyes (Ubuntu):
assignee: Sudip Mukherjee (sudipmuk) → nobody
summary: - safeeyes crashed with ModuleNotFoundError in /usr/lib/python3/dist-
- packages/safeeyes/utility.py: No module named 'distutils'
+ [SRU] safeeyes crashed with ModuleNotFoundError in
+ /usr/lib/python3/dist-packages/safeeyes/utility.py: No module named
+ 'distutils'
description: updated
Changed in safeeyes (Ubuntu Noble):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Sudip, or anyone else affected,

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

I can confirm that safeeyes from noble-proposed has fixed the bug for me.

Test done:

install safeeyes and try to execute "safeeyes --help" and confirmed that it still fails.

Added noble-proposed to apt sources.
install safeeyes from noble-proposed.

Followed the testplan and quickly tried "safeeyes --help" which worked.
Then went for the detailed test with setting the time limits and waiting to confirm that safeeyes locks the screen.

Package tested:

$ apt-cache policy safeeyes
safeeyes:
  Installed: 2.1.5-0.1ubuntu0.1
  Candidate: 2.1.5-0.1ubuntu0.1
  Version table:
 *** 2.1.5-0.1ubuntu0.1 100
        100 http://gb.archive.ubuntu.com/ubuntu noble-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.1.5-0.1 500
        500 http://gb.archive.ubuntu.com/ubuntu noble/universe amd64 Packages

tags: added: verification-done verification-done-noble
removed: verification-needed verification-needed-noble
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.