python3-twisted breaks landscape-sysinfo

Bug #1962539 reported by Caiyun
48
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Critical
Simon Poirier
landscape-client (Ubuntu)
Fix Released
Critical
Simon Poirier

Bug Description

[What happened]

When login system from console, landscape-sysinfo error message pops up:

$ /usr/bin/landscape-sysinfo
Traceback (most recent call last):
  File "/usr/bin/landscape-sysinfo", line 22, in <module>
    run(sys.argv[1:], reactor)
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 115, in run
    for plugin in config.get_plugins():
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in get_plugins
    return [namedClass("landscape.sysinfo.%s.%s"
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in <listcomp>
    return [namedClass("landscape.sysinfo.%s.%s"
  File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 169, in namedObject
    module = namedModule(".".join(classSplit[:-1]))
  File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 156, in namedModule
    topLevel = __import__(name)
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/disk.py", line 7, in <module>
    from landscape.lib.disk import (get_mount_info, get_filesystem_for_path)
  File "/usr/lib/python3/dist-packages/landscape/lib/disk.py", line 7, in <module>
    from twisted.python.compat import _PY3
ImportError: cannot import name '_PY3' from 'twisted.python.compat' (unknown location)

[Release information]

$ lsb_release -rd
Description: Ubuntu Jammy Jellyfish (development branch)
Release: 22.04

[Package version]

$ apt-cache policy landscape-common python3-twisted
landscape-common:
  Installed: 19.12-0ubuntu10
  Candidate: 19.12-0ubuntu10
  Version table:
 *** 19.12-0ubuntu10 500
        500 http://nl.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
python3-twisted:
  Installed: 22.1.0-2ubuntu2
  Candidate: 22.1.0-2ubuntu2
  Version table:
 *** 22.1.0-2ubuntu2 500
        500 http://nl.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

[Other information]

Changelog mentioned removal of _PY3 constant
https://changelogs.ubuntu.com/changelogs/pool/main/t/twisted/twisted_22.1.0-2ubuntu2/changelog

Remove _PY3 from compat
https://github.com/twisted/twisted/commit/f40c6ace36cab4f291f400e583258f940be75b44

Related branches

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

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

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Simon Poirier (simpoir)
Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu):
importance: Undecided → Critical
Simon Poirier (simpoir)
Changed in landscape-client:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Simon Poirier (simpoir)
Simon Poirier (simpoir)
Changed in landscape-client:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 19.12-0ubuntu11

---------------
landscape-client (19.12-0ubuntu11) jammy; urgency=medium

  * debian/patches/1962539_twisted_py3.patch:
    Fix obsolete imports on jammy. (LP: #1962539)

 -- Simon Poirier <email address hidden> Wed, 02 Mar 2022 18:29:37 -0500

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Richard Leckinger (caraka) wrote :

Fix received with gratitude and it works as expected. Thank you!

Simon Poirier (simpoir)
Changed in landscape-client:
status: Fix Committed → Fix Released
Revision history for this message
DSHR (s-heuer) wrote :

I'm still observing the problem on Ubunu 20.04:

$ /etc/update-motd.d/50-landscape-sysinfo

  System information as of Do 2. Feb 14:45:01 CET 2023

Traceback (most recent call last):
  File "/usr/bin/landscape-sysinfo", line 22, in <module>
    run(sys.argv[1:], reactor)
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 115, in run
    for plugin in config.get_plugins():
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in get_plugins
    return [namedClass("landscape.sysinfo.%s.%s"
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in <listcomp>
    return [namedClass("landscape.sysinfo.%s.%s"
  File "/home/m500286/.local/lib/python3.8/site-packages/twisted/python/reflect.py", line 169, in namedObject
    module = namedModule(".".join(classSplit[:-1]))
  File "/home/m500286/.local/lib/python3.8/site-packages/twisted/python/reflect.py", line 156, in namedModule
    topLevel = __import__(name)
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/disk.py", line 7, in <module>
    from landscape.lib.disk import (get_mount_info, get_filesystem_for_path)
  File "/usr/lib/python3/dist-packages/landscape/lib/disk.py", line 7, in <module>
    from twisted.python.compat import _PY3
ImportError: cannot import name '_PY3' from 'twisted.python.compat' (unknown location)

Has the fix been backported to 20.04?

Revision history for this message
DSHR (s-heuer) wrote :

Sorry for the inconvience - I see, that I had a private version of twisted in my home. After removing that all works well!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.