AttributeError: 'array.array' object has no attribute 'tostring'

Bug #1911050 reported by Joshua Powers
62
This bug affects 12 people
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Fix Released
High
Brian Murray
Hirsute
Fix Released
High
Brian Murray

Bug Description

Summary
===
Landscape client MOTD is throwing an exception Hirsuite, which shows up in the MOTD on launch.

Expected Result
===
No Exceptions

Actual result
===
In the MOTD, the following is printed:

=> There were exceptions while processing one or more plugins. See
/var/log/landscape/sysinfo.log for more information.

The result of that file is:

2021-01-11 19:40:34,309 ERROR Network plugin raised an exception.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/landscape/sysinfo/sysinfo.py", line 99, in run
result = plugin.run()
File "/usr/lib/python3/dist-packages/landscape/sysinfo/network.py", line 36, in run
device_info = self._get_device_info()
File "/usr/lib/python3/dist-packages/landscape/lib/network.py", line 163, in get_active_device_info
speed, duplex = get_network_interface_speed(
File "/usr/lib/python3/dist-packages/landscape/lib/network.py", line 249, in get_network_interface_speed
res = status_cmd.tostring()
AttributeError: 'array.array' object has no attribute 'tostring'

Steps to reproduce
===
1. Launch a GCE cloud image for Hirsute (20210106)
2. SSH into the system
3. Note the MOTD message

landscape-common:
Installed: 19.12-0ubuntu7
Candidate: 19.12-0ubuntu7
Version table:
*** 19.12-0ubuntu7 500
500 http://us-west1.gce.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages
100 /var/lib/dpkg/status

Revision history for this message
Joshua Powers (powersj) wrote :

This is not limited to GCE cloud images, but also the KVM images from:

https://cloud-images.ubuntu.com/hirsute

Revision history for this message
Bruno Redondi (brunor73) wrote :

See https://docs.python.org/3.9/whatsnew/3.9.html#removed

"array.array: tostring() and fromstring() methods have been removed. They were aliases to tobytes() and frombytes(), deprecated since Python 3.2."

editing /usr/lib/python3/dist-packages/landscape/lib/network.py and replacing "res = status_cmd.tostring()" with "res = status_cmd.tobytes()" solves the problem

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
tags: added: rls-hh-incoming
Changed in landscape-client (Ubuntu):
importance: Undecided → High
Chen Xiang (chauncey98)
no longer affects: landscape-client
Revision history for this message
Paul Larson (pwlars) wrote :

This also shows up on raspi server images

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1911050

tags: added: iso-testing
Revision history for this message
Dave Jones (waveform) wrote :

I thought I'd fixed this with https://github.com/CanonicalLtd/landscape-client/pull/90 -- has that not had a release yet?

Revision history for this message
Paul Larson (pwlars) wrote :

it was still broken in the 20210420 image, I'll check the latest 21.1 image today

Changed in landscape-client (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: Confirmed → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Joshua, or anyone else affected,

Accepted landscape-client into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/19.12-0ubuntu9.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-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. 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 landscape-client (Ubuntu Hirsute):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Chris Araman (chris.araman) wrote :

> Selected version '19.12-0ubuntu9.1' (Ubuntu:21.04/hirsute-proposed [arm64]) for 'landscape-common'

This version fixed the issue for my Raspberry Pi 4B.

Before the proposed package, motd did not show IPv4/IPv6 addresses, but instead showed:
> => There were exceptions while processing one or more plugins. See
> /var/log/landscape/sysinfo.log for more information.

After installing the proposed package, motd shows IPv4 and IPv6 addresses for each interface.

tags: added: verification-done-hirsute
removed: verification-needed-hirsute
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 19.12-0ubuntu9.1

---------------
landscape-client (19.12-0ubuntu9.1) hirsute; urgency=medium

  * Replace deprecated tostring() call with tobytes(). (LP: #1911050)

 -- Brian Murray <email address hidden> Thu, 22 Apr 2021 14:59:38 -0700

Changed in landscape-client (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
UweG (rug) wrote :

Got the same error today when launching Ubuntu-CommPrev running on WSL2

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

This bug was fixed in the package landscape-client - 19.12-0ubuntu9.1

---------------
landscape-client (19.12-0ubuntu9.1) hirsute; urgency=medium

  * Replace deprecated tostring() call with tobytes(). (LP: #1911050)

 -- Brian Murray <email address hidden> Thu, 22 Apr 2021 14:59:38 -0700

Changed in landscape-client (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for landscape-client has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.