machine 2.0 schema check failed: hardware_info: expected map, got nothing

Bug #2009064 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Simon Richardson
2.9
Fix Released
High
Unassigned
3.1
Fix Released
High
Unassigned

Bug Description

When trying to add a new machine (in ready state in maas) to the juju model using `juju add-unit --to foo.maas ubuntu`, the machine stays in pending state

$ juju show-machine 31
model: XXXX
machines:
  "31":
    juju-status:
      current: pending
      since: 02 Mar 2023 15:06:49Z
    instance-id: pending
    machine-status:
      current: pending
      since: 02 Mar 2023 15:06:49Z
    modification-status:
      current: idle
      since: 02 Mar 2023 15:06:49Z
    series: focal
    constraints: arch=amd64

According to the logs, juju is receiving a response from maas that's missing the hardware info section, this is a violation to the schema as its defined by juju at https://github.com/juju/gomaasapi/blob/v2/machine.go#L528

Our maas is a fairly old installation that has been receiving upgrades over time:

$ stat /var/log/installer/status
  File: '/var/log/installer/status'
  Size: 55916 Blocks: 112 IO Block: 4096 regular file
Device: 801h/2049d Inode: 13107220 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-06-06 11:22:43.380602193 +0000
Modify: 2012-07-21 03:10:24.874111020 +0000
Change: 2012-07-21 03:10:24.874111020 +0000
 Birth: -

[Environment]

juju 2.9.35
MAAS version: 2.3.7 (6529-g49c39fc-0ubuntu1)

Relevant log:

machine-0: 17:19:51 DEBUG juju.worker.dependency "compute-provisioner" manifold worker started at 2023-03-02 17:19:51.459753609 +0000 UTC
machine-0: 17:19:54 DEBUG juju.worker.dependency "compute-provisioner" manifold worker stopped: processing updated machines: getting all instances from broker: machine 0: machine 2.0 schema check failed: ha
rdware_info: expected map, got nothing
stack trace:
hardware_info: expected map, got nothing
github.com/juju/gomaasapi/v2.machine_2_0:550: machine 2.0 schema check failed: hardware_info: expected map, got nothing
github.com/juju/gomaasapi/v2.readMachineList:500: machine 0
github.com/juju/gomaasapi/v2.(*controller).Machines:374:
github.com/juju/juju/provider/maas.(*maasEnviron).instances2:1695:
github.com/juju/juju/worker/provisioner.(*provisionerTask).populateMachineMaps:375: getting all instances from broker
github.com/juju/juju/worker/provisioner.(*provisionerTask).processMachines:337:
github.com/juju/juju/worker/provisioner.(*provisionerTask).loop:225: processing updated machines
machine-0: 17:19:54 ERROR juju.worker.dependency "compute-provisioner" manifold worker returned unexpected error: processing updated machines: getting all instances from broker: machine 0: machine 2.0 schem
a check failed: hardware_info: expected map, got nothing

tags: added: add-machine maas-provider
Revision history for this message
Juan M. Tirado (tiradojm) wrote :
Changed in juju:
importance: Undecided → High
milestone: none → 2.9.43
status: New → Triaged
assignee: nobody → Joseph Phillips (manadart)
Revision history for this message
Simon Richardson (simonrichardson) wrote :

PR to allow hardware info to be optional: https://github.com/juju/gomaasapi/pull/99

Changed in juju:
status: Triaged → In Progress
Changed in juju:
assignee: Joseph Phillips (manadart) → Simon Richardson (simonrichardson)
Revision history for this message
Simon Richardson (simonrichardson) wrote :

See Juju PR that brings in the gomaasapi changes https://github.com/juju/juju/pull/15312

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
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.