MAAS errors on formatting micron disks if nvme command returns non-standard characters

Bug #2065820 reported by Grant Byrne
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Triaged
High
Unassigned

Bug Description

When doing a format of the disk, MAAS runs ./maas_wipe.py

For us, it was producing the following error:

Traceback (most recent call last):
  File "/home/ubuntu/./maas_wipe.py", line 575, in <module>
    main()
  File "/home/ubuntu/./maas_wipe.py", line 555, in main
    disk_info = get_disk_info()
  File "/home/ubuntu/./maas_wipe.py", line 198, in get_disk_info
    return {kname: get_disk_security_info(kname) for kname in list_disks()}
  File "/home/ubuntu/./maas_wipe.py", line 198, in <dictcomp>
    return {kname: get_disk_security_info(kname) for kname in list_disks()}
  File "/home/ubuntu/./maas_wipe.py", line 191, in get_disk_security_info
    return get_nvme_security_info(disk)
  File "/home/ubuntu/./maas_wipe.py", line 97, in get_nvme_security_info
    output = output.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 392: invalid start byte

The underlying issue was that it was failing to decode the output of the "nvme" command. In our case when we ran the following command in the ephemeral OS: sudo nvme id-ctrl /dev/nvme1n1

It returned the line: fguid : :8w�

The non-standard character at the end is causing the error on the line:
     output = output.decode()

The fix that we've come up with is to change the line to this:
     output = output.decode(encoding="ISO-8859-1")

I'd like to find a way to apply this patch because we're running into the issue pretty frequently when we upgrade the firmware on our Micron disks.

Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.6.0
Revision history for this message
maasuser1 (maasuser1) wrote (last edit ):
Revision history for this message
Grant Byrne (grantbyrne) wrote :

That looks like that is exactly the same issue. We'll try updating to Ubuntu 24.04 to see if it fixes the issue.

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.