When template cannot render correctly, node event log shows incorrect error

Bug #1420564 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

Node event log shows a bad error when cannot render a power template:

Failed to query node's BMC — Node could not be queried node-dd1e7c1c-b188-11e4-bc89-7c7a9140484f (maastest) esxi failed: name 'power_addr' is not defined at line 20 column 11 in file /etc/maas/templates/power/esxi.template

Revision history for this message
Raphaël Badin (rvb) wrote :

Why is this a "bad error"? (it might be raw but I argue that for this kind of error, you want the error to be as precise as possible and re-writing it somehow might hide details useful to fix the problem).

Now, about the error itself:
Here is the snippet that errors:
"""
power_addr = "esx://%s@%s/?no_verify=1" % (power_user, power_address)"
try:
    power_control_virsh(
        {{repr(power_addr).decode("ascii") | safe}},
""""
As you can see the last line is a *tempita expression*. The process goes like this: render tempita templace -> execute bash template (which, in turn, runs the Python code inside it).

So, the part that fails is the rendering of the tempita template. At this stage, power_addr isn't defined. You need to put the definition of 'power_addr' in the tempita template itself (for instance by using http://pythonpaste.org/tempita/#python-blocks).

Revision history for this message
Andres Rodriguez (andreserl) wrote :

It is a bad error because it is a raw error. Remember that the Node Event Log is user readable, and this might be information that the user doesn't care about.

I'd go ahead and ask the designer what they think about whether this error is helpful or not.

Changed in maas:
milestone: none → next
status: New → Triaged
importance: Undecided → Critical
Changed in maas:
importance: Critical → High
Changed in maas:
importance: High → Critical
Changed in maas:
importance: Critical → High
status: Triaged → Invalid
Changed in maas:
milestone: next → none
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.