MaaS 3.2 can't commission a machine having wwan module using jammy-hwe-22.04 kernel.

Bug #2050058 reported by Kevin Yeh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Stamatis Katsaounis

Bug Description

Recently I try to use MaaS to commission machines which have wwan module and always got failure on 50-maas-01-commissioning stage with error msg "Failed to parse /tmp/tmp5xcklmey: Expecting value: line 1 column 1 (char 0)".

I found that this might cause by different sysfs path on 5.15(jammy ga-22.04) and 6.2(jammy hwe-22.04).
I downloaded the binary from MaaS(http://$maas_url:5240/MAAS/machine-resources/amd64) and ran it locally got output following:

ERROR: Failed to retrieve network information: Failed to add device information for "/sys/class/net/wwan0/device": Failed to read "/sys/class/net/wwan0/device/device": read /sys/class/net/wwan0/device/device: is a directory

If I selected the commissioning kernel as jammy ga-22.04, it can correctly go through the whole sysfs and generated a json file.

My MaaS version is 3.2.6 and use UI to commission a machine.

Tags: cert-sru

Related branches

Revision history for this message
Stamatis Katsaounis (skatsaounis) wrote :

Hi Kevin, since you did that, are you able to check the lxd version? Back in time, I had a similar issue when I was adding my laptop as a VM host for my lab maas and that lead to a PR to lxd: https://github.com/canonical/lxd/pull/12281 which landed on 5.19: https://github.com/canonical/lxd/releases/tag/lxd-5.19.

Revision history for this message
Kevin Yeh (kevinyeh) wrote :

Sorry, I don't understand the relationship between lxd and MaaS. The machine I want to commission is a physical machine not a VM or lxd.

Revision history for this message
Stamatis Katsaounis (skatsaounis) wrote :

Hi Kevin, my initial comment was not 100% accurate so let me clarify the situation better. While performing commissioning, MAAS is using this binary to detect the machine characteristics. This binary is produced by this Go https://github.com/maas/maas/blob/3.2.6/src/host-info/go.mod#L5. As you can see, it is using the LXD Go API as a dependency, which in turn runs the GetResources function. So apparently my fix is not included in that version we fetch from go.mod and as such, machines with wwan devices will receive errors when this binary runs during their commissioning. I confirmed with a run on my laptop:

skatsaounis@skatsaounis-x1:~/Downloads$ ./amd64
ERROR: Failed to retrieve network information: Failed to add device information for "/sys/class/net/wwan0/device": Failed to read "/sys/class/net/wwan0/device/device": read /sys/class/net/wwan0/device/device: is a directory

And with another run from a VM (which does not have a wwan interface):

ubuntu@maas-dev:~$ ./amd64

{
    "resources": {
        "cpu": {
            "architecture": "x86_64",
            "sockets": [
                {
...

My kernel version is 6.1.0-1028-oem

Based on the above, I can confirm this is a bug.

Changed in maas:
status: New → Confirmed
Changed in maas:
status: Confirmed → Triaged
importance: Undecided → Medium
assignee: nobody → Stamatis Katsaounis (skatsaounis)
Changed in maas:
milestone: none → 3.5.0
status: Triaged → In Progress
Revision history for this message
Stamatis Katsaounis (skatsaounis) wrote :

Hi Kevin,

I linked a merge proposal for our master branch that is using a version of lxd that includes the fix for wwan devices. It would be nice if you could fetch my change, rebuild the binary and check that your machine can be commissioned.

git clone -b bump-lxd https://git.launchpad.net/~skatsaounis/maas
cd maas/src/host-info
make
sudo cp ./bin/amd64 /usr/share/maas/machine-resources

If it works then my proposal for a workaround would be to use that rebuilt binaries (for all architectures) instead of those installed by the package. If you are using snap you would have to either build your own by performing `make snap` on root level of maas repo or unpack/repack the existing one. Both options will give you a snap that cannot update from upstream channel anymore but you could be unblocked.

FYI, the fix will land in 3.5

Changed in maas:
status: In Progress → Fix Committed
Revision history for this message
Dinh Tam Nguyen (tamnd17) wrote :

Hi Kevin, I also encountered the error "Failed to parse /tmp/xxx: Expection Value: Line 1 Column 1 (char 0)" when running custom commissioning scrip.
Because you can't access the server if you can't commission successfully, I wonder how you run amd64 binary locally ?
Thank you !

Changed in maas:
milestone: 3.5.0 → 3.5.0-beta1
status: Fix Committed → Fix Released
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.