update-manager crashed with AttributeError in __init__(): module 'platform' has no attribute 'dist'

Bug #1858992 reported by nick3499-ubuntu-amd64
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

1. `$ lsb_release -rd` returns the following:

```
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
```

==========

2. `$ apt-cache policy update-manager` returns the following:

```
update-manager:
  Installed: 1:19.04.8
  Candidate: 1:19.04.8
  Version table:
 *** 1:19.04.8 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal/main i386 Packages
        100 /var/lib/dpkg/status
```

==========

3. I expected `update-manager` to check for updates, an list any available package updates.
4. I think my `update-manager` crashed while it was getting package update headers.

==========

I had installed `python3.8` from Debian repo and used `update-alternatives` to set its priority level over `python3.7`.

```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
```

`$ sudo update-alternatives --config python3` returns the following:

```
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/python3.8 2 auto mode
  1 /usr/bin/python3.7 1 manual mode
  2 /usr/bin/python3.8 2 manual mode

Press <enter> to keep the current choice[*], or type selection number:
```

`$ journalctl | grep "update-manager"` returned the following:

```
Jan 09 00:46:14 nick-CM1630 sudo[11035]: nick : TTY=pts/0 ; PWD=/home/nick ; USER=root ; COMMAND=/usr/bin/update-manager --check-dist-upgrades --devel-release --proposed --debug
Jan 09 00:46:16 nick-CM1630 dbus-daemon[846]: [system] Activating service name='org.debian.apt' requested by ':1.2527' (uid=0 pid=11036 comm="/usr/bin/python3 /usr/bin/update-manager --check-d" label="unconfined") (using servicehelper)
Jan 09 00:46:28 nick-CM1630 update-notifier-crash[11409]: update-manager
Jan 09 00:51:00 nick-CM1630 whoopsie[30066]: [00:51:00] Parsing /var/crash/_usr_bin_update-manager.0.crash.
Jan 09 00:51:01 nick-CM1630 whoopsie[30066]: [00:51:00] Uploading /var/crash/_usr_bin_update-manager.0.crash.
Jan 09 00:51:03 nick-CM1630 sudo[13969]: root : TTY=unknown ; PWD=/root ; USER=nick ; ENV=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus ; COMMAND=/usr/bin/xdg-open https://bugs.launchpad.net/ubuntu/+source/update-manager/+filebug/66df57a6-32ac-11ea-a586-0025b3df357a?field.title=update-manager+crashed+with+AttributeError+in+__init__%28%29%3A+module+%27platform%27+has+no+attribute+%27dist%27
```

Debug log returned by `update-manager`:

```
DEBUG:AptClient.DebconfProxy:debconf socket: /tmp/aptdaemon-3uz3s6_d/debconf.socket
DEBUG:root:debconf.start()
DEBUG:root:debconf.stop()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 236, in _on_finished
    self._action_done(action,
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 95, in _action_done
    self.window_main.start_available(is_cancelled_update)
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 233, in start_available
    self.refresh_cache()
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 388, in refresh_cache
    self.update_list = UpdateList(self)
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/UpdateList.py", line 211, in __init__
    self.dist = dist if dist else platform.dist()[2]
```

Found (3) files in `/var/crash`. I assume that log was "uploaded".

- /var/crash/_usr_bin_update-manager.0.crash
- /var/crash/_usr_bin_update-manager.0.upload
- /var/crash/_usr_bin_update-manager.0.uploaded

To solve my issue, I used `$ sudo update-alternatives --config python3` to give `python3.7` priority over `python3.8`:

```
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/python3.8 2 auto mode
  1 /usr/bin/python3.7 1 manual mode
  2 /usr/bin/python3.8 2 manual mode

Press <enter> to keep the current choice[*], or type selection number: 1

update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python3 (python3) in manual mode
```

`$ sudo update-alternatives --config python3` returned:

```
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection Path Priority Status
------------------------------------------------------------
  0 /usr/bin/python3.8 2 auto mode
* 1 /usr/bin/python3.7 1 manual mode
  2 /usr/bin/python3.8 2 manual mode

Press <enter> to keep the current choice[*], or type selection number:
```

Additional Actions

Since the "Software Updater" window froze and would not close, I killed the `update-notifier` and `gnome-software` processes using System Monitor. But that failed to close the frozen window. So I used the desktop's top pulldown menu to open another "Software Updater" which successfully opened and listed software updates. I closed the "Software Updater", and installed the updates using `$ sudo apt-get dist-upgrade -y`. Those packages were libmysofa0, libvncclient1, python3-httplib2 and usb-modeswitch, and they all installed successfully.

ProblemType: Crash
DistroRelease: Ubuntu 20.04
Package: update-manager 1:19.04.8
ProcVersionSignature: Ubuntu 5.0.0-37.40~18.04.1-generic 5.0.21
Uname: Linux 5.0.0-37-generic x86_64
ApportVersion: 2.20.11-0ubuntu15
Architecture: amd64
Date: Thu Jan 9 00:46:28 2020
ExecutablePath: /usr/bin/update-manager
InstallationDate: Installed on 2020-01-05 (3 days ago)
InstallationMedia: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
InterpreterPath: /usr/bin/python3.8
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/update-manager --check-dist-upgrades --devel-release --proposed --debug
ProcEnviron:
 LANG=en_US.UTF-8
 TERM=xterm-256color
 PATH=(custom, no user)
 SHELL=/bin/bash
Python3Details: /usr/bin/python3.8, Python 3.8.0+, python3-minimal, 3.7.5-1ubuntu1
PythonArgs: ['/usr/bin/update-manager', '--check-dist-upgrades', '--devel-release', '--proposed', '--debug']
PythonDetails: N/A
SourcePackage: update-manager
Title: update-manager crashed with AttributeError in __init__(): module 'platform' has no attribute 'dist'
UpgradeStatus: Upgraded to focal on 2020-01-07 (1 days ago)
UserGroups:

Revision history for this message
nick3499-ubuntu-amd64 (nick3499) wrote :
tags: removed: need-duplicate-check
Changed in update-manager (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
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
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.