update-manager stops working when installing python components using invalid versions

Bug #2012110 reported by GRUGEL
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Confirmed
High
Unassigned
setuptools (Ubuntu)
Confirmed
Undecided
Unassigned
update-manager (Ubuntu)
Confirmed
High
Unassigned

Bug Description

Installing syncthing-gtk in Lunar for example is enough to make aptd error out and break update-manager

  File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'v0.9.4.4-ds-git20221205-12a9702d29ab'

While we should fix syncthing-gtk, the bug shows that other packages also have the issue, including upstream/third party ones. Ideally aptdaemon should be able to keep working or at least surface the problem to the user in a way they can understand

----------------------------------------

Expected behavior: Display a list of updates.
What happens: Dialog box says "You stopped the check for updates".
Expected behavior: When I choose "Check again" then displays a list of updates.
What happens: Displays "You stopped the check for updates".

apt-get update/upgrade works. But software-updater has same behavior after I run it.
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.3
Aptdaemon:

Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 22.04
GsettingsChanges:
 b'com.ubuntu.update-manager' b'first-run' b'false'
 b'com.ubuntu.update-manager' b'launch-count' b'67'
 b'com.ubuntu.update-manager' b'launch-time' b'int64 1679093993'
InstallationDate: Installed on 2023-02-27 (18 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
Package: update-manager 1:22.04.10
PackageArchitecture: all
ProcVersionSignature: Ubuntu 5.19.0-35.36~22.04.1-generic 5.19.17
Tags: wayland-session jammy
Uname: Linux 5.19.0-35-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True

Revision history for this message
GRUGEL (grugel) wrote :
Paul White (paulw2u)
affects: ubuntu → update-manager (Ubuntu)
Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

I have seen this behavior on Lunar, but just to be sure, please run 'apport-collect 2012110'.

Revision history for this message
GRUGEL (grugel) wrote : CurrentDmesg.txt.txt

apport information

tags: added: apport-collected jammy wayland-session
description: updated
Revision history for this message
GRUGEL (grugel) wrote : Dependencies.txt

apport information

Revision history for this message
GRUGEL (grugel) wrote : DpkgHistoryLog.txt.txt

apport information

Revision history for this message
GRUGEL (grugel) wrote : DpkgTerminalLog.txt.txt

apport information

Revision history for this message
GRUGEL (grugel) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
GRUGEL (grugel) wrote : ProcEnviron.txt

apport information

Revision history for this message
GRUGEL (grugel) wrote : Re: Software updater displays "You stopped the check for updates"

I ran 'apport-collect 2012110'.

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Thanks!

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

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Mordi (mrdc76) wrote :

I experience this bug on Lunar.

Revision history for this message
Ben Baker (benbaker76) wrote :

@mrdc76 I also experience this in Lunar. This is the output I get when running `update-manager` from Terminal:
```
$ update-manager
WARNING:root:failed to process /proc/version_signature.
WARNING:root:Failed to parse kernel: 6.3.0-acso
WARNING:root:unable to determine enough kernel information to check livepatch support
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/defer/__init__.py", line 483, in _inline_callbacks
    result = gen.throw(excep)
             ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 152, in update
    trans = yield self.client.update_cache(defer=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
```

Revision history for this message
omid.1985 (omid-1985) wrote (last edit ):

Hello,

I'm having the same issue.

After the upgrade from Ubuntu 22.10 to Ubuntu 23.04, the update-manager package is broken and will not perform any update.

Symptoms:
- launch update-manager 23.04.2
- screen freezes for a few seconds
- note that the UI shows "You stopped the check for updates"
- note that app has returned:

"Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/defer/__init__.py", line 483, in _inline_callbacks
    result = gen.throw(excep)
             ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 152, in update
    trans = yield self.client.update_cache(defer=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying"

Steps taken:
- Reinstalled update-related packages with:
"sudo apt reinstall apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core dbus"

- Reinstalled every single installed package again with this script:"
\#\!/bin/bash
for pkg in `dpkg --get-selections | awk '{print $1}' | egrep -v '(dpkg|apt|mysql|mythtv)'` ; do apt-get -y --allow-change-held-packages install --reinstall $pkg ; done

I am still having the same issue.

Revision history for this message
Samuel Zimmerman (5j9843fk34) wrote :

This bug has been plaguing since I installed 23.04 when it first came out. The Ubuntu Software store app also doesn't work. I'm thinking it's because of this same bug. I can launch the Software app but clicking on a specific app, searching for something, getting the list of installed apps, and checking for updates, are all broken.

Revision history for this message
Ben Baker (benbaker76) wrote (last edit ):

So I managed to fix this issue on my system.

First I ran `sudo aptd -r` which output a bunch of errors but at the end it had:

...
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.25.0-ca5fd8ee'
(package: bcc)

So this pointed at the issue being caused by the bcc package. So I did a quick search.

$ find /usr/lib/python3/dist-packages -iname bcc-*
/usr/lib/python3/dist-packages/bcc-0.26.0_99726b9e.egg-info
/usr/lib/python3/dist-packages/bcc-0.26.0.egg-info
/usr/lib/python3/dist-packages/bcc-0.25.0_ca5fd8ee.egg-info
/usr/lib/python3/dist-packages/bcc-128_NOTFOUND_ca5fd8ee.egg-info

Then I just deleted them.

$ sudo rm -R /usr/lib/python3/dist-packages/bcc-0.26.0_99726b9e.egg-info
$ sudo rm -R /usr/lib/python3/dist-packages/bcc-0.26.0.egg-info
$ sudo rm -R /usr/lib/python3/dist-packages/bcc-0.25.0_ca5fd8ee.egg-info
$ sudo rm -R /usr/lib/python3/dist-packages/bcc-128_NOTFOUND_ca5fd8ee.egg-info

Now I can run `update-manager` without any issue. I did then compile and install the latest version of bcc and it still runs fine.

Hopefully this will help point others in the right direction.

Revision history for this message
omid.1985 (omid-1985) wrote :

Thanks @benbaker76,
For me the error was:
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'v0.9.4.4-ds-git20221205-12a9702d29ab'
(package: syncthing-gtk)\

"sudo apt purge syncthing-gtk" fixed the issue.

Revision history for this message
Samuel Zimmerman (5j9843fk34) wrote :

syncthin-gtk was the issue for me too. My Ubuntu Software store program still doesn't work but I guess that's a different issue. Thanks @benbaker76

Revision history for this message
Brad Tomlinson (tommodev) wrote (last edit ):

Adding to the list above: had same blocker on starting `update-manager` as #14, worked through the following sequence

Test update manager:

❯ update-manager
    Gtk.main()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1687, in main
    with register_sigint_fallback(Gtk.main_quit):
  File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 237, in register_sigint_fallback
    signal.default_int_handler(signal.SIGINT, None)
KeyboardInterrupt

Execute aptd -r, exited with note on package: shredder

❯ sudo aptd -r
10:19:41 AptDaemon [INFO]: Initializing daemon
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:35: PyGIWarning: PackageKitGlib
...
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '2.9.0.Odd.Olm'
(package: Shredder)

apt search on shredder pointed to rmlint

❯ apt search shredder
Sorting... Done
Full Text Search... Done
rmlint-gui/lunar,now 2.9.0-2.3 all [installed,automatic]
  GTK+ frontend to rmlint

Purge rmlint:

❯ sudo apt purge rmlint
Reading package lists... Done
Building dependency tree... Done
...

Software updater executed OK after these steps.

---

Quick comparison between syncthing-gtk and rmlint-gui turns up 2 common deps if this helps:

- gir1.2-rsvg-2.0
- python3-gi-cairo

Additionally, "shredder" was an earlier product name for `rmlint-gui`, https://rmlint.readthedocs.io/en/latest/gui.html

Revision history for this message
Norman Rieß (weuxel) wrote :

Same issue, but i´d rather not purge syncthing-gtk.

tags: added: rls-nn-incoming
Changed in update-manager (Ubuntu):
importance: Undecided → High
Changed in aptdaemon (Ubuntu):
importance: Undecided → High
summary: - Software updater displays "You stopped the check for updates"
+ update-manager stops working when installing python components using
+ invalid versions
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in aptdaemon (Ubuntu):
status: New → Confirmed
Changed in setuptools (Ubuntu):
status: New → Confirmed
Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

I agree that

sudo apt purge syncthing-gtk

is not a solution, but this bug fixed itself with the less brutal and consequence free:

sudo apt remove syncthink-gtk
sudo apt install syncthink-gtk

Now, both syncthing-gtk and software-updater work. Weird!

Revision history for this message
Norman Rieß (weuxel) wrote :

Nope, tried that, issue persists.

Revision history for this message
Norman Rieß (weuxel) wrote :

Fixed for me in Mantic.

Revision history for this message
Asif Rahaman (asifr) wrote :

****************************Easy fix *********************************************

Hey there so it happened for me.

Use the following two line step.

$ find /usr/lib/python3/dist-packages -iname bcc-*

Whatever are the list of files you get just delete them

For example

$ sudo rm -R sudo rm -R /usr/lib/python3/dist-packages/bcc-0.29.1.egg-info

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.